|
Sierra Toolkit
Version of the Day
|
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 00014 #ifndef stk_mesh_TopologyDimensions_hpp 00015 #define stk_mesh_TopologyDimensions_hpp 00016 00017 #include <Shards_Array.hpp> 00018 00019 #include <stk_mesh/base/Field.hpp> 00020 #include <stk_mesh/base/MetaData.hpp> 00021 00022 #include <stk_mesh/fem/Stencils.hpp> 00023 00024 namespace stk_classic { 00025 namespace mesh { 00026 00032 //---------------------------------------------------------------------- 00036 class ElementNode : public shards::ArrayDimTag { 00037 public: 00038 const char * name() const ; 00039 static const ElementNode & tag(); 00040 private: 00041 ElementNode() {} 00042 ElementNode( const ElementNode & ); 00043 ElementNode & operator = ( const ElementNode & ); 00044 }; 00045 00050 typedef Field<double,ElementNode> ElementNodeField ; 00051 00056 typedef Field<double*,ElementNode> ElementNodePointerField ; 00057 typedef Field<int *,ElementNode> ElementNodeLockField ; 00058 00062 inline 00063 ElementNodeField & 00064 declare_element_node_field( MetaData & md , const std::string & s ) 00065 { 00066 00067 ElementNodeField & f = 00068 md.declare_field< ElementNodeField >( s, 1 /* 1 state */ ); 00069 00070 return f ; 00071 } 00072 00076 template< class NodeField > 00077 inline 00078 ElementNodePointerField & 00079 declare_element_node_pointer_field( 00080 MetaData & md , const std::string & s , 00081 NodeField & node_field ) 00082 { 00083 const unsigned num_states = node_field.number_of_states(); 00084 00085 ElementNodePointerField & f = 00086 md.template declare_field< ElementNodePointerField >( s, num_states ); 00087 00088 for ( unsigned i = 0 ; i < num_states ; ++i ) { 00089 FieldState state = (FieldState) i; 00090 md.declare_field_relation( 00091 f.field_of_state( state ) , 00092 fem::get_element_node_stencil(fem::FEMMetaData::get(md).spatial_dimension()) , 00093 node_field.field_of_state( state ) ); 00094 } 00095 00096 return f ; 00097 } 00098 00102 template< class NodeField > 00103 inline 00104 ElementNodeLockField & 00105 declare_element_node_lock_field( 00106 MetaData & md , const std::string & s , 00107 NodeField & node_field ) 00108 { 00109 const unsigned num_states = node_field.number_of_states(); 00110 00111 ElementNodeLockField & f = 00112 md.template declare_field< ElementNodeLockField >( s, num_states ); 00113 00114 for ( unsigned i = 0 ; i < num_states ; ++i ) { 00115 FieldState state = (FieldState) i; 00116 md.declare_field_relation( 00117 f.field_of_state( state ) , 00118 fem::get_element_node_stencil(fem::FEMMetaData::get(md).spatial_dimension()) , 00119 node_field.field_of_state( state ) ); 00120 } 00121 00122 return f ; 00123 } 00124 //---------------------------------------------------------------------- 00129 struct QuadratureTag : public shards::ArrayDimTag { 00130 const char * name() const ; 00131 static const QuadratureTag & tag(); 00132 private: 00133 QuadratureTag() {} 00134 QuadratureTag( const QuadratureTag & ); 00135 QuadratureTag & operator = ( const QuadratureTag & ); 00136 }; 00137 00138 struct BasisTag : public shards::ArrayDimTag { 00139 const char * name() const ; 00140 static const BasisTag & tag(); 00141 private: 00142 BasisTag() {} 00143 BasisTag( const BasisTag & ); 00144 BasisTag & operator = ( const BasisTag & ); 00145 }; 00146 00147 00149 //---------------------------------------------------------------------- 00150 00151 }//namespace mesh 00152 }//namespace stk_classic 00153 00154 #endif 00155