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

#include <BulkData.hpp>

List of all members.


Detailed Description

Manager for an integrated collection of entities, entity relations, and buckets of field data.

Bulk data should be distributed among all processors.

Definition at line 45 of file BulkData.hpp.

Public Types

 MODIFIABLE = 1
 SYNCHRONIZED = 2
enum  BulkDataSyncState {
  MODIFIABLE = 1,
  SYNCHRONIZED = 2
}

Public Member Functions

virtual ~BulkData ()
 BulkData (const MetaData &mesh_meta_data, ParallelMachine parallel, unsigned bucket_max_size=1000)
 Construct mesh bulk data manager conformal to the given meta data manager and will distribute bulk data over the given parallel machine.
const MetaDatamesh_meta_data () const
 The meta data manager for this bulk data manager.
ParallelMachine parallel () const
 The parallel machine.
unsigned parallel_size () const
 Size of the parallel machine.
unsigned parallel_rank () const
 Rank of the parallel machine's local processor.
unsigned bucket_capacity () const
 Query the upper bound on the number of mesh entities that may be associated with a single bucket.
BulkDataSyncState synchronized_state () const
 Bulk data has two states: guaranteed to be parallel synchronized or modification in progress and may be parallel inconsistent.
size_t synchronized_count () const
 Count of the number of times that the bulk data has been parallel synchronized.
bool modification_begin ()
 Begin a modification phase during which the mesh bulk data could become parallel inconsistent.
bool modification_end ()
 Parallel synchronization of modifications and transition to the guaranteed parallel consistent state.
void change_entity_owner (const std::vector< EntityProc > &)
 Give away ownership of entities to other parallel processes.
void update_field_data_states () const
 Rotate the field data of multistate fields.
const std::vector< Bucket * > & buckets (EntityType type) const
 Query all buckets of a given entity type.
Entityget_entity (EntityType ent_type, EntityId ent_id, const char *=NULL) const
Entityget_entity (const EntityKey key) const
 Get entity with a given key.
Entitydeclare_entity (EntityType ent_type, EntityId ent_id, const std::vector< Part * > &parts)
 Create or retrieve a locally owned entity of a given type and id.
void change_entity_parts (Entity &, const std::vector< Part * > &add_parts, const std::vector< Part * > &remove_parts=std::vector< Part * >())
 Change the parallel-locally-owned entity's part membership by adding and/or removing parts.
bool destroy_entity (Entity *&)
 Request the destruction an entity on the local process.
void generate_new_keys (const std::vector< size_t > &requests, std::vector< EntityKey > &requested_keys)
void declare_relation (Entity &e_from, Entity &e_to, const unsigned local_id)
 Declare a relation and its converse between entities in the same mesh.
void declare_relation (Entity &, const std::vector< Relation > &)
 Declare a collection of relations by simply iterating the input and calling declare_relation on each entry.
void destroy_relation (Entity &e_from, Entity &e_to)
 Remove all relations between two entities.
const std::vector< Entity * > & entity_comm () const
 All entities with communication information.
Ghostingshared_aura () const
 Query the shared-entity aura.
Ghostingcreate_ghosting (const std::string &name)
 Asymmetric parallel relations for owner-to-ghosted mesh entities.
void change_ghosting (Ghosting &, const std::vector< EntityProc > &add_send, const std::vector< Entity * > &remove_receive)
 Change the members of a ghosting list on the sending processor.
void destroy_all_ghosting ()
 Empty every single Ghosting.
const std::vector< Ghosting * > & ghostings () const
 Query all ghostings.
void assert_ok_to_modify (const char *) const
 All non-const methods assert this.
void assert_entity_owner (const char *, const Entity &, unsigned) const
void assert_good_key (const char *, const EntityKey &) const


Constructor & Destructor Documentation

stk::mesh::BulkData::BulkData ( const MetaData mesh_meta_data,
ParallelMachine  parallel,
unsigned  bucket_max_size = 1000 
)

Construct mesh bulk data manager conformal to the given meta data manager and will distribute bulk data over the given parallel machine.

Definition at line 66 of file BulkData.cpp.


Member Function Documentation

size_t stk::mesh::BulkData::synchronized_count (  )  const [inline]

Count of the number of times that the bulk data has been parallel synchronized.

This count gets updated with each call to 'modification_end'.

Definition at line 93 of file BulkData.hpp.

bool stk::mesh::BulkData::modification_begin (  ) 

Begin a modification phase during which the mesh bulk data could become parallel inconsistent.

This is a parallel synchronous call. The first time this method is called the mesh meta data is verified to be committed and parallel consistent. An exception is thrown if this verification fails.

Returns:
True if transitioned out of the guaranteed parallel consistent state to the "ok to modify" state. False if already in this state.

Definition at line 205 of file BulkData.cpp.

bool stk::mesh::BulkData::modification_end (  ) 

Parallel synchronization of modifications and transition to the guaranteed parallel consistent state.

Parallel synchronization of accumulated local modifications is probably an expensive operation. Operations include:

Returns:
True if transitioned from the "ok to modify" state. False if already already in this state.
Exceptions:
If modification resolution errors occur then a parallel-consistent exception will be thrown.

Definition at line 400 of file BulkDataEndSync.cpp.

void stk::mesh::BulkData::change_entity_owner ( const std::vector< EntityProc > &   ) 

Give away ownership of entities to other parallel processes.

A parallel-synchronous operation while the mesh is in the ok-to-modify state.

Each owning process inputs a list of entities and the new owning process. Upon completion of the call the owning processes have the newly owned entities as well as the closure of those entities (without changing the ownership of the closure entities). If a previous owner no longer needs a changed-owner entity to support the closure of a still-owned entity then the changed-owner entity is deleted from that process. All ghosts of all entities effected by the changed ownerships deleted.

Definition at line 295 of file BulkDataOwner.cpp.

void stk::mesh::BulkData::update_field_data_states (  )  const

Rotate the field data of multistate fields.

  Rotation of states:
    StateN   <- StateNP1 (StateOld <- StateNew)
    StateNM1 <- StateN   (StateNM1 <- StateOld)
    StateNM2 <- StateNM1
    StateNM3 <- StateNM2
    StateNM3 <- StateNM2
  

Definition at line 135 of file BulkData.cpp.

Entity * stk::mesh::BulkData::get_entity ( EntityType  ent_type,
EntityId  ent_id,
const char *  = NULL 
) const

Todo:
REFACTOR remove required_by argument

Definition at line 271 of file BulkData.cpp.

Entity & stk::mesh::BulkData::declare_entity ( EntityType  ent_type,
EntityId  ent_id,
const std::vector< Part * > &  parts 
)

Create or retrieve a locally owned entity of a given type and id.

A parallel-local operation.

The entity is created as locally owned and a member of the input mesh parts. The entity a member of the meta data's locally owned mesh part and the entity's owner_rank() == parallel_rank().

If two or more processes create an entity of the same type and identifier then the sharing and ownership of these entities will be resolved by the call to 'modification_end'.

Definition at line 354 of file BulkData.cpp.

void stk::mesh::BulkData::change_entity_parts ( Entity ,
const std::vector< Part * > &  add_parts,
const std::vector< Part * > &  remove_parts = std::vector< Part * >() 
)

Change the parallel-locally-owned entity's part membership by adding and/or removing parts.

A parallel-local operation.

If the locally owned entity is shared or ghosted then the change will be propogated to the sharing or ghosting processes by modification_end.

Definition at line 462 of file BulkData.cpp.

bool stk::mesh::BulkData::destroy_entity ( Entity *&   ) 

Request the destruction an entity on the local process.

An entity cannot be the 'to' member of a relation. These relations must first be explicitly removed or the 'from' entity be explicitly destroyed.

Destrunction of entities in the 'locally_owned_part' schedules all ghost copies of that entity for destruction during modification_end. If the entity ia shared with another process and that process does not also destroy the entity then ownership of the entity will be transfered to a sharing process during modification_end.

Entities in the 'locally_used_part' but not in the 'locally_owned_part' are shared. These entities are deleted on the local process and removed from the sharing lists on other processes during modication_end.

Entities not in the 'locally_used_part' are ghosted. These entities are removed from all ghosting lists during 'modification_end'. processes by modification_end.

Returns:
True if the request for destruction is accepted; i.e., if the entity is not the 'to' member of a relation.

Definition at line 671 of file BulkData.cpp.

void stk::mesh::BulkData::declare_relation ( Entity e_from,
Entity e_to,
const unsigned  local_id 
)

Declare a relation and its converse between entities in the same mesh.

A parallel-local mesh modificaton operation.

This mapping ( e_from , local_id ) -> e_to must be unique.

Relations between entities induces part membership as follows. 1) If 'e_from' is a member of 'part' and part.primary_entity_type() == e_from.entity_type() then 'e_to' has induced membership in 'part'. 2) If there exists a part relation 'part_rel' such that 'e_from' is a member of part_rel.m_root and the entity relation conforms to the part relation then 'e_to' has induced membership in part_rel.m_target.

Definition at line 141 of file BulkDataRelation.cpp.

void stk::mesh::BulkData::destroy_relation ( Entity e_from,
Entity e_to 
)

Remove all relations between two entities.

If the relation induced a part membership for 'e_to' and 'e_to' is not shared with another processor then that part membership is removed if and only if there does not exist another relation inducing the same part membership. If 'e_to' is shared then the check for removing the induced relatinship does not occur for that entity until the call to 'modification_end'.

Definition at line 285 of file BulkDataRelation.cpp.

Ghosting& stk::mesh::BulkData::shared_aura (  )  const [inline]

Query the shared-entity aura.

Is likely to be stale if ownership or sharing has changed and the 'modification_end' has not been called.

Definition at line 291 of file BulkData.hpp.

Ghosting & stk::mesh::BulkData::create_ghosting ( const std::string &  name  ) 

Asymmetric parallel relations for owner-to-ghosted mesh entities.

Definition at line 39 of file BulkDataGhosting.cpp.

void stk::mesh::BulkData::change_ghosting ( Ghosting ,
const std::vector< EntityProc > &  add_send,
const std::vector< Entity * > &  remove_receive 
)

Change the members of a ghosting list on the sending processor.

To destroy all ghosted entities in a particular ghosting: mesh.change_ghosting( ghosts , std::vector<EntityProc>() , ghosts.receive() );

Definition at line 151 of file BulkDataGhosting.cpp.

void stk::mesh::BulkData::destroy_all_ghosting (  ) 

Empty every single Ghosting.

Same result, but more efficient than, calling change_ghosting to remove every single ghosted entity.

Definition at line 106 of file BulkDataGhosting.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jul 13 09:27:33 2010 for Sierra Toolkit by  doxygen 1.4.7