Sierra Toolkit
Version of the Day
|
The manager of an integrated collection of parts and fields. More...
#include <MetaData.hpp>
Public Member Functions | |
template<class T > | |
const T * | get_attribute () const |
template<class T > | |
const T * | declare_attribute_with_delete (const T *attribute) |
Declare an attribute on the meta data. Return the attribute of that type, which may be an already existing value. | |
template<class T > | |
const T * | declare_attribute_no_delete (const T *attribute) |
template<class T > | |
bool | remove_attribute (const T *) |
Predefined Parts | |
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 Redeclaration returns the previously declared part. More... | |
Part & | declare_part (const PartVector &p_name) |
Declare a part as the defined-intersection of the given collection of parts. More... | |
void | declare_part_subset (Part &superset, Part &subset) |
Declare a superset-subset relationship between parts. | |
void | declare_part_relation (Part &root_part, relation_stencil_ptr stencil, Part &target_part) |
Declare an entity-relationship between parts. More... | |
template<class T > | |
const T * | declare_attribute_with_delete (Part &part, const T *attribute) |
Declare an attribute on a part. Return the attribute of that type, which may be an already existing value. More... | |
template<class T > | |
const T * | declare_attribute_no_delete (Part &part, const T *attribute) |
template<class T > | |
bool | remove_attribute (Part &part, const T *attribute) |
Entity-ranks | |
void | set_entity_rank_names (const std::vector< std::string > &entity_rank_names) |
entity-rank names More... | |
EntityRank | entity_rank (const std::string &name) const |
const std::vector< std::string > & | entity_rank_names () const |
std::vector< std::string >::size_type | entity_rank_count () const |
const std::string & | entity_rank_name (EntityRank entity_rank) const |
bool | check_rank (EntityRank rank) const |
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 T > | |
const T * | declare_attribute_with_delete (FieldBase &field, const T *attribute) |
Declare an attribute on a field. Return the attribute of that type, which may be an already existing value. More... | |
template<class T > | |
const T * | declare_attribute_no_delete (FieldBase &field, const T *attribute) |
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 all field relations. | |
Declare and query properties associated with parts | |
template<typename DataType > | |
Property< DataType > * | get_property (const std::string &name) const |
Get a property, return NULL if it does not exist. More... | |
const std::vector< PropertyBase *> & | get_properties () const |
Get all defined properties. | |
template<typename DataType > | |
Property< DataType > & | declare_property (const std::string &name, unsigned size=1) |
Declare a property of the given type, name, and dimensions. More... | |
void | put_property (PropertyBase &property, Part &part) |
Put a property on the given part. | |
unsigned | get_spatial_dimension () const |
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. | |
~MetaData () | |
Destroy the meta data manager and all of the parts and fields that it owns. | |
Field declaration with weak type information; | |
direct use in application code is strongly discouraged. | |
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. | |
void | declare_field_restriction (FieldBase &arg_field, EntityRank arg_entity_rank, const Selector &arg_selector, const unsigned *arg_stride, const void *arg_init_value=NULL) |
Declare a field restriction via runtime type information. | |
Friends | |
class | fem::FEMMetaData |
Meta data manager construction and destruction | |
static MetaData & | get (const Part &part) |
static MetaData & | get (const FieldBase &field) |
static MetaData & | get (const PropertyBase &property) |
static MetaData & | get (const BulkData &bulk_data) |
static MetaData & | get (const Bucket &bucket) |
static MetaData & | get (const Entity &entity) |
static MetaData & | get (const Ghosting &ghost) |
MetaData (const std::vector< std::string > &entity_rank_names) | |
Construct a meta data manager to own parts and fields. | |
MetaData () | |
Construct a meta data manager to own parts and fields. | |
The manager of an integrated collection of parts and fields.
Mesh meta data must be identical on all processors.
Definition at line 56 of file MetaData.hpp.
Part * stk_classic::mesh::MetaData::get_part | ( | const std::string & | p_name, |
const char * | required_by = NULL |
||
) | const |
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 185 of file MetaData.cpp.
Part & stk_classic::mesh::MetaData::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.
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 214 of file MetaData.cpp.
Part & stk_classic::mesh::MetaData::declare_part | ( | const std::string & | p_name | ) |
Declare a part of the given name Redeclaration returns the previously declared part.
This part does not have an entity type rank.
Definition at line 199 of file MetaData.cpp.
Part & stk_classic::mesh::MetaData::declare_part | ( | const PartVector & | p_name | ) |
Declare a part as the defined-intersection of the given collection of parts.
The entity type rank will be the smallest entity type rank of the parts in the intersection, if any member has an entity type rank.
Definition at line 228 of file MetaData.cpp.
void stk_classic::mesh::MetaData::declare_part_relation | ( | Part & | root_part, |
relation_stencil_ptr | stencil, | ||
Part & | target_part | ||
) |
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 257 of file MetaData.cpp.
const T* stk_classic::mesh::MetaData::declare_attribute_with_delete | ( | Part & | part, |
const T * | attribute | ||
) |
Declare an attribute on a part. Return the attribute of that type, which may be an already existing value.
void stk_classic::mesh::MetaData::set_entity_rank_names | ( | const std::vector< std::string > & | entity_rank_names | ) |
entity-rank names
Definition at line 155 of file MetaData.cpp.
bool stk_classic::mesh::MetaData::check_rank | ( | EntityRank | rank | ) | const |
Return true if rank is valid.
field_type* stk_classic::mesh::MetaData::get_field | ( | const std::string & | name | ) | const |
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. |
field_type& stk_classic::mesh::MetaData::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.
A compatible redeclaration returns the previously declared field.
std::runtime_error | If a redeclaration is incompatible |
See Field.hpp for a full discussion of Fields.
const T* stk_classic::mesh::MetaData::declare_attribute_with_delete | ( | FieldBase & | field, |
const T * | attribute | ||
) |
Declare an attribute on a field. Return the attribute of that type, which may be an already existing value.
void stk_classic::mesh::MetaData::declare_field_relation | ( | PointerFieldType & | pointer_field, |
relation_stencil_ptr | stencil, | ||
ReferencedFieldType & | referenced_field | ||
) |
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.
See FieldRelation.hpp for a full discussion of field relations.
Property<DataType>* stk_classic::mesh::MetaData::get_property | ( | const std::string & | name | ) | const |
Get a property, return NULL if it does not exist.
std::runtime_error | If the property exits and the type does not match or |
Property<DataType>& stk_classic::mesh::MetaData::declare_property | ( | const std::string & | name, |
unsigned | size = 1 |
||
) |
Declare a property of the given type, name, and dimensions.
A compatible redeclaration returns the previously declared property.
std::runtime_error | If a redeclaration is incompatible |
|
inline |
get the spatial-dimension, which can only be set by using FEMMetaData.
Definition at line 325 of file MetaData.hpp.
void stk_classic::mesh::MetaData::commit | ( | ) |
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 368 of file MetaData.cpp.