|
Mundy: Multibody Nonlocal Dynamics Version of the Day
|
Semantic mesh class backed by synchronized data and assembly part hierarchies. More...
#include <Class.hpp>
Classes | |
| struct | DeclarationSignature |
| Canonical declaration signature used to validate repeated declarations by name. More... | |
Public Types | |
Type aliases | |
| enum | { INVALID_ID = -1 } |
| enum class | DeclarationKind : unsigned { DeclarationKind::NAMED = 0u , DeclarationKind::RANKED = 1u , DeclarationKind::TOPOLOGICAL = 2u } |
| How the class data/leaf-data parts were declared. More... | |
| enum class | Type : unsigned { Type::PRIMARY = 0u , Type::SET = 1u } |
| The type of class this is. Class rules: More... | |
| using | class_ordinal_t = unsigned |
Public Member Functions | |
Constructors and destructor | |
| Class ()=delete | |
| No default constructor. | |
| Class (const Class &)=delete | |
| Non-copyable and non-movable, mirroring STK object semantics. | |
| Class (Class &&)=delete | |
| Class & | operator= (const Class &)=delete |
| Class & | operator= (Class &&)=delete |
| ~Class ()=default | |
| Destructor. | |
Part-like API | |
| stk::mesh::MetaData & | mesh_meta_data () noexcept |
| Fetch the owning MetaData manager. | |
| const stk::mesh::MetaData & | mesh_meta_data () const noexcept |
| Fetch the owning MetaData manager. | |
| stk::mesh::MetaData & | meta_data () noexcept |
| Backward-compatible alias for mesh_meta_data(). | |
| const stk::mesh::MetaData & | meta_data () const noexcept |
| Backward-compatible alias for mesh_meta_data(). | |
| stk::mesh::EntityRank | primary_entity_rank () const |
| Fetch the primary entity rank for this class. | |
| stk::topology | topology () const |
| Fetch the topology for this class. | |
| const std::string & | name () const noexcept |
| Fetch the class name. | |
| class_ordinal_t | class_ordinal () const noexcept |
| Fetch this class ordinal. | |
| const DeclarationSignature & | declaration_signature () const noexcept |
| Fetch the declaration signature used to create this class. | |
| bool | force_no_induce () const |
| Return whether this class suppresses induction. | |
| bool | has_io_support () const noexcept |
| Return whether this class has IO hierarchy support enabled. | |
| bool | should_induce (stk::mesh::EntityRank from_rank) const |
Should this class induce membership from from_rank? | |
| bool | was_induced (stk::mesh::EntityRank rank) const |
Could entities of rank be induced into this class? | |
| bool | entity_membership_is_parallel_consistent () const |
| Whether class membership must be parallel consistent. | |
| void | entity_membership_is_parallel_consistent (bool is_parallel_consistent) |
| Set whether class membership must be parallel consistent. | |
| Type | class_type () const noexcept |
| Fetch the class type. | |
| bool | is_set () const noexcept |
| Fetch whether this class is a set. | |
| bool | is_primary () const noexcept |
| Fetch whether this class is a primary class. | |
| int64_t | data_part_id () const |
| Fetch the data-part id. | |
| int64_t | assembly_part_id () const |
| Fetch the assembly-part id. | |
| bool | contains (const Class &other) const |
Check if other is contained by this class in both hierarchy channels. | |
| const ClassVector & | subclasses () noexcept |
| Direct subclasses declared through the Class API. | |
| const ConstClassVector & | subclasses () const noexcept |
| Direct subclasses declared through the Class API. | |
| const ClassVector & | superclasses () noexcept |
| Direct superclasses declared through the Class API. | |
| const ConstClassVector & | superclasses () const noexcept |
| Direct superclasses declared through the Class API. | |
| const stk::mesh::PartVector & | data_part_supersets () const |
| Parts that are supersets of this class's data part. | |
| const stk::mesh::PartVector & | data_part_subsets () const |
| Parts that are subsets of this class's data part. | |
| const stk::mesh::PartVector & | assembly_part_supersets () const |
| Parts that are supersets of this class's assembly part. | |
| const stk::mesh::PartVector & | assembly_part_subsets () const |
| Parts that are subsets of this class's assembly part. | |
| Class & | get_or_create_induced_set (stk::mesh::EntityRank rank) |
Create an induced set for this class at rank if it doesn't already exist and return it. | |
| Class & | get_induced_set (stk::mesh::EntityRank rank) |
Get an induced set for this class at rank if it exists, otherwise throw. | |
| const Class & | get_induced_set (stk::mesh::EntityRank rank) const |
| bool | has_induced_set (stk::mesh::EntityRank rank) const |
| bool | operator== (const Class &rhs) const |
| Equality comparison. | |
| bool | operator!= (const Class &rhs) const |
| Inequality comparison. | |
| template<class A> | |
| const A * | attribute () const |
| Query attribute attached to the class data part. | |
| stk::mesh::Part & | data_part () noexcept |
| Fetch the non-io data hierarchy part. | |
| const stk::mesh::Part & | data_part () const noexcept |
| Fetch the non-io data hierarchy part. | |
| stk::mesh::Part & | leaf_part () noexcept |
| Fetch the io leaf data part. | |
| const stk::mesh::Part & | leaf_part () const noexcept |
| Fetch the io leaf data part. | |
| stk::mesh::Part & | assembly_part () noexcept |
| Fetch the assembly hierarchy part. | |
| const stk::mesh::Part & | assembly_part () const noexcept |
| Fetch the assembly hierarchy part. | |
| stk::mesh::Part & | leaf_assembly_part () noexcept |
| Fetch the leaf assembly part. | |
| const stk::mesh::Part & | leaf_assembly_part () const noexcept |
| Fetch the leaf assembly part. | |
| operator stk::mesh::Selector () const | |
| Treat this class as the selector for its assembly hierarchy. | |
| operator const stk::mesh::Part & () const noexcept | |
| Treat this class as its assembly part for read-only STK APIs such as Bucket::member(...). | |
Actions | |
| void | declare_subset (Class &sub_class) |
Declare sub_class as a direct subclass in both hierarchy channels. sub_class must have the same primary entity rank as this class. | |
| void | set_assembly_part_ids (unsigned assembly_part_id, unsigned leaf_assembly_part_id) |
| Assign deterministic ids to assembly-type parts for IO/visualization stability. | |
Classes handle the map between class hierarchy logic and STK's io system. We don't set the rules, we just work around them and try to make them easier to use. The main rules are:
Unsupported features and limitations that break the above rules when IO support is enabled:
TODO(palmerb4): Introduce a runtime flag for disabling Class IO rules, thereby allowing for ELEMENT_RANK sets and NODE_RANK primary classes. TODO(palmerb4): Induced sets should be an implementation detail. Mostly because they are inextensible. It's not that they always exist and always contain all lower rank entities, it's that they contain all data that you wish to store on lower rank entities so if you decide to remove all the node fields for a class, then no induced node rank class will be created for that class. This minimizes the number of parts created per class.
Classes handle the STK IO part hierarchy by introducing multiple parts per class + optional induced set parts. They handle the interface logic between a (top down) polymorphic class hierarchy and a (bottom up) disjoint part hierarchy. The set of parts changes based on the class type: (1/2) Primary classes + Sets: