stk::mesh::MetaData Class Reference
[Sierra Toolkit Mesh]

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

#include <MetaData.hpp>

List of all members.

Public Member Functions

Predefined Parts

Partuniversal_part () const
 Universal subset for the problem domain.
Partlocally_owned_part () const
 Subset for the problem domain that is owned by the local process.
Partglobally_shared_part () const
 Subset for the problem domain that is shared with another process.
Declare and query parts

Partget_part (const std::string &, 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 PartVector & get_parts () const
 Query all parts of the mesh ordered by the parts' ordinal.
Partdeclare_part (const std::string &, EntityRank rank)
 Declare a part of the given name and entity rank Redeclaration returns the previously declared part.
Partdeclare_part (const std::string &)
 Declare a part of the given name and entity rank Redeclaration returns the previously declared part.
Partdeclare_part (const PartVector &)
 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 &, const T *)
 Declare an attribute on a part.
template<class T >
const T * declare_attribute_no_delete (Part &, const T *)
Entity-types

const std::vector< std::string > & entity_rank_names () const
 Query entity-type names.
std::vector< std::string >
::size_type 
entity_rank_count () const
const std::string & entity_rank_name (unsigned) 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 &, const T *)
 Declare an attribute on a field.
template<class T >
const T * declare_attribute_no_delete (FieldBase &, const T *)
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.
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 &, Part &)
 Put a property on the given part.
Meta data manager construction and destruction

 MetaData (const std::vector< std::string > &entity_rank_names)
 Construct a meta data manager to own parts and fields.
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.
Frequently asserted conditions.

void assert_committed (const char *) const
void assert_not_committed (const char *) const
void assert_same_mesh_meta_data (const char *, const MetaData &) const
void assert_entity_rank (const char *, unsigned) const
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, unsigned arg_entity_rank, const Part &arg_part, const unsigned *arg_stride)
 Declare a field restriction via runtime type information.

Detailed Description

The manager of an integrated collection of parts and fields.

Mesh meta data must be identical on all processors.

Definition at line 48 of file MetaData.hpp.


Constructor & Destructor Documentation

stk::mesh::MetaData::MetaData ( const std::vector< std::string > &  entity_rank_names  )  [explicit]

Construct a meta data manager to own parts and fields.

Definition at line 79 of file MetaData.cpp.


Member Function Documentation

Part& stk::mesh::MetaData::universal_part (  )  const [inline]

Universal subset for the problem domain.

All other parts are a subset of the universal part.

Definition at line 59 of file MetaData.hpp.

Part& stk::mesh::MetaData::locally_owned_part (  )  const [inline]

Subset for the problem domain that is owned by the local process.

Ghost entities are not members of this part.

Definition at line 64 of file MetaData.hpp.

Part& stk::mesh::MetaData::globally_shared_part (  )  const [inline]

Subset for the problem domain that is shared with another process.

Ghost entities are not members of this part.

Definition at line 69 of file MetaData.hpp.

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 119 of file MetaData.cpp.

const PartVector& stk::mesh::MetaData::get_parts (  )  const [inline]

Query all parts of the mesh ordered by the parts' ordinal.

Definition at line 91 of file MetaData.hpp.

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 153 of file MetaData.cpp.

Part & stk::mesh::MetaData::declare_part ( const std::string &  p_name  ) 

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 141 of file MetaData.cpp.

Part & stk::mesh::MetaData::declare_part ( const PartVector &  part_intersect  ) 

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 185 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 216 of file MetaData.cpp.

template<class T >
const T* stk::mesh::MetaData::declare_attribute_with_delete ( Part ,
const T *   
) [inline]

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> & );
const std::vector<std::string>& stk::mesh::MetaData::entity_rank_names (  )  const [inline]

Query entity-type names.

Definition at line 153 of file MetaData.hpp.

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

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

Exceptions:
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.
template<class field_type >
field_type& stk::mesh::MetaData::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_error If a redeclaration is incompatible
template<class T >
const T* stk::mesh::MetaData::declare_attribute_with_delete ( FieldBase ,
const T *   
) [inline]

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 
) [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.

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

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

Exceptions:
std::runtime_error If 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 
) [inline]

Declare a property of the given type, name, and dimensions.

A compatible redeclaration returns the previously declared property.

Exceptions:
std::runtime_error If a redeclaration is incompatible
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 315 of file MetaData.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Apr 13 10:05:50 2011 for Sierra Toolkit by  doxygen 1.6.3