|
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 | |
| 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 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. | |
| 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. | |
| void | copy_entity_fields (const Entity &src, Entity &dest) |
| Copy field data from src entity to Dest entity. | |
| const std::vector< Bucket * > & | buckets (EntityRank type) const |
| Query all buckets of a given entity type. | |
| Entity * | get_entity (EntityRank entity_rank, EntityId entity_id, const char *=NULL) 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_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_entities (const std::vector< size_t > &requests, std::vector< Entity * > &requested_entities) |
| Generate a set of entites with globally unique id's. | |
| 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. | |
| Ghosting & | shared_aura () const |
| Query the shared-entity aura. | |
| Ghosting & | create_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 |
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 46 of file BulkData.hpp.
| 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 65 of file BulkData.cpp.
| const MetaData& stk::mesh::BulkData::mesh_meta_data | ( | ) | const [inline] |
The meta data manager for this bulk data manager.
Definition at line 66 of file BulkData.hpp.
| 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 94 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.
Definition at line 162 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:
| If | modification resolution errors occur then a parallel-consistent exception will be thrown. |
Definition at line 707 of file BulkDataEndSync.cpp.
| void stk::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 302 of file BulkDataOwner.cpp.
| void stk::mesh::BulkData::update_field_data_states | ( | ) | const [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 156 of file BulkData.hpp.
Copy field data from src entity to Dest entity.
Definition at line 165 of file BulkData.hpp.
| Entity* stk::mesh::BulkData::get_entity | ( | EntityRank | entity_rank, |
| EntityId | entity_id, | ||
| const char * | = NULL |
||
| ) | const [inline] |
Get entity with a given key.
Definition at line 183 of file BulkData.hpp.
| Entity & stk::mesh::BulkData::declare_entity | ( | EntityRank | 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 220 of file BulkData.cpp.
| void stk::mesh::BulkData::change_entity_parts | ( | Entity & | e, |
| 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 328 of file BulkData.cpp.
| bool stk::mesh::BulkData::destroy_entity | ( | Entity *& | e | ) |
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 532 of file BulkData.cpp.
| void stk::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 602 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_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.
Definition at line 137 of file BulkDataRelation.cpp.
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 191 of file BulkDataRelation.cpp.
| const std::vector<Entity*>& stk::mesh::BulkData::entity_comm | ( | ) | const [inline] |
All entities with communication information.
Definition at line 313 of file BulkData.hpp.
| 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 321 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 38 of file BulkDataGhosting.cpp.
| void stk::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 148 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 105 of file BulkDataGhosting.cpp.