Sierra Toolkit Version of the Day
stk::mesh::MetaData Class Reference

The manager of an integrated collection of parts and fields. More...

#include <MetaData.hpp>

Collaboration diagram for stk::mesh::MetaData:

List of all members.

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
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 Redeclaration returns the previously declared part.
Partdeclare_part (const PartVector &p_name)
 Declare a part as the defined-intersection of the given collection of parts.
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.
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.
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
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.
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 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.
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.
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.
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.
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.
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.

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.
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 MetaDataget (const Part &part)
static MetaDataget (const FieldBase &field)
static MetaDataget (const PropertyBase &property)
static MetaDataget (const BulkData &bulk_data)
static MetaDataget (const Bucket &bucket)
static MetaDataget (const Entity &entity)
static MetaDataget (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.

Detailed Description

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.


Member Function Documentation

Part * stk::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.

Todo:
REFACTOR remove required_by argument

Definition at line 185 of file MetaData.cpp.

Part & stk::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::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::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::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.

template<class T >
const T* stk::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.

Todo:
REFACTOR Should be using a shared pointer in this interface. declare_attribute( Part & , shared_ptr<const T> & );
void stk::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::mesh::MetaData::check_rank ( EntityRank  rank) const

Return true if rank is valid.

template<class field_type >
field_type* stk::mesh::MetaData::get_field ( const std::string &  name) const

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.
template<class field_type >
field_type& stk::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.

Exceptions:
std::runtime_errorIf a redeclaration is incompatible

See Field.hpp for a full discussion of Fields.

template<class T >
const T* stk::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.

Todo:
REFACTOR Should be using a shared pointer in this interface.
template<class PointerFieldType , class ReferencedFieldType >
void stk::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.

template<typename DataType >
Property<DataType>* stk::mesh::MetaData::get_property ( const std::string &  name) const

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

Exceptions:
std::runtime_errorIf the property exits and the type does not match or
template<typename DataType >
Property<DataType>& stk::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.

Exceptions:
std::runtime_errorIf a redeclaration is incompatible
unsigned stk::mesh::MetaData::get_spatial_dimension ( ) const [inline]

get the spatial-dimension, which can only be set by using FEMMetaData.

Definition at line 325 of file MetaData.hpp.

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


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