79 const EntityId global_id,
const int owner_rank,
const int block_id,
80 const double length,
const double radius,
const double centroid_x,
81 const double centroid_y,
const double centroid_z )
82 : d_global_id( global_id )
83 , d_owner_rank( owner_rank )
84 , d_block_id( block_id )
87 , d_centroid_x( centroid_x )
88 , d_centroid_y( centroid_y )
89 , d_centroid_z( centroid_z )
91 DTK_REQUIRE( 0.0 <= d_length );
92 DTK_REQUIRE( 0.0 <= d_radius );
118 Teuchos::Tuple<double, 6> &bounds )
const 121 Teuchos::tuple( d_centroid_x - d_radius, d_centroid_y - d_radius,
122 d_centroid_z - d_length / 2, d_centroid_x + d_radius,
123 d_centroid_y + d_radius, d_centroid_z + d_length / 2 );
130 return ( block_id == d_block_id );
142 Teuchos::FancyOStream &out,
143 const Teuchos::EVerbosityLevel )
const 145 out <<
"---" << std::endl;
147 out <<
"Id: " <<
id() << std::endl;
148 out <<
"Owner rank: " <<
ownerRank() << std::endl;
149 out <<
"Block id: " << d_block_id << std::endl;
150 out <<
"Length: " << d_length << std::endl;
151 out <<
"Radius: " << d_radius << std::endl;
152 out <<
"Centroid (x,y,z): " << d_centroid_x <<
" " << d_centroid_y <<
" " 153 << d_centroid_z << std::endl;
165 double pi = 2.0 * std::acos( zero );
166 return pi * d_radius * d_radius * d_length;
176 const Teuchos::ArrayView<double> &
centroid )
const 178 centroid[0] = d_centroid_x;
179 centroid[1] = d_centroid_y;
180 centroid[2] = d_centroid_z;
188 const Teuchos::ArrayView<const double> &point,
189 const Teuchos::ArrayView<double> &reference_point )
const 191 reference_point.assign( point );
201 const double tolerance,
202 const Teuchos::ArrayView<const double> &reference_point )
const 204 DTK_REQUIRE( reference_point.size() == 3 );
206 double x_dist = d_centroid_x - reference_point[0];
207 double y_dist = d_centroid_y - reference_point[1];
208 double r = std::sqrt( x_dist * x_dist + y_dist * y_dist );
209 double rad_tol = d_radius * tolerance;
210 double half_length_tol = d_length / 2 + d_length * tolerance;
212 return ( ( r <= d_radius + rad_tol ) &&
213 ( reference_point[2] >= d_centroid_z - half_length_tol ) &&
214 ( reference_point[2] <= d_centroid_z + half_length_tol ) );
222 const Teuchos::ArrayView<const double> &reference_point,
223 const Teuchos::ArrayView<double> &point )
const 225 point.assign( reference_point );
static const EntityId dtk_invalid_entity_id
Invalid entity id.
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.
double radius() const
Get the radius of the cylinder.
double length() const
Get the length of the cylinder.
CylinderGeometry implementation.
EntityId id() const override
EntityImpl interface.
std::string description() const override
Provide a one line description of the object.
bool inBlock(const int block_id) const override
Determine if an entity is in the block with the given id.
CylinderGeometryImpl()
Default constructor.
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.
Assertions and Design-by-Contract for error handling.
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 ownerRank() const override
Get the parallel rank that owns the entity.
unsigned long int EntityId
Entity id type.
bool onBoundary(const int boundary_id) const override
Determine if an entity is on the boundary with the given id.
void centroid(const Teuchos::ArrayView< double > ¢roid) const override
Get the centroid of the box.
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.
void boundingBox(Teuchos::Tuple< double, 6 > &bounds) const override
Compute the bounding box around the box.
int topologicalDimension() const override
Return the topological dimension of the entity.
int physicalDimension() const override
Return the physical dimension of the entity.