$extrastylesheet
libMesh::TriangleInterface::PolygonHole Class Reference

#include <mesh_triangle_holes.h>

Inheritance diagram for libMesh::TriangleInterface::PolygonHole:

List of all members.

Public Member Functions

 PolygonHole (const Point &center, Real radius, unsigned int n_points)
virtual unsigned int n_points () const
virtual Point point (const unsigned int n) const
virtual Point inside () 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 77 of file mesh_triangle_holes.h.


Constructor & Destructor Documentation

libMesh::TriangleInterface::PolygonHole::PolygonHole ( const Point center,
Real  radius,
unsigned int  n_points 
)

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 33 of file mesh_triangle_holes.C.

  : _center(center),
    _radius(radius),
    _n_points(n_points_in)
{}

Member Function Documentation

Return an (arbitrary) point which lies inside the hole.

Implements libMesh::TriangleInterface::Hole.

Definition at line 57 of file mesh_triangle_holes.C.

{
  // The center of the hole is definitely inside.
  return _center;
}
unsigned int libMesh::TriangleInterface::PolygonHole::n_points ( ) const [virtual]

The number of geometric points which define the hole.

Implements libMesh::TriangleInterface::Hole.

Definition at line 40 of file mesh_triangle_holes.C.

References _n_points.

{
  return _n_points;
}
Point libMesh::TriangleInterface::PolygonHole::point ( const unsigned int  n) const [virtual]

Return the nth point defining the hole.

Implements libMesh::TriangleInterface::Hole.

Definition at line 45 of file mesh_triangle_holes.C.

References libMesh::pi, and libMesh::Real.

{
  // 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

(x,y) location of the center of the hole

Definition at line 97 of file mesh_triangle_holes.h.

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 109 of file mesh_triangle_holes.h.

Referenced by n_points().

circular hole radius

Definition at line 102 of file mesh_triangle_holes.h.


The documentation for this class was generated from the following files: