Sierra Toolkit Version of the Day
stk::mesh::fem::FEMMetaData Class Reference

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>

Collaboration diagram for stk::mesh::fem::FEMMetaData:

List of all members.

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.
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.
Partget_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.
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.
Partdeclare_part (const std::string &name, fem::CellTopology cell_topology)
 Declare a part with a given cell topology.
template<class Top >
Partdeclare_part (const std::string &name)
 Declare a part with a given cell topology.
MetaData predefined parts

-------------------------------------------------------------------------------- FEMMetaData Specific functions end -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- The following functions are call-throughs to the underlying MetaData class: --------------------------------------------------------------------------------

Partuniversal_part () const
 Universal subset for the problem domain. All other parts are a subset of the universal part.
Partlocally_owned_part () const
 Subset for the problem domain that is owned by the local process. Ghost entities are not members of this part.
Partglobally_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
Partget_part (const std::string &p_name, const char *required_by=NULL) const
 Get an existing part by its application-defined text name.
Partget_part (unsigned ord) const
 Get an existing part by its ordinal.
const PartVectorget_parts () const
 Query all parts of the mesh ordered by the parts' ordinal.
Partdeclare_part (const std::string &p_name, EntityRank rank)
 Declare a part of the given name and entity rank Redeclaration returns the previously declared part.
Partdeclare_part (const std::string &p_name)
 Declare a part of the given name and entity rank Redeclaration returns the previously declared part.
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.
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.
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.
template<class PointerFieldType , class ReferencedFieldType >
void declare_field_relation (PointerFieldType &pointer_field, relation_stencil_ptr stencil, ReferencedFieldType &referenced_field)
 Declare a field relation.
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.
bool is_commit () const
 Query if the meta data manager is committed.

Static Public Member Functions

static MetaDataget_meta_data (FEMMetaData &fem_meta)
 Getter for MetaData off of a FEMMetaData object.
static FEMMetaDataget (const MetaData &meta)
 Getter for FEMMetaData off of a MetaData object.
static FEMMetaDataget (const Part &part)
 Getter for FEMMetaData off of a Part object.
static FEMMetaDataget (const FieldBase &field)
 Getter for FEMMetaData off of a FieldBase object.
static FEMMetaDataget (const PropertyBase &property)
 Getter for FEMMetaData off of a PropertyBase object.
static FEMMetaDataget (const BulkData &bulk_data)
 Getter for FEMMetaData off of a BulkData object.
static FEMMetaDataget (const Bucket &bucket)
 Getter for FEMMetaData off of a Bucket object.
static FEMMetaDataget (const Entity &entity)
 Getter for FEMMetaData off of a Entity object.
static FEMMetaDataget (const Ghosting &ghost)
 Getter for FEMMetaData off of a Ghosting object.

Static Public Attributes

static const EntityRank INVALID_RANK = stk::mesh::InvalidEntityRank
static const EntityRank NODE_RANK = 0u
static const EntityRank EDGE_RANK = 1u
static const EntityRank FACE_RANK = 2u
static const EntityRank VOLUME_RANK = 3u

Field declaration with weak type information;

direct use in application code is strongly discouraged.

FieldBasedeclare_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.

Detailed Description

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: 1. Each cell topology has one and only one root cell topology part. The root cell topology part for a cell topology is a unique part that can be subsetted to induce cell topology on the subset part. -> Enforced by register_cell_topology is the only function that modifies the PartCellTopologyVector private data on FEMMetaData. 2. Root cell topology parts cannot be subsets of parts with cell topologies -> Enforced by declare_part_subset 3. Incompatible cell topologies are prohibited. I.e. parts with different cell topologies of the same rank (as the part) cannot be subsets of each other. -> Enforced by declare_part_subset

Definition at line 54 of file FEMMetaData.hpp.


Member Function Documentation

void stk::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.

-------------------------------------------------------------------------------- FEMMetaData Specific functions begin: -------------------------------------------------------------------------------- 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.

bool stk::mesh::fem::FEMMetaData::check_rank ( EntityRank  rank) const [inline]

Return true if rank is valid.

Definition at line 544 of file FEMMetaData.hpp.

void stk::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::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.

Part* stk::mesh::fem::FEMMetaData::get_part ( const std::string &  p_name,
const char *  required_by = NULL 
) const [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.

Todo:
REFACTOR remove required_by argument

Definition at line 295 of file FEMMetaData.hpp.

Part& stk::mesh::fem::FEMMetaData::declare_part ( const std::string &  p_name,
EntityRank  rank 
) [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.

Part& stk::mesh::fem::FEMMetaData::declare_part ( const std::string &  p_name) [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.

void stk::mesh::fem::FEMMetaData::declare_part_relation ( Part root_part,
relation_stencil_ptr  stencil,
Part target_part 
) [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.

template<class field_type >
field_type* stk::mesh::fem::FEMMetaData::get_field ( const std::string &  name) const [inline]

Get a field, return NULL if it does not exist.

Exceptions:
std::runtime_errorIf 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.

template<class field_type >
field_type& stk::mesh::fem::FEMMetaData::declare_field ( const std::string &  name,
unsigned  number_of_states = 1 
) [inline]

Declare a field of the given field_type, test name, and number of states.

A compatible redeclaration returns the previously declared field.

Exceptions:
std::runtime_errorIf a redeclaration is incompatible

Definition at line 427 of file FEMMetaData.hpp.

template<class PointerFieldType , class ReferencedFieldType >
void stk::mesh::fem::FEMMetaData::declare_field_relation ( PointerFieldType &  pointer_field,
relation_stencil_ptr  stencil,
ReferencedFieldType &  referenced_field 
) [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.

void stk::mesh::fem::FEMMetaData::commit ( ) [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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines