|
| PartDeclaration | name (const std::string &part_name) |
| | Set the name of the part (must be called before declare()).
|
| PartDeclaration | rank (stk::mesh::EntityRank part_rank) |
| | Set the entity rank of the part.
|
| PartDeclaration | topology (stk::topology::topology_t part_topology) |
| | Set the topology of the part.
|
| PartDeclaration | role (IOPartRole io_part_role) |
| | Set the io role of the part (optional).
|
| PartDeclaration | subpart (const stk::mesh::Part &subpart) |
| | Add a subpart to the part (i.e, declare the given part as a subset of this part).
|
| template<typename FieldType> |
| PartDeclaration | put_field (FieldType &field, const typename FieldType::value_type *init_value) |
| | Create a scalar-valued field restriction for this part (optional) with the given initial value.
|
| template<typename FieldType> |
| PartDeclaration | put_field (FieldType &field, unsigned n1, const typename FieldType::value_type *init_value) |
| | Create a vector-valued field restriction for this part (optional) with the given initial value and n1 values per entity.
|
| template<typename FieldType> |
| PartDeclaration | put_field (FieldType &field, unsigned n1, unsigned n2, const typename FieldType::value_type *init_value) |
| | Create a tensor-valued field restriction for this part (optional) with the given initial value and n1 x n2 values per entity.
|
| template<typename ComponentType, typename BackingFieldType = std::remove_cvref_t< decltype(impl::component_backing_field(std::declval<ComponentType&>()))>> |
| PartDeclaration | put_component (ComponentType component, const typename BackingFieldType::value_type *init_value) |
| | Create a field restriction directly from a field-backed component declaration.
|
| stk::mesh::Part & | declare () |
| | Declare a part with the given properties.
|
| void | print (std::ostream &os=std::cout) const |
| | Print the part declaration information to the output stream.
|
This class is used to aid the declaration of a part on the mesh with reduced boilerplate. It uses a fluent interface to set the part properties and then declare the part.
There are three types of parts that may be declared:
- Named parts (name, but no rank or topology)
- Ranked parts (name and rank, but no topology)
- Topological parts (name and topology, but no rank)
You may not specify both a rank and a topology for the same part.
For example, to create an element rank assembly part that contains all beams and spheres:
stk::mesh::Part &spheres = part_decl.name(
"spheres").topology(stk::topology::PARTICLE).role(
IO).declare();
stk::mesh::Part &beams = part_decl.name(
"beams").topology(stk::topology::BEAM_2).role(
IO).declare();
stk::mesh::Part &rigid_bodies =
part_decl.name(
"rigid_bodies").rank(ELEM_RANK).role(
ASSEMBLY).subpart(spheres).subpart(beams).declare();
PartDeclaration(stk::mesh::MetaData &meta_data)
Canonical constructor.
Definition DeclarePart.hpp:89
@ ASSEMBLY
Definition DeclarePart.hpp:51
@ IO
Definition DeclarePart.hpp:51
These setters may be called in any order. Role and subparts are optional, but you must call a valid combination of name, rank, and topology before declare().
You may also reuse the same PartDeclaration to declare multiple parts with similar properties:
auto io_particle_part_decl = part_decl.topology(stk::topology::PARTICLE).role(
IO).declare();
stk::mesh::Part &spheres = io_particle_part_decl.name("spheres").declare();
stk::mesh::Part &points = io_particle_part_decl.name("points").declare();