80 const int owner_rank,
const int block_id,
81 const double x_min,
const double y_min,
82 const double z_min,
const double x_max,
83 const double y_max,
const double z_max )
84 : d_global_id( global_id )
85 , d_owner_rank( owner_rank )
86 , d_block_id( block_id )
94 DTK_REQUIRE( d_x_min <= d_x_max );
95 DTK_REQUIRE( d_y_min <= d_y_max );
96 DTK_REQUIRE( d_z_min <= d_z_max );
106 const int owner_rank,
const int block_id,
107 const Teuchos::Tuple<double, 6> &bounds )
108 : d_global_id( global_id )
109 , d_owner_rank( owner_rank )
110 , d_block_id( block_id )
111 , d_x_min( bounds[0] )
112 , d_y_min( bounds[1] )
113 , d_z_min( bounds[2] )
114 , d_x_max( bounds[3] )
115 , d_y_max( bounds[4] )
116 , d_z_max( bounds[5] )
118 DTK_REQUIRE( d_x_min <= d_x_max );
119 DTK_REQUIRE( d_y_min <= d_y_max );
120 DTK_REQUIRE( d_z_min <= d_z_max );
148 Teuchos::tuple( d_x_min, d_y_min, d_z_min, d_x_max, d_y_max, d_z_max );
155 return ( block_id == d_block_id );
167 Teuchos::FancyOStream &out,
168 const Teuchos::EVerbosityLevel )
const 170 out <<
"---" << std::endl;
172 out <<
"Id: " <<
id() << std::endl;
173 out <<
"Owner rank: " <<
ownerRank() << std::endl;
174 out <<
"Block id: " << d_block_id << std::endl;
175 out <<
"(xmin,ymin,zmin,xmax,ymax,zmax): " << d_x_min <<
" " << d_y_min
176 <<
" " << d_z_min <<
" " << d_x_max <<
" " << d_y_max <<
" " << d_z_max
188 return ( d_x_max - d_x_min ) * ( d_y_max - d_y_min ) *
189 ( d_z_max - d_z_min );
199 const Teuchos::ArrayView<double> &
centroid )
const 201 centroid[0] = ( d_x_max + d_x_min ) / 2.0;
202 centroid[1] = ( d_y_max + d_y_min ) / 2.0;
203 centroid[2] = ( d_z_max + d_z_min ) / 2.0;
211 const Teuchos::ArrayView<const double> &point,
212 const Teuchos::ArrayView<double> &reference_point )
const 214 reference_point.assign( point );
224 const double tolerance,
225 const Teuchos::ArrayView<const double> &reference_point )
const 227 DTK_REQUIRE( 3 == reference_point.size() );
229 double x_tol = ( d_x_max - d_x_min ) * tolerance;
230 double y_tol = ( d_y_max - d_y_min ) * tolerance;
231 double z_tol = ( d_z_max - d_z_min ) * tolerance;
233 if ( reference_point[0] >= d_x_min - x_tol &&
234 reference_point[1] >= d_y_min - y_tol &&
235 reference_point[2] >= d_z_min - z_tol &&
236 reference_point[0] <= d_x_max + x_tol &&
237 reference_point[1] <= d_y_max + y_tol &&
238 reference_point[2] <= d_z_max + z_tol )
251 const Teuchos::ArrayView<const double> &reference_point,
252 const Teuchos::ArrayView<double> &point )
const 254 point.assign( reference_point );
static const EntityId dtk_invalid_entity_id
Invalid entity id.
int ownerRank() const override
Get the parallel rank that owns the entity.
double measure() const override
Compute the measure of the box.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verb_level) const override
Provide a verbose description of the object.
int physicalDimension() const override
Return the physical dimension of the entity.
void boundingBox(Teuchos::Tuple< double, 6 > &bounds) const override
Compute the bounding box around the box.
bool onBoundary(const int boundary_id) const override
Determine if an entity is on the boundary with the given id.
int topologicalDimension() const override
Return the topological dimension of the entity.
bool inBlock(const int block_id) const override
Determine if an entity is in the block with the given id.
Assertions and Design-by-Contract for error handling.
EntityId id() const override
EntityImpl interface.
BoxGeometry implementation.
unsigned long int EntityId
Entity id type.
std::string description() const override
Provide a one line description of the object.
void centroid(const Teuchos::ArrayView< double > ¢roid) const override
Get the centroid of the box.
bool checkPointInclusion(const double tolerance, const Teuchos::ArrayView< const double > &reference_point) const override
Determine if a reference point is in the parameterized space of an entity.
void mapToPhysicalFrame(const Teuchos::ArrayView< const double > &reference_point, const Teuchos::ArrayView< double > &point) const override
Map a reference point to the physical space of an entity.
bool mapToReferenceFrame(const Teuchos::ArrayView< const double > &point, const Teuchos::ArrayView< double > &reference_point) const override
Map a point to the reference space of an entity. Return the.
BoxGeometryImpl()
Default constructor.