41 #ifndef DTK_STKMESHMANAGER_HPP 42 #define DTK_STKMESHMANAGER_HPP 45 #include <unordered_map> 47 #include "DTK_ClientManager.hpp" 49 #include "DTK_Field.hpp" 50 #include "DTK_FieldMultiVector.hpp" 51 #include "DTK_FunctionSpace.hpp" 52 #include "DTK_STKMeshField.hpp" 53 #include "DTK_Types.hpp" 55 #include <Teuchos_Array.hpp> 56 #include <Teuchos_RCP.hpp> 58 #include <stk_mesh/base/BulkData.hpp> 59 #include <stk_mesh/base/Selector.hpp> 95 STKMeshManager(
const Teuchos::RCP<stk::mesh::BulkData> &bulk_data,
96 const BasisType basis_type = BASIS_TYPE_GRADIENT );
111 STKMeshManager(
const Teuchos::RCP<stk::mesh::BulkData> &bulk_data,
112 const Teuchos::Array<std::string> &part_names,
113 const BasisType basis_type = BASIS_TYPE_GRADIENT );
128 STKMeshManager(
const Teuchos::RCP<stk::mesh::BulkData> &bulk_data,
129 const stk::mesh::PartVector &parts,
130 const BasisType basis_type = BASIS_TYPE_GRADIENT );
145 STKMeshManager(
const Teuchos::RCP<stk::mesh::BulkData> &bulk_data,
146 const stk::mesh::Selector &selector,
147 const BasisType basis_type = BASIS_TYPE_GRADIENT );
153 template <
class FieldType>
155 const int field_dim );
166 template <
class FieldType>
167 Teuchos::RCP<FieldMultiVector>
169 const int field_dim );
176 Teuchos::RCP<EntitySet>
entitySet()
const override;
181 Teuchos::RCP<EntityLocalMap>
localMap()
const override;
186 Teuchos::RCP<EntityShapeFunction>
shapeFunction()
const override;
201 Teuchos::RCP<Field>
field(
const std::string &field_name )
const override;
206 void createFunctionSpace(
const BasisType basis_type,
211 Teuchos::RCP<stk::mesh::BulkData> d_bulk_data;
214 Teuchos::RCP<FunctionSpace> d_function_space;
217 std::unordered_map<std::string, int> d_field_indexer;
220 Teuchos::Array<Teuchos::RCP<Field>> d_fields;
226 template <
class FieldType>
227 Teuchos::RCP<FieldMultiVector>
229 const int field_dim )
231 DTK_REQUIRE( Teuchos::nonnull( d_bulk_data ) );
232 DTK_REQUIRE( Teuchos::nonnull( d_function_space ) );
234 Teuchos::RCP<Field> stk_field = Teuchos::rcp(
237 new FieldMultiVector( stk_field, d_function_space->entitySet() ) );
241 template <
class FieldType>
243 const int field_dim )
245 DTK_REQUIRE( Teuchos::nonnull( d_bulk_data ) );
246 DTK_REQUIRE( Teuchos::nonnull( d_function_space ) );
248 d_field_indexer.emplace( field->name(), d_fields.size() );
251 d_bulk_data, field, field_dim ) ) );
260 #endif // end DTK_STKMESHMANAGER_HPP Field data access for STK mesh.
Teuchos::RCP< EntityIntegrationRule > integrationRule() const override
Get the integration rule for entities supporting the function.
Assertions and Design-by-Contract for error handling.
BasisType
Basis type enum.
Teuchos::RCP< Field > field(const std::string &field_name) const override
Get the field for the given string key.
PredicateFunction selectFunction() const override
Get the selector function.
STKMeshManager(const Teuchos::RCP< stk::mesh::BulkData > &bulk_data, const BasisType basis_type=BASIS_TYPE_GRADIENT)
Default constructor.
std::function< bool(Entity)> PredicateFunction
Predicate function typedef.
Teuchos::RCP< FunctionSpace > functionSpace() const
Get the function space over which the mesh and its fields are defined.
Teuchos::RCP< EntitySet > entitySet() const override
ClientManager interface implementation.
Teuchos::RCP< EntityLocalMap > localMap() const override
Get the local map for entities supporting the function.
High-level manager for STK mesh.
void registerField(const Teuchos::Ptr< FieldType > &field, const int field_dim)
Register a tag with the manager that will be available for solution transfer.
Teuchos::RCP< FieldMultiVector > createFieldMultiVector(const Teuchos::Ptr< FieldType > &field, const int field_dim)
Given a field and dimension, build a vector over that field.
Teuchos::RCP< EntityShapeFunction > shapeFunction() const override
Get the shape function for entities supporting the function.