Sierra Toolkit  Version of the Day
Stencils.cpp
1 #include <stk_mesh/fem/Stencils.hpp>
2 
3 #include <stk_util/environment/ReportHandler.hpp>
4 
5 namespace stk_classic {
6 namespace mesh {
7 namespace fem {
8 
9 int
10 element_node_stencil_2d(
11  EntityRank from_type ,
12  EntityRank to_type ,
13  unsigned identifier )
14 {
15  static const size_t spatial_dimension = 2;
16 
17  int ordinal = -1 ;
18 
19  if ( spatial_dimension == from_type && FEMMetaData::NODE_RANK == to_type ) {
20  ordinal = static_cast<int>(identifier);
21  }
22 
23  return ordinal ;
24 }
25 
26 
27 int
28 element_node_stencil_3d(
29  EntityRank from_type ,
30  EntityRank to_type ,
31  unsigned identifier )
32 {
33  static const size_t spatial_dimension = 3;
34 
35  int ordinal = -1 ;
36 
37  if ( spatial_dimension == from_type && FEMMetaData::NODE_RANK == to_type ) {
38  ordinal = static_cast<int>(identifier);
39  }
40 
41  return ordinal ;
42 }
43 
44 
46 get_element_node_stencil(
47  size_t spatial_dimension)
48 {
49  ThrowRequire(spatial_dimension == 2 || spatial_dimension == 3);
50 
51  if (spatial_dimension == 3)
52  return & element_node_stencil_3d;
53  else // if (spatial_dimension == 2)
54  return & element_node_stencil_2d;
55 }
56 
57 } // namespace fem
58 } // namespace mesh
59 } // namespace stk_classic
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