Sierra Toolkit
Version of the Day
|
FEMMetaData is a class that implements a Finite Element Method skin on top of the Sierra Tool Kit Meta Data class. The FEM features include the concept of spatial dimension with entity ranks tied to the given spatial dimension, cell topology mapping to parts along with induced cell topology membership through part subsetting, and many additional invariants that are enforced. More...
#include <FEMMetaData.hpp>
Public Types | |
typedef std::map< fem::CellTopology, std::pair< Part *, EntityRank > > | CellTopologyPartEntityRankMap |
CellTopologyPartEntityRankMap maps each Cell Topology to its root cell topology part and its associated rank. | |
typedef std::vector< fem::CellTopology > | PartCellTopologyVector |
PartCellTopologyVector is a fast-lookup vector of size equal to the number of parts. | |
Public Member Functions | |
FEMMetaData (size_t spatial_dimension, const std::vector< std::string > &in_entity_rank_names=std::vector< std::string >()) | |
Construct and initialize a FEMMetaData. | |
void | FEM_initialize (size_t spatial_dimension, const std::vector< std::string > &in_entity_rank_names=std::vector< std::string >()) |
Initialize the spatial dimension and an optional list of entity rank names associated with each rank. More... | |
bool | is_FEM_initialized () const |
This function returns whether this class has been initialized or not. | |
size_t | spatial_dimension () const |
Returns the spatial dimension that was passed in through FEM_initialize. | |
EntityRank | node_rank () const |
Returns the node rank, which is always zero. | |
EntityRank | edge_rank () const |
Returns the edge rank which changes depending on spatial dimension. | |
EntityRank | face_rank () const |
Returns the face rank which changes depending on spatial dimension. | |
EntityRank | volume_rank () const |
Returns the volume rank which changes depending on spatial dimension. | |
EntityRank | side_rank () const |
Returns the side rank which changes depending on spatial dimension. | |
EntityRank | element_rank () const |
Returns the element rank which is always equal to spatial dimension. | |
bool | check_rank (EntityRank rank) const |
void | register_cell_topology (const fem::CellTopology cell_topology, EntityRank in_entity_rank) |
This function is used to register new cell topologies and their associated ranks with FEMMetaData. Currently, several shards Cell Topologies are registered with appropriate ranks at initialization time. See: internal_declare_known_cell_topology_parts for the whole list. More... | |
Part & | get_cell_topology_root_part (const fem::CellTopology cell_topology) const |
Return the root cell topology part associated with the given cell topology. This Part is created in register_cell_topology. | |
fem::CellTopology | get_cell_topology (const Part &part) const |
Return the cell topology associated with the given part. The cell topology is set on a part through part subsetting with the root cell topology part. More... | |
fem::CellTopology | get_cell_topology (const std::string &topology_name) const |
EntityRank | get_entity_rank (const fem::CellTopology cell_topology) const |
Return the EntityRank that is associated with the given cell topology. In several cases, this rank is dependent on spatial dimension. | |
Part & | declare_part (const std::string &name, fem::CellTopology cell_topology) |
Declare a part with a given cell topology. | |
template<class Top > | |
Part & | declare_part (const std::string &name) |
Declare a part with a given cell topology. | |
MetaData predefined parts | |
FEMMetaData Specific functions endThe following functions are call-throughs to the underlying MetaData class: | |
Part & | universal_part () const |
Universal subset for the problem domain. All other parts are a subset of the universal part. | |
Part & | locally_owned_part () const |
Subset for the problem domain that is owned by the local process. Ghost entities are not members of this part. | |
Part & | globally_shared_part () const |
Subset for the problem domain that is shared with another process. Ghost entities are not members of this part. | |
Declare and query parts | |
Part * | get_part (const std::string &p_name, const char *required_by=NULL) const |
Get an existing part by its application-defined text name. More... | |
Part & | get_part (unsigned ord) const |
Get an existing part by its ordinal. | |
const PartVector & | get_parts () const |
Query all parts of the mesh ordered by the parts' ordinal. | |
Part & | declare_part (const std::string &p_name, EntityRank rank) |
Declare a part of the given name and entity rank Redeclaration returns the previously declared part. More... | |
Part & | declare_part (const std::string &p_name) |
Declare a part of the given name and entity rank Redeclaration returns the previously declared part. More... | |
void | declare_part_subset (Part &superset, Part &subset) |
Declare a superset-subset relationship between parts Note: Cell Topologies are induced through part subsets. See the invariants that are enforced by this function in the documentation for FEMMetaData. | |
void | declare_part_relation (Part &root_part, relation_stencil_ptr stencil, Part &target_part) |
Declare an entity-relationship between parts. More... | |
void | set_entity_rank_names (const std::vector< std::string > &in_entity_rank_names) |
Set the entity rank names in a vector. This also currently sets the maximum entity rank. | |
EntityRank | entity_rank (const std::string &name) const |
Return the rank for the given name that was provided in set_entity_rank_names. | |
const std::vector< std::string > & | entity_rank_names () const |
Return the set of entity rank names specified in set_entity_rank_names. | |
std::vector< std::string >::size_type | entity_rank_count () const |
Return the maximum entity rank. | |
const std::string & | entity_rank_name (EntityRank in_entity_rank) const |
Return the name for a given entity rank as was specified in set_entity_rank_names. | |
bool | is_valid_entity_rank (EntityRank rank) const |
Return true if the given entity rank is valid. | |
Declare and query fields | |
template<class field_type > | |
field_type * | get_field (const std::string &name) const |
Get a field, return NULL if it does not exist. More... | |
const FieldVector & | get_fields () const |
Get all defined fields. | |
template<class field_type > | |
field_type & | declare_field (const std::string &name, unsigned number_of_states=1) |
Declare a field of the given field_type, test name, and number of states. More... | |
template<class PointerFieldType , class ReferencedFieldType > | |
void | declare_field_relation (PointerFieldType &pointer_field, relation_stencil_ptr stencil, ReferencedFieldType &referenced_field) |
Declare a field relation. More... | |
const std::vector< FieldRelation > & | get_field_relations () const |
Get field relations. | |
void | commit () |
Commit the part and field declarations so that the meta data manager can be used to create mesh bulk data. More... | |
bool | is_commit () const |
Query if the meta data manager is committed. | |
Static Public Member Functions | |
static MetaData & | get_meta_data (FEMMetaData &fem_meta) |
Getter for MetaData off of a FEMMetaData object. | |
static FEMMetaData & | get (const MetaData &meta) |
Getter for FEMMetaData off of a MetaData object. | |
static FEMMetaData & | get (const Part &part) |
Getter for FEMMetaData off of a Part object. | |
static FEMMetaData & | get (const FieldBase &field) |
Getter for FEMMetaData off of a FieldBase object. | |
static FEMMetaData & | get (const PropertyBase &property) |
Getter for FEMMetaData off of a PropertyBase object. | |
static FEMMetaData & | get (const BulkData &bulk_data) |
Getter for FEMMetaData off of a BulkData object. | |
static FEMMetaData & | get (const Bucket &bucket) |
Getter for FEMMetaData off of a Bucket object. | |
static FEMMetaData & | get (const Entity &entity) |
Getter for FEMMetaData off of a Entity object. | |
static FEMMetaData & | get (const Ghosting &ghost) |
Getter for FEMMetaData off of a Ghosting object. | |
Field declaration with weak type information; | |
FieldBase * | declare_field_base (const std::string &arg_name, const DataTraits &arg_traits, unsigned arg_rank, const shards::ArrayDimTag *const *arg_dim_tags, unsigned arg_num_states) |
Declare a field via runtime type information. | |
void | declare_field_restriction (FieldBase &arg_field, EntityRank arg_entity_rank, const Part &arg_part, const unsigned *arg_stride, const void *arg_init_value=NULL) |
Declare a field restriction via runtime type information. | |
FEMMetaData is a class that implements a Finite Element Method skin on top of the Sierra Tool Kit Meta Data class. The FEM features include the concept of spatial dimension with entity ranks tied to the given spatial dimension, cell topology mapping to parts along with induced cell topology membership through part subsetting, and many additional invariants that are enforced.
Users who are interested in a FEM based mesh database should use FEMMetaData rather than MetaData.
Invariants for FEM MetaData:
Definition at line 54 of file FEMMetaData.hpp.
void stk_classic::mesh::fem::FEMMetaData::FEM_initialize | ( | size_t | spatial_dimension, |
const std::vector< std::string > & | in_entity_rank_names = std::vector<std::string>() |
||
) |
Initialize the spatial dimension and an optional list of entity rank names associated with each rank.
This function can only be called once. To determine if a FEMMetaData class has been initialized, call the is_FEM_initialized function.
Definition at line 61 of file FEMMetaData.cpp.
|
inline |
Return true if rank is valid.
Definition at line 544 of file FEMMetaData.hpp.
void stk_classic::mesh::fem::FEMMetaData::register_cell_topology | ( | const fem::CellTopology | cell_topology, |
EntityRank | in_entity_rank | ||
) |
This function is used to register new cell topologies and their associated ranks with FEMMetaData. Currently, several shards Cell Topologies are registered with appropriate ranks at initialization time. See: internal_declare_known_cell_topology_parts for the whole list.
Note: This function also creates the root cell topology part which is accessible from get_cell_topology_root_part
Definition at line 178 of file FEMMetaData.cpp.
fem::CellTopology stk_classic::mesh::fem::FEMMetaData::get_cell_topology | ( | const Part & | part | ) | const |
Return the cell topology associated with the given part. The cell topology is set on a part through part subsetting with the root cell topology part.
Note: This function only uses the PartCellTopologyVector to look up the cell topology for a given part. This depends on declare_part_subset to update this vector correctly. If a cell topology is not defined for the given part, then an invalid Cell Topology object will be returned.
Definition at line 239 of file FEMMetaData.cpp.
|
inline |
Get an existing part by its application-defined text name.
Return NULL if not present and required_by == NULL. If required and not present then throws an exception with the 'required_by' text.
Definition at line 295 of file FEMMetaData.hpp.
|
inline |
Declare a part of the given name and entity rank Redeclaration returns the previously declared part.
This part will have member entities that are of equal or lesser rank. When an entity of equal rank becomes a member then all related entities of lesser rank also become members.
Definition at line 314 of file FEMMetaData.hpp.
|
inline |
Declare a part of the given name and entity rank Redeclaration returns the previously declared part.
This part does not have an entity type rank.
Definition at line 322 of file FEMMetaData.hpp.
|
inline |
Declare an entity-relationship between parts.
If entity e1 is a member of root_part and there exists an entity relation from e1 to e2 that satisfies the relation stencil then e2 must be a member of the target_part .
Definition at line 340 of file FEMMetaData.hpp.
|
inline |
Get a field, return NULL if it does not exist.
std::runtime_error | If the field exits and the field_type does not match or if required_by != NULL and a field of that name is not found. |
Definition at line 411 of file FEMMetaData.hpp.
|
inline |
Declare a field of the given field_type, test name, and number of states.
A compatible redeclaration returns the previously declared field.
std::runtime_error | If a redeclaration is incompatible |
Definition at line 427 of file FEMMetaData.hpp.
|
inline |
Declare a field relation.
The pointer_field's scalar type must be a pointer to the scalar type of the reference_field. The following derived field data relationship maintained.
Let e_root -> Relation( e_target , ord , kind ) Let i = stencil( e_root.entity_rank() , e_target.entity_rank() , ord , kind ) Let Scalar ** ptr = field_data( pointer_field , e_root ) then ptr[i] = field_data( referenced_field , e_target )
This derived field data relationship is typically used to support fast access to field data on entities related to the root entity; e.g. field data associated with the nodes of an element.
Definition at line 449 of file FEMMetaData.hpp.
|
inline |
Commit the part and field declarations so that the meta data manager can be used to create mesh bulk data.
Verifies consistency of the meta data and clean out redundant field data allocation rules. Once committed no further part or field declarations can be made.
Definition at line 466 of file FEMMetaData.hpp.