Sierra Toolkit Mesh


Detailed Description

Introduction

The Sierra Toolkit Mesh supports parallel distributed, heterogeneous, and dynamically modifiable unstructured meshes with computational field data. Mesh data is partitioned into (1) meta data which describes an application's problem domain and (2) bulk data which implements a discretization of an application's problem domain.

A bulk data manager owns and manages an integrated collection of entities (e.g. nodes and elements), relations between entities (i.e. connectivity), and computational field data associated with entities of the mesh. Field data for homogeneous subsets of entities is aggregated into buckets, i.e. contiguous blocks of memory. A meta data manager owns and manages an integrated collection of parts and fields. A part defines an expected subset of entities in the problem domain. A field defines the expected computational field data for a discretization of the problem domain.

Simple Example

An application must first create a meta data manager. An application owns the meta data manager that it creates; however, a meta data manager owns its parts and fields.
  using namespace stk ;

  mesh::MetaData meta_mgr ; // Owned by the application

  // Declare my element and face parts:

  mesh::Part & my_part_a = meta_mgr.declare_part("A",mesh::Element);
  mesh::Part & my_part_b = meta_mgr.declare_part("B",mesh::Element);
  mesh::Part & my_side = meta_mgr.declare_part("S",mesh::Face);

An application defines types for the fields that it will use. The first template parameter of a field type is the numerical type of the field. The remaining template parameters (if any) define the ranks of the multidimensional array. In this example the TensorAtIntegrationField defines a rank-two (FORTRAN ordering) array where the first array index selects a tensor component and the second array index selects an integration point.

  typedef mesh::Field<double>                        ScalarField ;
  typedef mesh::Field<double,Cartesian>              VectorField ;
  typedef mesh::Field<double,FullTensor>             TensorField ;
  typedef mesh::Field<double,FullTensor,Integration> TensorAtIntegrationField ;
  // Declare fields of a specified type

  ScalarField & my_field_u = meta_mgr.declare_field< ScalarField >("u");
  VectorField & my_field_v = meta_mgr.declare_field< VectorField >("v");
  TensorField & my_field_w = meta_mgr.declare_field< TensorField >("w");
  TensorAtIntegrationField & my_field_x = meta_mgr.declare_field< TensorAtIntegrationField >("x");

  meta_mgr.put_field( my_field_u , mesh::Node , my_part_a );
  meta_mgr.put_field( my_field_u , mesh::Node , my_part_b );
  meta_mgr.put_field( my_field_u , mesh::Face , my_part_s );

  meta_mgr.put_field( my_field_w , mesh::Element , my_part_a );
  meta_mgr.put_field( my_field_x , mesh::Element , my_part_b , 8 );
Fields of a given type are declared with a text name. This text name is intended to be used exclusively by input and output functions, and should be immediately forgotten by the application. The put_field method is used to associate fields with entities on specified parts. In this example the nodes of my_part_a and my_part_b , and faces of my_side will have a scalar field data for my_field_u ; the elements of my_part_a will have tensor field data for my_field_w ; and each element of my_part_b will have the eight tensor values associated with my_field_x .

After populating it parts and fields a meta data manager is committed, locking it against further changes. A bulk data object is created to manage entities, relations, and field data that are (1) conformal to a given meta data objects and (2) distributed among the processors of a parallel communicator (e.g., MPI_Comm).

  meta_mgr.commit(); // Finished constructing meta data

  mesh::BulkData bulk_mgr( meta_mgr , communicator );
Mesh bulk data is created and managed with respect to a committed mesh meta data. This separates, and thus simplifies, concerns of meta data changes from bulk data changes.

At this point in an application mesh bulk data is typically read from a mesh file into the mesh bulk data, bulk_mgr . The typical access pattern for bulk data is to (1) iterate mesh entities of a given type (e.g., node or element) that belong to a given part and (2) operate on computational field data associated with the selected entities.

  std::vector< mesh::Bucket *> buckets ;
  // Get buckets for elements in <c> my_part_a </c>
  mesh::get_buckets( BucketSelector( my_part_a ) ,
                     bulk_mgr.buckets( mesh::Element ), buckets );

  for ( unsigned i = 0 ; i < buckets.size() ; ++i ) {
    mesh::Bucket & k = * buckets[i] ;

    // number of elements in this bucket:
    const unsigned n = k.size();

    // Pointer to field data for 'n' elements:
    double * const tensor = mesh::field_data( my_field_w , k );

    // Iterate the elements in the bucketa and the field data
    for ( unsigned j = 0 ; j < n ; ++j ) {
      mesh::Entity & element = * k[j] ;
      double * element_tensor = tensor + size_of_tensor * j ;
      // computations...
    }
  }


Modules

 Mesh Entity Relationships
 An seemingly simple relationship between two mesh entities has consequences for entity membership in parts and derived field relationships.
 Meta Data Field Dimension Tags
 Mesh specific Array dimension tags for defining multi-dimensional array field data.
 Mesh Field Bulk Data
 Computational data associated with the entities within a mesh.
 Bulk Data Parallel Distribution
 Parallel distribution of mesh bulk data.
 Bulk Data Finite Element Entities
 Create entities with common used finite element topologies.

Classes

class  stk::mesh::BucketIterator
 A random access iterator for a bucket that dereferences to a entity reference. More...
class  stk::mesh::Bucket
 A container for the field data of a homogeneous collection of entities. More...
struct  stk::mesh::BucketLess
class  stk::mesh::BulkData
 Manager for an integrated collection of entities, entity relations, and buckets of field data. More...
class  stk::mesh::Entity
 A fundamental unit within the discretization of a problem domain, including but not limited to nodes, edges, sides, and elements. More...
class  stk::mesh::EntityLess
 Comparison operator for entities compares the entities' keys. More...
class  stk::mesh::EntityEqual
union  stk::mesh::EntityKey
 Integer type for the entity keys, which is an encoding of the entity type and entity identifier. More...
class  stk::mesh::Field< Scalar, Tag1, Tag2, Tag3, Tag4, Tag5, Tag6, Tag7 >
 Field with defined data type and multi-dimensions (if any). More...
class  stk::mesh::MetaData
 The manager of an integrated collection of parts and fields. More...
struct  stk::mesh::PartRelation
 A defined entity-relationship between parts. More...
class  stk::mesh::Part
 An application-defined subset of a problem domain. More...
struct  stk::mesh::PartLess
 Ordering operator for parts. More...
class  stk::mesh::Property< void >
 Property base class with an anonymous data type and anonymous multi-dimension. More...
class  stk::mesh::Property< DataType >
 Property with defined data type and multi-dimensions (if any). More...
class  stk::mesh::Relation
 A relation between two mesh entities with a relation identifier and kind . More...
struct  stk::mesh::LessRelation
class  stk::mesh::Selector
 This is a class for selecting buckets based on a set of meshparts and set logic. More...
class  stk::mesh::Transaction
 Transaction journal of modifications to the bulk data during a transaction. More...

Declare field data allocation rules

template<class field_type>
field_type & stk::mesh::put_field (field_type &field, unsigned entity_type, const Part &part)
 Declare a field to exist for a given entity type and Part.
template<class field_type>
field_type & stk::mesh::put_field (field_type &field, unsigned entity_type, const Part &part, unsigned n1)
 Declare a field to exist for a given entity type and Part.
template<class field_type>
field_type & stk::mesh::put_field (field_type &field, unsigned entity_type, const Part &part, unsigned n1, unsigned n2)
template<class field_type>
field_type & stk::mesh::put_field (field_type &field, unsigned entity_type, const Part &part, unsigned n1, unsigned n2, unsigned n3)
template<class field_type>
field_type & stk::mesh::put_field (field_type &field, unsigned entity_type, const Part &part, unsigned n1, unsigned n2, unsigned n3, unsigned n4)
template<class field_type>
field_type & stk::mesh::put_field (field_type &field, unsigned entity_type, const Part &part, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5)
template<class field_type>
field_type & stk::mesh::put_field (field_type &field, unsigned entity_type, const Part &part, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6)
template<class field_type>
field_type & stk::mesh::put_field (field_type &field, unsigned entity_type, const Part &part, unsigned n1, unsigned n2, unsigned n3, unsigned n4, unsigned n5, unsigned n6, unsigned n7)

Typedefs

typedef PairIter< std::vector<
Relation >::const_iterator > 
stk::mesh::PairIterRelation
 Span of a sorted relations for a given domain entity.
typedef PairIter< std::vector<
EntityCommInfo >::const_iterator > 
stk::mesh::PairIterEntityComm
 Span of ( communication-subset-ordinal , process-rank ) pairs for the communication of an entity.
typedef unsigned stk::mesh::EntityType
typedef uint64_t stk::mesh::EntityId
typedef std::vector< Bucket * > stk::mesh::Transaction::BucketList
 Bucket containers used to sort mesh entities by state so that they can be accessed after modification_end().
typedef std::vector< BucketList > stk::mesh::Transaction::BucketListByType
 Bucket containers used to sort mesh entities by state so that they can be accessed after modification_end().
typedef std::set< Part * > stk::mesh::Transaction::PartSet
 Part list for tracking bulk transactions.
typedef std::vector< Part * > stk::mesh::PartVector
 Collections of parts are frequently maintained as a vector of Part pointers.
typedef Field< void, void,
void, void, void, void, void,
void > 
stk::mesh::FieldBase
typedef Property< void > stk::mesh::PropertyBase

Enumerations

enum  { rank_digits = 8 }
enum  stk::mesh::FieldState {
  stk::mesh::StateNone = 0,
  stk::mesh::StateNew = 0,
  stk::mesh::StateNP1 = 0,
  stk::mesh::StateOld = 1,
  stk::mesh::StateN = 1,
  stk::mesh::StateNM1 = 2,
  stk::mesh::StateNM2 = 3,
  stk::mesh::StateNM3 = 4,
  stk::mesh::StateNM4 = 5
}
 Enumeration of states for multi-state fields. More...
enum  { MaximumFieldStates = 6 }
 Maximum number of states that a field can have.
enum  {
  NOT_IN_TRANSACTION = 0,
  MODIFIED = 1,
  INSERTED = 2,
  DELETED = 3
}
enum  stk::mesh::Transaction::TransactionType {
  INCREMENTAL = 1,
  BULK = 2
}
enum  { MaximumFieldDimension = 7 }
 Maximum multi-dimenaional array dimension of a field.
enum  stk::mesh::EntityTypeEnum {
  Node = 0,
  Edge = 1,
  Face = 2,
  Element = 3,
  Particle = 4,
  Constraint = 5,
  EntityTypeEnd = 6,
  EntityTypeUndefined = -1
}
 Enumeration of types of entities. More...

Enumerator

 stk::mesh::Transaction::MODIFIED = 1
 stk::mesh::Transaction::INSERTED = 2
 stk::mesh::Transaction::DELETED = 3
 stk::mesh::Transaction::BULK = 2

Functions

std::ostream & stk::mesh::operator<< (std::ostream &, const Bucket &)
 Print the part names for which this bucket is a subset.
std::ostream & stk::mesh::print (std::ostream &, const std::string &indent, const Bucket &)
 Print the parts and entities of this bucket.
unsigned stk::mesh::bucket_counter (const unsigned *const key)
bool stk::mesh::bucket_part_equal (const unsigned *lhs, const unsigned *rhs)
bool stk::mesh::has_superset (const Bucket &, const Part &p)
 Is this bucket a subset of the given part.
bool stk::mesh::has_superset (const Bucket &, const unsigned &ordinal)
 Is this bucket a subset of the given part by partID.
bool stk::mesh::has_superset (const Bucket &, const PartVector &)
 Is this bucket a subset of all of the given parts.
std::vector< Bucket * >::iterator stk::mesh::lower_bound (std::vector< Bucket * > &v, const unsigned *key)
 stk::mesh::EntityKey::~EntityKey ()
 Destructor.
 stk::mesh::EntityKey::EntityKey ()
 Default constructor.
 stk::mesh::EntityKey::EntityKey (const EntityKey &rhs)
EntityKey & stk::mesh::EntityKey::operator= (const EntityKey &rhs)
 stk::mesh::EntityKey::EntityKey (unsigned entity_rank, raw_key_type entity_id)
 Constructor.
raw_key_type stk::mesh::EntityKey::id () const
unsigned stk::mesh::EntityKey::rank () const
unsigned stk::mesh::EntityKey::type () const
bool stk::mesh::EntityKey::operator== (const EntityKey &rhs) const
bool stk::mesh::EntityKey::operator!= (const EntityKey &rhs) const
bool stk::mesh::EntityKey::operator< (const EntityKey &rhs) const
bool stk::mesh::EntityKey::operator> (const EntityKey &rhs) const
bool stk::mesh::EntityKey::operator<= (const EntityKey &rhs) const
bool stk::mesh::EntityKey::operator>= (const EntityKey &rhs) const
 stk::mesh::EntityKey::EntityKey (const raw_key_type *const value)
raw_key_type stk::mesh::EntityKey::raw_key () const
EntityType stk::mesh::entity_rank (const EntityKey &key)
 Given an entity key, return an entity type (rank).
EntityType stk::mesh::entity_type (const EntityKey &key)
EntityId stk::mesh::entity_id (const EntityKey &key)
 Given an entity key, return the identifier for the entity.
bool stk::mesh::entity_key_valid (const EntityKey &key)
 Query if an entity key is valid.
bool stk::mesh::entity_id_valid (EntityKey::raw_key_type id)
const char * stk::mesh::field_state_name (FieldState)
 Return the string name of a field state.
void stk::mesh::get_buckets (const Selector &selector, const std::vector< Bucket * > &input, std::vector< Bucket * > &output)
void stk::mesh::get_involved_parts (const PartVector &union_parts, const Bucket &candidate, PartVector &involved_parts)
void stk::mesh::count_entities (const Selector &selector, const BulkData &mesh, std::vector< EntityType > &count)
 Local count selected entities of each type.
void stk::mesh::get_entities (const BulkData &, EntityType type, std::vector< Entity * > &)
 Get all entities of the specified type, sorted by ID.
unsigned stk::mesh::count_selected_entities (const Selector &selector, const std::vector< Bucket * > &input_buckets)
 Count entities in selected parts (selected by the given selector instance), and sorted by ID.
void stk::mesh::get_selected_entities (const Selector &selector, const std::vector< Bucket * > &input_buckets, std::vector< Entity * > &entities)
 Get entities in selected parts (selected by the given selector instance), and sorted by ID.
std::ostream & stk::mesh::print_entity_key (std::ostream &, const MetaData &, const EntityKey &)
 Print an entity key for this meta data.
void stk::mesh::verify_parallel_consistency (const MetaData &, ParallelMachine)
 Verify that the meta data is identical on all processors.
void stk::mesh::order (PartVector &)
 Order a collection of parts: invoke sort and then unique.
bool stk::mesh::insert (PartVector &, Part &)
 Insert a part into a properly ordered collection of parts.
void stk::mesh::remove (PartVector &, Part &)
 Remove a part from a properly ordered collection of parts.
Part * stk::mesh::find (const PartVector &, const std::string &)
 Find a part by name in a collection of parts.
bool stk::mesh::contain (const PartVector &, const Part &)
 Query containment within properly ordered PartVector.
bool stk::mesh::contain (const PartVector &, const PartVector &)
 Query containment for two properly ordered PartVector.
size_t stk::mesh::intersect (const PartVector &, const PartVector &)
 Query cardinality of intersection of two PartVectors.
size_t stk::mesh::intersect (const PartVector &, const PartVector &, PartVector &)
 Generate the intersection of two PartVectors.
bool stk::mesh::intersect (const Part &, const Part &)
 Query if two parts intersect; i.e., if one is a subset of the other or they share a common subset.
std::ostream & stk::mesh::print (std::ostream &, const char *const , const Part &)
 Print a part's information including supersets, subsets, and intersection.
std::ostream & stk::mesh::operator<< (std::ostream &, const PropertyBase &)
 Print the text name for a field.
std::ostream & stk::mesh::print (std::ostream &, const char *const , const PropertyBase &)
 Print field and field restrictions on new lines.
void stk::mesh::property_data_throw (const PropertyBase &, const Part &)
 Internal function to throw a descriptive error message.
template<typename property_type>
const property_type::data_type * stk::mesh::property_data (const property_type &prop, const Part &part)
 Query pointer to property data for a given part.
template<typename property_type>
property_type::data_type * stk::mesh::property_data (property_type &prop, const Part &part)
 Query pointer to property data for a given part.
void stk::mesh::get_entities_through_relations (const std::vector< Entity * > &entities, std::vector< Entity * > &entities_related)
 Query which mesh entities have a relation to all of the input mesh entities.
void stk::mesh::get_entities_through_relations (const std::vector< Entity * > &entities, unsigned entities_related_rank, std::vector< Entity * > &entities_related)
bool stk::mesh::membership_is_induced (const Part &part, unsigned entity_type)
 Query if a member entity of the given entity type has an induced membership.
void stk::mesh::induced_part_membership (Part &part, unsigned entity_type_from, unsigned entity_type_to, unsigned relation_identifier, PartVector &induced_parts)
 Induce entities' part membership based upon relationships between entities.
void stk::mesh::induced_part_membership (const Entity &entity_from, const PartVector &omit, unsigned entity_type_to, unsigned relation_identifier, PartVector &entity_to_parts)
 Induce entities' part membership based upon relationships between entities.
void stk::mesh::induced_part_membership (const Entity &entity, const PartVector &omit, PartVector &induced)
 Induce an entity's part membership based upon relationships from other entities.
std::ostream & stk::mesh::operator<< (std::ostream &, const Relation &)
 Print the relation attributes and referenced entity's key.
std::ostream & stk::mesh::Transaction::print_stream (std::ostream &os) const
 Pretty print the transaction.
const BucketList & stk::mesh::Transaction::get_modified_buckets (unsigned type) const
 Retrieve buckets of a particular type that contain modified entities.
const BucketList & stk::mesh::Transaction::get_deleted_buckets (unsigned type) const
 Retrieve buckets of a particular type that contain deleted entities.
const BucketList & stk::mesh::Transaction::get_inserted_buckets (unsigned type) const
 Retrieve buckets of a particular type that contain inserted entities.
void stk::mesh::Transaction::get_parts_with_modified_entities (PartVector &pv) const
 Retrieve a part vector of parts whose entities were modified.
void stk::mesh::Transaction::get_parts_with_deleted_entities (PartVector &pv) const
 Retrieve a part vector of parts from which entities were deleted.
void stk::mesh::Transaction::get_parts_with_inserted_entities (PartVector &pv) const
 Retrieve a part vector of parts into which entities were inserted.
std::ostream & stk::mesh::operator<< (std::ostream &os, const Transaction &rhs)
const std::vector< std::string > & stk::mesh::fem_entity_type_names ()
 Finite element entity-type names.
EntityTypeEnum stk::mesh::fem_entity_type (int t)
unsigned stk::mesh::Relation::entity_rank () const
 The rank of the referenced entity.
unsigned stk::mesh::Relation::identifier () const
 The local relation identifier.
Selector stk::mesh::Selector::operator & (const Part &A, const Part &B)
 
Selector stk::mesh::Selector::operator & (const Part &A, const Selector &B)
 
Selector stk::mesh::Selector::operator & (const Selector &A, const Part &B)
 
Selector stk::mesh::Selector::operator & (const Selector &A, const Selector &B)
 
Selector stk::mesh::Selector::operator| (const Part &A, const Part &B)
 
Selector stk::mesh::Selector::operator| (const Part &A, const Selector &B)
 
Selector stk::mesh::Selector::operator| (const Selector &A, const Part &B)
 
