|
| ClassDeclaration | name (const std::string &class_name) |
| | Set the name of the class (must be called before declare()).
|
| ClassDeclaration | rank (stk::mesh::EntityRank class_rank) |
| | Set the entity rank of the class.
|
| ClassDeclaration | topology (stk::topology::topology_t class_topology) |
| | Set the topology of the class.
|
| ClassDeclaration | subclass (const Class &subclass) |
| | Add a subclass to the class (i.e, declare the given class as a subset of this class).
|
| ClassDeclaration | superclass (const Class &superclass) |
| | Add a superclass to the class (i.e, declare this class as a subset of the given class).
|
| template<typename FieldType> |
| ClassDeclaration | put_field (FieldType &field, const typename FieldType::value_type *init_value) |
| | Create a scalar-valued field restriction for this class (optional) with the given initial value.
|
| template<typename FieldType> |
| ClassDeclaration | put_field (FieldType &field, unsigned n1, const typename FieldType::value_type *init_value) |
| | Create a vector-valued field restriction for this class (optional) with the given initial value.
|
| template<typename FieldType> |
| ClassDeclaration | put_field (FieldType &field, unsigned n1, unsigned n2, const typename FieldType::value_type *init_value) |
| | Create a tensor-valued field restriction for this class (optional) with the given initial value.
|
| template<typename ComponentType, typename BackingFieldType = std::remove_cvref_t< decltype(impl::component_backing_field(std::declval<ComponentType&>()))>> |
| ClassDeclaration | put_component (ComponentType component, const typename BackingFieldType::value_type *init_value) |
| | Create a field restriction directly from a field-backed component declaration.
|
| Class & | declare () |
| | Declare a class with the given properties.
|
| void | print (std::ostream &os=std::cout) const |
| | Print the class declaration information to the output stream.
|
This class is used to aid the declaration of a class on the mesh with reduced boilerplate. It uses a fluent interface to set the class properties and then declare the class.
There are three types of classes that may be declared:
- Named classes (name, but no rank or topology)
- Ranked class-sets (name and rank, but no topology)
- Topological primary classes (name and topology, but no rank)
You may not specify both a rank and a topology for the same class.
For example, to create a node-rank set that contains boundary and loading nodes:
Class& boundary_nodes = class_decl.
name(
"boundary_nodes").rank(NODE_RANK).declare();
Class& loading_nodes = class_decl.
name(
"loading_nodes").rank(NODE_RANK).declare();
class_decl.
name(
"all_nodes").rank(NODE_RANK).subclass(boundary_nodes).subclass(loading_nodes).declare();
ClassDeclaration(stk::mesh::MetaData &meta_data)
Canonical constructor.
Definition DeclareClass.hpp:88
Semantic mesh class backed by synchronized data and assembly part hierarchies.
Definition Class.hpp:128
const std::string & name() const noexcept
Fetch the class name.
Definition Class.hpp:212
These setters may be called in any order. Subclasses are optional, but you must call a valid combination of name, rank, and topology before declare().
You may also reuse the same ClassDeclaration to declare multiple classes with similar properties:
auto particle_class_decl = class_decl.topology(stk::topology::PARTICLE).declare();
Class& spheres = particle_class_decl.
name(
"spheres").declare();
Class& points = particle_class_decl.
name(
"points").declare();