Sierra Toolkit Version of the Day
Stencils.cpp
00001 #include <stk_mesh/fem/Stencils.hpp>
00002 
00003 #include <stk_util/environment/ReportHandler.hpp>
00004 
00005 namespace stk {
00006 namespace mesh {
00007 namespace fem {
00008 
00009 int
00010 element_node_stencil_2d(
00011   EntityRank            from_type ,
00012   EntityRank            to_type ,
00013   unsigned              identifier )
00014 {
00015   static const size_t spatial_dimension = 2;
00016 
00017   int ordinal = -1 ;
00018 
00019   if ( spatial_dimension == from_type && FEMMetaData::NODE_RANK == to_type ) {
00020     ordinal = static_cast<int>(identifier);
00021   }
00022 
00023   return ordinal ;
00024 }
00025 
00026 
00027 int
00028 element_node_stencil_3d(
00029   EntityRank            from_type ,
00030   EntityRank            to_type ,
00031   unsigned              identifier )
00032 {
00033   static const size_t spatial_dimension = 3;
00034 
00035   int ordinal = -1 ;
00036 
00037   if ( spatial_dimension == from_type && FEMMetaData::NODE_RANK == to_type ) {
00038     ordinal = static_cast<int>(identifier);
00039   }
00040 
00041   return ordinal ;
00042 }
00043 
00044 
00045 relation_stencil_ptr
00046 get_element_node_stencil(
00047   size_t                spatial_dimension) 
00048 {
00049   ThrowRequire(spatial_dimension == 2 || spatial_dimension == 3);
00050   
00051   if (spatial_dimension == 3)
00052     return & element_node_stencil_3d;
00053   else // if (spatial_dimension == 2)
00054     return & element_node_stencil_2d;
00055 }
00056 
00057 } // namespace fem
00058 } // namespace mesh
00059 } // namespace stk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines