Sierra Toolkit  Version of the Day
Stencils.hpp
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2010, 2011 Sandia Corporation. */
3 /* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
4 /* license for use of this work by or on behalf of the U.S. Government. */
5 /* Export of this program may require a license from the */
6 /* United States Government. */
7 /*------------------------------------------------------------------------*/
8 
9 #ifndef stk_mesh_Stencils_hpp
10 #define stk_mesh_Stencils_hpp
11 
12 #include <stk_util/util/StaticAssert.hpp>
13 
14 #include <stk_mesh/base/Types.hpp>
15 
16 #include <stk_mesh/fem/FEMMetaData.hpp>
17 
18 namespace stk_classic {
19 namespace mesh {
20 namespace fem {
21 
22 relation_stencil_ptr get_element_node_stencil(size_t spatial_dimension);
23 
24 template<class TopologyTraits, EntityRank element_rank >
25 int element_node_stencil( EntityRank , EntityRank , unsigned );
26 
27 
28 template<class TopologyTraits, EntityRank element_rank >
29 int element_node_stencil( EntityRank from_type , EntityRank to_type , unsigned identifier )
30 {
31  enum { number_node = TopologyTraits::node_count };
32 
33  int ordinal = -1 ;
34 
35  if ( element_rank == from_type &&
36  FEMMetaData::NODE_RANK == to_type &&
37  identifier < number_node ) {
38  ordinal = static_cast<int>(identifier);
39  }
40 
41  return ordinal ;
42 }
43 
44 } // namespace fem
45 } // namespace mesh
46 } // namespace stk_classic
47 
48 #endif // stk_mesh_Stencils_hpp
Sierra Toolkit.
int(* relation_stencil_ptr)(unsigned from_type, unsigned to_type, unsigned identifier)
A relation stencil maps entity relationships to ordinals.
Definition: Types.hpp:149