Triangle< SPD > Class Template Reference

Triangle.h DG++. More...

#include <Triangle.h>

Inheritance diagram for Triangle< SPD >:
AbstractGeom< SPD > ElementGeometry

List of all members.

Public Member Functions

 Triangle (const std::vector< double > &globalCoordVec, const std::vector< GlobalNodalIndex > &connectivity)
 Connectivity in Triangle<SPD> GlobalCoordinatesArray.
virtual ~Triangle ()
 Triangle (const Triangle< SPD > &that)
virtual Triangle< SPD > * clone () const
const size_t getNumVertices () const
const std::string getPolytopeName () const
const size_t getParametricDimension () const
 Number of dimensions in parametric configuration.
const size_t getEmbeddingDimension () const
 Number of dimensions in the real configuration.
void map (const double *X, double *Y) const
 map from parametric to real configuration
void dMap (const double *X, double *DY, double &Jac) const
 Derivative of map from parametric to real configuration.
size_t getNumFaces () const
 Number of faces the polytope has.
virtual const double getInRadius (void) const
 Computes the Inner radius of the ElementGeometry object.
virtual const double getOutRadius (void) const
 Computes the Outer radius of the ElementGeometry object.
virtual Segment< SPD > * getFaceGeometry (size_t e) const
 Creates and returns a new ElementGeometry object corresponding to face "e" in the polytope.
virtual void computeNormal (size_t e, std::vector< double > &vNormal) const
 Compute external normal for a face.

Static Private Attributes

static const size_t SegmentNodes [] = {0,1,1,2,2,0}
static const double ParamCoord [] = {1,0,0,1,0,0}

Detailed Description

template<size_t SPD>
class Triangle< SPD >

Triangle.h DG++.

Created by Adrian Lew on 9/4/06.

Copyright (c) 2006 Adrian Lew

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Triangle: Geometry of planar triangles A Triangle is:
1) A set of indices that describe the connectivity of the triangle, properly oriented. The coordinates are not stored in the element but wherever the application decides
2) An affine map from a two-dimensional triangle (parametric configuration) with area 1/2 to the convex hull of the three vertices. Triangles embedded in three-dimensional space are hence easily handled.

The parametric configuration is the triangle (0,0),(1,0),(0,1).
The two parametric coordinates used are the ones aligned with the two axes in 2D.

For a triangle with connectivity (1,2,3) the faces are ordered as (1,2),(2,3),(3,1).

Rationale for a templated class: prevent having multiple copies of the dimension of SPD in each one of the multiple elements in a mesh. A static variable for it would have only allowed to use one type of triangles in a program.

Warning:
Neither map nor dMap check for bounds of their array arguments

Constructor & Destructor Documentation

template<size_t SPD>
Triangle< SPD >::Triangle ( const std::vector< double > &  globalCoordVec,
const std::vector< GlobalNodalIndex > &  connectivity 
) [inline]

Connectivity in Triangle<SPD> GlobalCoordinatesArray.

template<size_t SPD>
virtual Triangle< SPD >::~Triangle (  )  [inline, virtual]
template<size_t SPD>
Triangle< SPD >::Triangle ( const Triangle< SPD > &  that  )  [inline]

Member Function Documentation

template<size_t SPD>
virtual Triangle<SPD>* Triangle< SPD >::clone (  )  const [inline, virtual]

Implements ElementGeometry.

template<size_t SPD>
void Triangle< SPD >::computeNormal ( size_t  e,
std::vector< double > &  vNormal 
) const [inline, virtual]

Compute external normal for a face.

Parameters:
e,: face number for which the normal is desired
vNormal,: output of the three Cartesian components of the normal vector

Implements ElementGeometry.

template<size_t SPD>
void Triangle< SPD >::dMap ( const double *  X,
double *  DY,
double &  Jac 
) const [inline, virtual]

Derivative of map from parametric to real configuration.

Parameters:
X parametric coordinates.
Jac returns absolute value of the Jacobian of the map.
DY returns derivative of the map. Here DY[a*getEmbeddingDimension()+i] contains the derivative in the a-th direction of the i-th coordinate.

Implements ElementGeometry.

template<size_t SPD>
const size_t Triangle< SPD >::getEmbeddingDimension (  )  const [inline, virtual]

Number of dimensions in the real configuration.

Implements ElementGeometry.

template<size_t SPD>
Segment< SPD > * Triangle< SPD >::getFaceGeometry ( size_t  e  )  const [inline, virtual]

Creates and returns a new ElementGeometry object corresponding to face "e" in the polytope.

The object has to be destroyed with delete by the recipient.

Parameters:
e face number, starting from 0

Returns a null pointer if "e" is out of range

Implements ElementGeometry.

template<size_t SPD>
const double Triangle< SPD >::getInRadius ( void   )  const [inline, virtual]

Computes the Inner radius of the ElementGeometry object.

This is defined as the radius of the largest sphere that can be fit inside the polytope.

Implements ElementGeometry.

template<size_t SPD>
size_t Triangle< SPD >::getNumFaces (  )  const [inline, virtual]

Number of faces the polytope has.

Implements ElementGeometry.

template<size_t SPD>
const size_t Triangle< SPD >::getNumVertices (  )  const [inline, virtual]
Returns:
number of vertices

Implements ElementGeometry.

template<size_t SPD>
const double Triangle< SPD >::getOutRadius ( void   )  const [inline, virtual]

Computes the Outer radius of the ElementGeometry object.

This is defined as the radius of the smallest sphere that contains the object.

Implements ElementGeometry.

template<size_t SPD>
const size_t Triangle< SPD >::getParametricDimension (  )  const [inline, virtual]

Number of dimensions in parametric configuration.

Implements ElementGeometry.

template<size_t SPD>
const std::string Triangle< SPD >::getPolytopeName (  )  const [inline, virtual]
Returns:
Name of type of polytope.

Implements ElementGeometry.

template<size_t SPD>
void Triangle< SPD >::map ( const double *  X,
double *  Y 
) const [inline, virtual]

map from parametric to real configuration

Parameters:
X parametric coordinates
Y returned real coordinates

Implements ElementGeometry.


Member Data Documentation

template<size_t SPD>
const double Triangle< SPD >::ParamCoord = {1,0,0,1,0,0} [inline, static, private]
template<size_t SPD>
const size_t Triangle< SPD >::SegmentNodes = {0,1,1,2,2,0} [inline, static, private]

The documentation for this class was generated from the following file:
Generated on Tue Aug 2 11:51:29 2011 for Galois by  doxygen 1.6.3