41 #include "DTK_BasicGeometryManager.hpp" 42 #include "DTK_BasicEntityPredicates.hpp" 43 #include "DTK_BasicEntitySet.hpp" 44 #include "DTK_BasicGeometryLocalMap.hpp" 46 #include "DTK_EntityCenteredShapeFunction.hpp" 47 #include "DTK_PredicateComposition.hpp" 54 const Teuchos::RCP<
const Teuchos::Comm<int>> comm,
55 const int physical_dimension )
57 Teuchos::Array<Entity> entities( 0 );
58 createFunctionSpace( comm, physical_dimension, entities,
59 FunctionSpace::selectAll );
60 DTK_ENSURE( Teuchos::nonnull( d_function_space ) );
66 const Teuchos::RCP<
const Teuchos::Comm<int>> comm,
67 const int physical_dimension,
const Teuchos::ArrayView<Entity> &entities )
69 createFunctionSpace( comm, physical_dimension, entities,
70 FunctionSpace::selectAll );
71 DTK_ENSURE( Teuchos::nonnull( d_function_space ) );
77 const Teuchos::RCP<
const Teuchos::Comm<int>> comm,
78 const int physical_dimension,
const Teuchos::ArrayView<Entity> &entities,
79 const Teuchos::ArrayView<int> &block_ids,
80 const Teuchos::ArrayView<int> &boundary_ids )
82 Teuchos::Array<int> block_array( block_ids );
83 Teuchos::Array<int> boundary_array( boundary_ids );
84 BlockPredicate block_pred( block_array );
85 BoundaryPredicate boundary_pred( boundary_array );
87 block_pred.getFunction(), boundary_pred.getFunction() );
88 createFunctionSpace( comm, physical_dimension, entities, pred );
89 DTK_ENSURE( Teuchos::nonnull( d_function_space ) );
96 return d_function_space;
101 void BasicGeometryManager::createFunctionSpace(
102 const Teuchos::RCP<
const Teuchos::Comm<int>> comm,
103 const int physical_dimension,
const Teuchos::ArrayView<Entity> &entities,
106 Teuchos::RCP<BasicEntitySet> entity_set =
108 for (
Entity e : entities )
110 entity_set->addEntity( e );
113 Teuchos::RCP<EntityLocalMap> local_map =
116 Teuchos::RCP<EntityShapeFunction> shape_function =
120 Teuchos::rcp(
new FunctionSpace( entity_set, local_map, shape_function,
121 Teuchos::null, select_function ) );
BasicGeometryManager(const Teuchos::RCP< const Teuchos::Comm< int >> comm, const int physical_dimension)
Default constructor. Initializes an empty entity set with a function space defined over the given typ...
Geometric entity interface definition.
Entity-centered shape function.
Assertions and Design-by-Contract for error handling.
std::function< bool(Entity)> PredicateFunction
Predicate function typedef.
Entity forward and reverse local map interface definition.
Basic implementation of the entity set interface.
Teuchos::RCP< FunctionSpace > functionSpace() const
Get the function space over which the mesh and its fields are defined.