41 #include "DTK_STKMeshManager.hpp" 42 #include "DTK_STKMeshEntityIntegrationRule.hpp" 43 #include "DTK_STKMeshEntityLocalMap.hpp" 44 #include "DTK_STKMeshEntityPredicates.hpp" 45 #include "DTK_STKMeshEntitySet.hpp" 46 #include "DTK_STKMeshNodalShapeFunction.hpp" 53 const Teuchos::RCP<stk::mesh::BulkData> &bulk_data,
55 : d_bulk_data( bulk_data )
57 createFunctionSpace( basis_type, FunctionSpace::selectAll );
58 DTK_ENSURE( Teuchos::nonnull( d_function_space ) );
64 const Teuchos::RCP<stk::mesh::BulkData> &bulk_data,
65 const Teuchos::Array<std::string> &part_names,
const BasisType basis_type )
66 : d_bulk_data( bulk_data )
69 createFunctionSpace( basis_type, pred.getFunction() );
70 DTK_ENSURE( Teuchos::nonnull( d_function_space ) );
76 const Teuchos::RCP<stk::mesh::BulkData> &bulk_data,
77 const stk::mesh::PartVector &parts,
const BasisType basis_type )
78 : d_bulk_data( bulk_data )
81 createFunctionSpace( basis_type, pred.getFunction() );
82 DTK_ENSURE( Teuchos::nonnull( d_function_space ) );
88 const Teuchos::RCP<stk::mesh::BulkData> &bulk_data,
89 const stk::mesh::Selector &selector,
const BasisType basis_type )
90 : d_bulk_data( bulk_data )
93 createFunctionSpace( basis_type, pred.getFunction() );
94 DTK_ENSURE( Teuchos::nonnull( d_function_space ) );
101 return d_function_space;
106 void STKMeshManager::createFunctionSpace(
109 Teuchos::RCP<EntitySet> entity_set =
112 Teuchos::RCP<EntityLocalMap> local_map =
115 Teuchos::RCP<EntityShapeFunction> shape_function;
116 switch ( basis_type )
118 case BASIS_TYPE_GRADIENT:
124 bool bad_basis_type =
true;
125 DTK_INSIST( !bad_basis_type );
128 DTK_CHECK( Teuchos::nonnull( shape_function ) );
130 Teuchos::RCP<EntityIntegrationRule> integration_rule =
134 Teuchos::rcp(
new FunctionSpace( entity_set, local_map, shape_function,
135 integration_rule, select_function ) );
137 DTK_ENSURE( Teuchos::nonnull( d_function_space ) );
143 return d_function_space->entitySet();
150 return d_function_space->localMap();
157 return d_function_space->shapeFunction();
164 return d_function_space->integrationRule();
171 return d_function_space->selectFunction();
178 DTK_REQUIRE( d_field_indexer.count( field_name ) );
179 int field_id = d_field_indexer.find( field_name )->second;
180 return d_fields[field_id];
integration rule interface.
STK mesh forward and reverse local map implementation.
Teuchos::RCP< EntityIntegrationRule > integrationRule() const override
Get the integration rule for entities supporting the function.
Predicates for selecting entities in parts by part name.
Predicates for selecting entities in a selector.
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.
Nodal shape function implementation for STK mesh.
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.
Predicates for selecting entities in a part vector.
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.
Teuchos::RCP< EntityShapeFunction > shapeFunction() const override
Get the shape function for entities supporting the function.