Sierra Toolkit Version of the Day
Stencils.hpp
00001 /*------------------------------------------------------------------------*/
00002 /*                 Copyright 2010, 2011 Sandia Corporation.                     */
00003 /*  Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive   */
00004 /*  license for use of this work by or on behalf of the U.S. Government.  */
00005 /*  Export of this program may require a license from the                 */
00006 /*  United States Government.                                             */
00007 /*------------------------------------------------------------------------*/
00008 
00009 #ifndef stk_mesh_Stencils_hpp
00010 #define stk_mesh_Stencils_hpp
00011 
00012 #include <stk_util/util/StaticAssert.hpp>
00013 
00014 #include <stk_mesh/base/Types.hpp>
00015 
00016 #include <stk_mesh/fem/FEMMetaData.hpp>
00017 
00018 namespace stk {
00019 namespace mesh {
00020 namespace fem {
00021 
00022 relation_stencil_ptr get_element_node_stencil(size_t spatial_dimension);
00023 
00024 template<class TopologyTraits, EntityRank element_rank >
00025 int element_node_stencil( EntityRank , EntityRank , unsigned );
00026 
00027 
00028 template<class TopologyTraits, EntityRank element_rank >
00029 int element_node_stencil( EntityRank from_type , EntityRank to_type , unsigned identifier )
00030 {
00031   enum { number_node = TopologyTraits::node_count };
00032 
00033   int ordinal = -1 ;
00034 
00035   if ( element_rank == from_type &&
00036        FEMMetaData::NODE_RANK == to_type &&
00037        identifier < number_node ) {
00038     ordinal = static_cast<int>(identifier);
00039   }
00040 
00041   return ordinal ;
00042 }
00043 
00044 } // namespace fem
00045 } // namespace mesh
00046 } // namespace stk
00047 
00048 #endif //  stk_mesh_Stencils_hpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines