Sierra Toolkit
Version of the Day
|
Manager for an integrated collection of entities, entity relations, and buckets of field data. More...
#include <BulkData.hpp>
Public Types | |
enum | BulkDataSyncState { MODIFIABLE = 1, SYNCHRONIZED = 2 } |
Public Member Functions | |
void | optimize_buckets_at_modification_end (bool b) |
BulkData (MetaData &mesh_meta_data, ParallelMachine parallel, unsigned bucket_max_size=1000, bool use_memory_pool=true) | |
Construct mesh bulk data manager conformal to the given meta data manager and will distribute bulk data over the given parallel machine. More... | |
const MetaData & | mesh_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. | |
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. This count gets updated with each call to 'modification_end'. | |
bool | 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. More... | |
bool | modification_end () |
Parallel synchronization of modifications and transition to the guaranteed parallel consistent state. More... | |
bool | final_modification_end () |
void | change_entity_owner (const std::vector< EntityProc > &arg_change) |
Give away ownership of entities to other parallel processes. More... | |
void | update_field_data_states () const |
Rotate the field data of multistate fields. More... | |
void | copy_entity_fields (const Entity &src, Entity &dest) |
Copy field data from src entity to Dest entity. More... | |
const std::vector< Bucket * > & | buckets (EntityRank rank) const |
Query all buckets of a given entity rank. | |
AllBucketsRange | get_bucket_range () const |
AllBucketsRange | get_bucket_range (EntityRank rank) const |
Entity * | get_entity (EntityRank entity_rank, EntityId entity_id) const |
Get entity with a given key. | |
Entity * | get_entity (const EntityKey key) const |
Get entity with a given key. | |
Entity & | declare_entity (EntityRank ent_rank, EntityId ent_id, const PartVector &parts) |
Create or retrieve a locally owned entity of a given rank and id. More... | |
void | change_entity_id (EntityId id, Entity &entity) |
void | change_entity_parts (Entity &entity, const PartVector &add_parts, const PartVector &remove_parts=PartVector()) |
Change the parallel-locally-owned entity's part membership by adding and/or removing parts. More... | |
template<typename AddIterator , typename RemoveIterator > | |
void | change_entity_parts (Entity &entity, AddIterator begin_add_parts, AddIterator end_add_parts, RemoveIterator begin_remove_parts, RemoveIterator end_remove_parts, bool always_propagate_internal_changes=true) |
bool | destroy_entity (Entity *&entity) |
Request the destruction an entity on the local process. More... | |
void | generate_new_entities (const std::vector< size_t > &requests, std::vector< Entity *> &requested_entities) |
Generate a set of entites with globally unique id's. More... | |
void | declare_relation (Entity &e_from, Entity &e_to, const RelationIdentifier local_id) |
Declare a relation and its converse between entities in the same mesh. More... | |
void | declare_relation (Entity &entity, const std::vector< Relation > &rel) |
Declare a collection of relations by simply iterating the input and calling declare_relation on each entry. | |
bool | destroy_relation (Entity &e_from, Entity &e_to, const RelationIdentifier local_id) |
Remove all relations between two entities. More... | |
const std::vector< Entity * > & | entity_comm () const |
All entities with communication information. | |
Ghosting & | shared_aura () const |
Query the shared-entity aura. Is likely to be stale if ownership or sharing has changed and the 'modification_end' has not been called. | |
Ghosting & | create_ghosting (const std::string &name) |
Asymmetric parallel relations for owner-to-ghosted mesh entities. More... | |
void | change_ghosting (Ghosting &ghosts, const std::vector< EntityProc > &add_send, const std::vector< Entity *> &remove_receive) |
Change the members of a ghosting list on the sending processor. More... | |
void | destroy_all_ghosting () |
Empty every single Ghosting. Same result, but more efficient than, calling change_ghosting to remove every single ghosted entity. | |
const std::vector< Ghosting * > & | ghostings () const |
Query all ghostings. | |
PairIterEntityComm | entity_comm (const EntityKey &key) const |
Entity Comm functions that are now moved to BulkData These functions are only here for backwards compatibility. We plan to remove all comm accessors from the Entity in the future. | |
PairIterEntityComm | entity_comm_sharing (const EntityKey &key) const |
PairIterEntityComm | entity_comm (const EntityKey &key, const Ghosting &sub) const |
bool | entity_comm_insert (const EntityKey &key, const EntityCommInfo &val) |
bool | entity_comm_erase (const EntityKey &key, const EntityCommInfo &val) |
bool | entity_comm_erase (const EntityKey &key, const Ghosting &ghost) |
void | entity_comm_clear_ghosting (const EntityKey &key) |
void | entity_comm_clear (const EntityKey &key) |
void | entity_comm_swap (const EntityKey &key1, const EntityKey &key2) |
Static Public Member Functions | |
static BulkData & | get (const Bucket &bucket) |
static BulkData & | get (const Entity &entity) |
static BulkData & | get (const Ghosting &ghost) |
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 49 of file BulkData.hpp.
stk_classic::mesh::BulkData::BulkData | ( | MetaData & | mesh_meta_data, |
ParallelMachine | parallel, | ||
unsigned | bucket_max_size = 1000 , |
||
bool | use_memory_pool = true |
||
) |
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 90 of file BulkData.cpp.
bool stk_classic::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.
Definition at line 172 of file BulkData.cpp.
bool stk_classic::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:
If | modification resolution errors occur then a parallel-consistent exception will be thrown. |
Definition at line 729 of file BulkDataEndSync.cpp.
void stk_classic::mesh::BulkData::change_entity_owner | ( | const std::vector< EntityProc > & | arg_change | ) |
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 313 of file BulkDataOwner.cpp.
|
inline |
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 174 of file BulkData.hpp.
Copy field data from src entity to Dest entity.
Definition at line 182 of file BulkData.hpp.
Entity & stk_classic::mesh::BulkData::declare_entity | ( | EntityRank | ent_rank, |
EntityId | ent_id, | ||
const PartVector & | parts | ||
) |
Create or retrieve a locally owned entity of a given rank 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 rank and identifier then the sharing and ownership of these entities will be resolved by the call to 'modification_end'.
Definition at line 215 of file BulkData.cpp.
|
inline |
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 249 of file BulkData.hpp.
bool stk_classic::mesh::BulkData::destroy_entity | ( | 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 'globally_shared_part' are deleted on the local process and removed from the sharing lists on other processes during modication_end.
Entities not in the 'locally_owned_part' and 'globally_shared_part' are ghosted. These entities are removed from all ghosting lists during 'modification_end'.
Definition at line 698 of file BulkData.cpp.
void stk_classic::mesh::BulkData::generate_new_entities | ( | const std::vector< size_t > & | requests, |
std::vector< Entity *> & | requested_entities | ||
) |
Generate a set of entites with globally unique id's.
Each processor fills a request vector asking for a number of new entities of the given ranks.
ex. request = { 0, 4, 8} request 0 entites of rank 0, 4 entites of rank 1, and 8 entites of rank 2
Definition at line 773 of file BulkData.cpp.
void stk_classic::mesh::BulkData::declare_relation | ( | Entity & | e_from, |
Entity & | e_to, | ||
const RelationIdentifier | 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_rank() == e_from.entity_rank() 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.
Note that relation-declarations must be symmetric across all sharers of the involved entities within a modification cycle.
Definition at line 129 of file BulkDataRelation.cpp.
bool stk_classic::mesh::BulkData::destroy_relation | ( | Entity & | e_from, |
Entity & | e_to, | ||
const RelationIdentifier | local_id | ||
) |
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'. The local_id arg is used to differentiate the case when there are multiple relationships between e_from and e_to.
Returns true if we were able to destroy the relation.
Definition at line 191 of file BulkDataRelation.cpp.
Ghosting & stk_classic::mesh::BulkData::create_ghosting | ( | const std::string & | name | ) |
Asymmetric parallel relations for owner-to-ghosted mesh entities.
Definition at line 38 of file BulkDataGhosting.cpp.
void stk_classic::mesh::BulkData::change_ghosting | ( | Ghosting & | ghosts, |
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 145 of file BulkDataGhosting.cpp.