PolygonHole (Point center, Real radius, unsigned int n_points)
virtual unsigned int n_points () const
virtual Pointpoint (const unsigned int n) const
virtual Pointinside () const
Private Attributes
Point_center
Real_radius
unsigned int _n_points
Detailed Description
A concrete instantiation of the Hole class that describes polygonal (triangular, square, pentagonal, ...) holes.
Definition at line 318 of file mesh_triangle_support.h.
Constructor & Destructor Documentation
TriangleInterface::PolygonHole::PolygonHole (Pointcenter, Realradius, unsigned intn_points) [inline]Constructor specifying the center, radius, and number of points which comprise the hole. The points will all lie on a circle of radius r.
Definition at line 326 of file mesh_triangle_support.h.
virtual Point TriangleInterface::PolygonHole::inside () const [inline, virtual]The center of the hole is definitely inside.
Implements TriangleInterface::Hole.
Definition at line 351 of file mesh_triangle_support.h.
References _center.
{ return _center; }
virtual unsigned int TriangleInterface::PolygonHole::n_points () const [inline, virtual]Default Constructor, does not set any values
Implements TriangleInterface::Hole.
Definition at line 336 of file mesh_triangle_support.h.
References _n_points.
{ return _n_points; }
virtual Point TriangleInterface::PolygonHole::point (const unsigned intn) const [inline, virtual]Return the nth point defining the hole.
Implements TriangleInterface::Hole.
Definition at line 338 of file mesh_triangle_support.h.
References _center, _n_points, _radius, and libMesh::pi.
{
// The nth point lies at the angle theta = 2 * pi * n / _n_points
const Real theta = static_cast<Real>(n) * 2.0 * libMesh::pi / static_cast<Real>(_n_points);
return Point(_center(0) + _radius*std::cos(theta), // x=r*cos(theta)
_center(1) + _radius*std::sin(theta), // y=r*sin(theta)
0.);
}
Member Data Documentation
PointTriangleInterface::PolygonHole::_center [private](x,y) location of the center of the hole
Definition at line 357 of file mesh_triangle_support.h.
Referenced by inside(), and point().
unsigned int TriangleInterface::PolygonHole::_n_points [private]number of points used to describe the hole. The actual points can be generated knowing the center and radius. For example, n_points=3 would generate a triangular hole.
Definition at line 369 of file mesh_triangle_support.h.