1 #ifndef stk_mesh_FEMMetaData_hpp 2 #define stk_mesh_FEMMetaData_hpp 4 #include <stk_util/environment/ReportHandler.hpp> 5 #include <stk_util/util/string_case_compare.hpp> 6 #include <stk_mesh/base/Types.hpp> 7 #include <stk_mesh/base/MetaData.hpp> 8 #include <stk_mesh/base/BulkData.hpp> 9 #include <stk_mesh/fem/CellTopology.hpp> 63 #ifdef SWIG //SRK from NLM, this is to avoid pulling in a bunch more headers just to define EntityRank 66 INVALID_RANK = stk_classic::mesh::InvalidEntityRank,
73 static const EntityRank INVALID_RANK = stk_classic::mesh::InvalidEntityRank;
74 static const EntityRank NODE_RANK = 0u;
75 static const EntityRank EDGE_RANK = 1u;
76 static const EntityRank FACE_RANK = 2u;
77 static const EntityRank VOLUME_RANK = 3u;
87 const std::vector<std::string>& in_entity_rank_names = std::vector<std::string>());
100 const std::vector<std::string>& in_entity_rank_names = std::vector<std::string>()
107 return m_fem_initialized;
114 {
return fem_meta.m_meta_data; }
120 return m_spatial_dimension;
162 return m_element_rank;
196 EntityRank
get_entity_rank(
const fem::CellTopology cell_topology)
const;
242 ThrowRequireMsg(
is_FEM_initialized(),
"FEMMetaData::declare_part: FEM_initialize() must be called before this function");
252 template<
class Top >
254 return declare_part(name, shards::getCellTopologyData<Top>());
296 const char * required_by = NULL )
const 297 {
return m_meta_data.
get_part(p_name,required_by); }
301 {
return m_meta_data.
get_part(ord); }
350 m_entity_rank_names = in_entity_rank_names;
358 EntityRank my_entity_rank = InvalidEntityRank;
360 for (
size_t i = 0; i < m_entity_rank_names.size(); ++i)
361 if (
equal_case(name, m_entity_rank_names[i])) {
365 return my_entity_rank;
372 return m_entity_rank_names;
379 return m_entity_rank_names.size();
386 ThrowErrorMsgIf( in_entity_rank >= m_entity_rank_names.size(),
387 "entity-rank " << in_entity_rank <<
388 " out of range. Must be in range 0.." << m_entity_rank_names.size());
389 return m_entity_rank_names[in_entity_rank];
396 return rank < m_entity_rank_names.size();
410 template<
class field_type >
411 field_type *
get_field(
const std::string & name )
const 412 {
return m_meta_data.
get_field<field_type>(name); }
426 template<
class field_type >
428 unsigned number_of_states = 1 )
429 {
return m_meta_data.
declare_field<field_type>( name, number_of_states ); }
448 template<
class Po
interFieldType ,
class ReferencedFieldType >
451 ReferencedFieldType & referenced_field )
481 const std::string & arg_name,
482 const DataTraits & arg_traits ,
484 const shards::ArrayDimTag *
const * arg_dim_tags ,
485 unsigned arg_num_states )
486 {
return m_meta_data.
declare_field_base( arg_name, arg_traits, arg_rank, arg_dim_tags, arg_num_states); }
491 EntityRank arg_entity_rank ,
492 const Part & arg_part ,
493 const unsigned * arg_stride ,
494 const void * arg_init_value = NULL)
499 Part & declare_internal_part(
const std::string & p_name, EntityRank rank )
500 {
return m_meta_data.declare_internal_part(p_name,rank); }
504 void internal_declare_known_cell_topology_parts();
508 bool m_fem_initialized;
509 size_t m_spatial_dimension;
510 EntityRank m_side_rank;
511 EntityRank m_element_rank;
512 std::vector< std::string > m_entity_rank_names;
521 bool is_cell_topology_root_part(
const Part & part);
524 void set_cell_topology( Part &part,
const fem::CellTopology cell_topology);
527 template<
class Topology>
528 inline void set_cell_topology(Part & part)
530 stk_classic::mesh::fem::set_cell_topology(part, fem::CellTopology(shards::getCellTopologyData<Topology>()));
535 CellTopology get_cell_topology(
const Bucket &bucket);
539 inline CellTopology get_cell_topology(
const Entity &entity) {
540 return get_cell_topology(entity.bucket());
550 std::vector<std::string> entity_rank_names(
size_t spatial_dimension);
556 #endif // stk_mesh_FEMMetaData_hpp
Field base class with an anonymous data type and anonymous multi-dimension.
Data for ghosting mesh entities.
unsigned primary_entity_rank() const
The primary entity type for this part.
An application-defined subset of a problem domain.
Manager for an integrated collection of entities, entity relations, and buckets of field data...
A fundamental unit within the discretization of a problem domain, including but not limited to nodes...
bool equal_case(const char *lhs, const char *rhs)
Case-insensitive equality compare.
int(* relation_stencil_ptr)(unsigned from_type, unsigned to_type, unsigned identifier)
A relation stencil maps entity relationships to ordinals.
std::vector< Part *> PartVector
Collections of parts are frequently maintained as a vector of Part pointers.
Property base class with an anonymous data type and anonymous multi-dimension.
A container for the field data of a homogeneous collection of entities.