41 #include "DTK_EntitySet.hpp" 42 #include "DTK_BasicEntityPredicates.hpp" 45 #include <Teuchos_CommHelpers.hpp> 62 LocalEntityPredicate local_predicate(
communicator()->getRank() );
64 double max = std::numeric_limits<double>::max();
65 bounds = Teuchos::tuple( max, max, max, -max, -max, -max );
70 Teuchos::Tuple<double, 6> entity_bounds;
71 for (
int i = 0; i < 4; ++i )
74 entity_begin = dim_it.begin();
75 entity_end = dim_it.end();
76 for ( entity_it = entity_begin; entity_it != entity_end; ++entity_it )
79 for (
int n = 0; n < 3; ++n )
81 bounds[n] = std::min( bounds[n], entity_bounds[n] );
82 bounds[n + 3] = std::max( bounds[n + 3], entity_bounds[n + 3] );
93 double max = std::numeric_limits<double>::max();
94 bounds = Teuchos::tuple( max, max, max, max, max, max );
96 Teuchos::Tuple<double, 6> local_bounds;
98 local_bounds[3] *= -1;
99 local_bounds[4] *= -1;
100 local_bounds[5] *= -1;
102 Teuchos::reduceAll( *( this->
communicator() ), Teuchos::REDUCE_MIN, 6,
103 &local_bounds[0], &bounds[0] );
114 return std::string(
"DataTransferKit::EntitySet" );
120 const Teuchos::EVerbosityLevel )
const 131 Teuchos::Tuple<double, 6> local_box;
136 <<
"Num 0-D entities: " << d0_it.size() << std::endl
137 <<
"Num 1-D entities: " << d1_it.size() << std::endl
138 <<
"Num 2-D entities: " << d2_it.size() << std::endl
139 <<
"Num 3-D entities: " << d3_it.size() << std::endl
140 <<
"Local bounding box: " << local_box << std::endl;
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verb_level=Teuchos::Describable::verbLevel_default) const override
Provide a verbose description of the object.
void boundingBox(Teuchos::Tuple< double, 6 > &bounds) const
Return the Cartesian bounding box around an entity.
Entity iterator interface.
virtual Teuchos::RCP< const Teuchos::Comm< int > > communicator() const =0
Parallel functions.
virtual EntityIterator entityIterator(const int topological_dimension, const PredicateFunction &predicate=selectAll) const =0
Get an iterator of the given entity type that satisfies the given predicate.
virtual int physicalDimension() const =0
Geometric data functions.
Assertions and Design-by-Contract for error handling.
std::function< bool(Entity)> PredicateFunction
Predicate function typedef.
virtual void globalBoundingBox(Teuchos::Tuple< double, 6 > &bounds) const
Get the global bounding box of entities of the set.
virtual void localBoundingBox(Teuchos::Tuple< double, 6 > &bounds) const
Get the local bounding box of entities of the set.
virtual std::string description() const override
Teuchos::Describable interface.
virtual ~EntitySet()
Destructor.