Selector stk::mesh::Selector::operator| (const Selector &A, const Selector &B)
 
Selector stk::mesh::Selector::operator! (const Part &A)
 
Selector stk::mesh::Selector::selectUnion (const PartVector &union_part_vector)
 
Selector stk::mesh::Selector::selectIntersection (const PartVector &intersection_part_vector)
 


Typedef Documentation

typedef PairIter< std::vector<Relation>::const_iterator > stk::mesh::PairIterRelation

Span of a sorted relations for a given domain entity.

The span is sorted by

  1. range entity rank,
  2. relation identifier, and
  3. range entity global identifier.

Definition at line 36 of file Entity.hpp.


Enumeration Type Documentation

enum stk::mesh::FieldState

Enumeration of states for multi-state fields.

A field may be declared to have field data for multiple states.

Enumerator:
StateNone  State of a field with one state.
StateNew  Newest state of a field with two states.
StateNP1  Newest state of a field with three+ states.
StateOld  Previous state of a field with two states.
StateN  Previous state of a field with three+ states.
StateNM1  Previous-1 state of a field with three+ states.
StateNM2  Previous-2 state of a field with four+ states.
StateNM3  Previous-3 state of a field with five+ states.
StateNM4  Previous-4 state of a field with six states.

Definition at line 48 of file Field.hpp.

enum stk::mesh::EntityTypeEnum

Enumeration of types of entities.

The types of entities is intended to be modifiable / extensible by

Definition at line 29 of file EntityTypes.hpp.


Function Documentation

stk::mesh::EntityKey::EntityKey (  )  [inline, inherited]

Default constructor.

Note that entity_key_valid(key) == false if key is default-constructed.

Definition at line 94 of file base/EntityKey.hpp.

stk::mesh::EntityKey::EntityKey ( unsigned  entity_rank,
raw_key_type  entity_id 
) [inherited]

Constructor.

Parameters:
entity_rank is required to lie in the range 0 to 255 (which is the limit of what can be stored in 8 bits). This limit may be raised if we decide to use more than 8 bits for encoding an entity-type.
entity_id is required to lie in the range 1 to 2^id_digits.
If entity_type or entity_id lie outside these ranges an exception will be thrown.

Definition at line 19 of file EntityKey.cpp.

void stk::mesh::count_entities ( const Selector &  selector,
const BulkData &  mesh,
std::vector< EntityType > &  count 
)

Local count selected entities of each type.

Parameters:
selector 
mesh 
count 

Definition at line 99 of file GetEntities.cpp.

bool stk::mesh::insert ( PartVector ,
Part &   
)

Insert a part into a properly ordered collection of parts.

Returns true if this is a new insertion.

Definition at line 86 of file Part.cpp.

std::ostream & stk::mesh::print ( std::ostream &  ,
const char *  const,
const Part &   
)

Print a part's information including supersets, subsets, and intersection.

Each line starts with the given leader string.

Definition at line 35 of file Part.cpp.

void stk::mesh::induced_part_membership ( Part &  part,
unsigned  entity_type_from,
unsigned  entity_type_to,
unsigned  relation_identifier,
PartVector induced_parts 
)

Induce entities' part membership based upon relationships between entities.

Insert the result into 'induced_parts'.

Definition at line 183 of file Relation.cpp.

void stk::mesh::induced_part_membership ( const Entity &  entity_from,
const PartVector omit,
unsigned  entity_type_to,
unsigned  relation_identifier,
PartVector entity_to_parts 
)

Induce entities' part membership based upon relationships between entities.

Do not include and parts in the 'omit' list.

Definition at line 218 of file Relation.cpp.

void stk::mesh::induced_part_membership ( const Entity &  entity,
const PartVector omit,
PartVector induced 
)

Induce an entity's part membership based upon relationships from other entities.

Do not include and parts in the 'omit' list.

Definition at line 257 of file Relation.cpp.


Generated on Tue Jul 13 09:27:32 2010 for Sierra Toolkit by  doxygen 1.4.7