44 #include "DTK_STKMeshEntity.hpp" 45 #include "DTK_STKMeshEntityIterator.hpp" 46 #include "DTK_STKMeshEntityIteratorRange.hpp" 47 #include "DTK_STKMeshEntitySet.hpp" 48 #include "DTK_STKMeshHelpers.hpp" 50 #include <stk_mesh/base/GetEntities.hpp> 51 #include <stk_mesh/base/MetaData.hpp> 52 #include <stk_topology/topology.hpp> 54 #include <Teuchos_DefaultMpiComm.hpp> 61 const Teuchos::RCP<stk::mesh::BulkData> &bulk_data )
62 : d_bulk_data( bulk_data )
64 DTK_REQUIRE( Teuchos::nonnull( d_bulk_data ) );
71 return Teuchos::rcp(
new Teuchos::MpiComm<int>( d_bulk_data->parallel() ) );
78 return d_bulk_data->mesh_meta_data().spatial_dimension();
84 const int topological_dimension,
87 stk::mesh::Entity stk_entity = d_bulk_data->get_entity(
101 stk::mesh::EntityRank rank =
104 Teuchos::RCP<STKMeshEntityIteratorRange> iterator_range =
106 stk::mesh::get_entities( *d_bulk_data, rank,
107 iterator_range->d_stk_entities );
116 const Entity &entity,
const int adjacent_dimension,
117 Teuchos::Array<Entity> &adjacent_entities )
const 119 const stk::mesh::Entity &stk_entity =
121 stk::mesh::EntityRank rank =
124 const stk::mesh::Entity *begin = d_bulk_data->begin( stk_entity, rank );
125 const stk::mesh::Entity *end = d_bulk_data->end( stk_entity, rank );
126 Teuchos::Array<stk::mesh::Entity> stk_adjacencies( begin, end );
127 adjacent_entities.resize( stk_adjacencies.size() );
128 Teuchos::Array<Entity>::iterator entity_it;
129 Teuchos::Array<stk::mesh::Entity>::iterator stk_it;
130 for ( entity_it = adjacent_entities.begin(),
131 stk_it = stk_adjacencies.begin();
132 entity_it != adjacent_entities.end(); ++entity_it, ++stk_it )
Geometric entity interface definition.
STKMesh entity interface definition.
A container for entity vectors that can be reference-counted.
Entity iterator interface.
static const stk::mesh::Entity & extractEntity(const Entity dtk_entity)
Given a DTK entity, extract the STK entity.
STK mesh entity iterator implementation.
void getEntity(const EntityId entity_id, const int topological_dimension, Entity &entity) const override
Entity access functions.
STKMeshEntitySet(const Teuchos::RCP< stk::mesh::BulkData > &bulk_data)
Constructor.
EntityIterator entityIterator(const int topological_dimension, const PredicateFunction &predicate) const override
Get a iterator of the given entity type that satisfy the given predicate.
Assertions and Design-by-Contract for error handling.
void getAdjacentEntities(const Entity &entity, const int adjacent_dimension, Teuchos::Array< Entity > &adjacent_entities) const override
Given an entity, get the entities of the given topological dimension that are adjacent to it...
std::function< bool(Entity)> PredicateFunction
Predicate function typedef.
unsigned long int EntityId
Entity id type.
static stk::mesh::EntityRank getRankFromTopologicalDimension(const int topo_dim, const int space_dim)
Given a topological dimension, get the STK entity rank.
int physicalDimension() const override
Geometric data functions.
Teuchos::RCP< const Teuchos::Comm< int > > communicator() const override
Parallel functions.