Poster of Linux kernelThe best gift for a Linux geek
TriangleInterface::PolygonHole

TriangleInterface::PolygonHole

Section: C Library Functions (3) Updated: Thu Apr 7 2011
Local index Up
 

NAME

TriangleInterface::PolygonHole -  

SYNOPSIS


#include <mesh_triangle_support.h>

Inherits TriangleInterface::Hole.  

Public Member Functions


PolygonHole (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 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.

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

Member Function Documentation

 

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

 

Point TriangleInterface::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.

Referenced by n_points(), and point().  

Real TriangleInterface::PolygonHole::_radius [private]circular hole radius

Definition at line 362 of file mesh_triangle_support.h.

Referenced by point().

 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Private Attributes
Detailed Description
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.
Member Function Documentation
virtual Point TriangleInterface::PolygonHole::inside () const [inline, virtual]The center of the hole is definitely inside.
virtual unsigned int TriangleInterface::PolygonHole::n_points () const [inline, virtual]Default Constructor, does not set any values
virtual Point TriangleInterface::PolygonHole::point (const unsigned intn) const [inline, virtual]Return the nth point defining the hole.
Member Data Documentation
Point TriangleInterface::PolygonHole::_center [private](x,y) location of the center of the hole
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.
Real TriangleInterface::PolygonHole::_radius [private]circular hole radius
Author

This document was created by man2html, using the manual pages.
Time: 21:57:47 GMT, April 16, 2011