Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

ToolsElmT3n2D Class Reference

finite element for ElmT3n2D for efficient programming. More...

#include <ElmTtools.h>

List of all members.

Public Methods

 ToolsElmT3n2D ()
 ToolsElmT3n2D (GridFE *grid)
 ~ToolsElmT3n2D ()
void attach (GridFE *grid)
void refill (int elm_no)
bool checkGrid ()
bool checkGrid (int e)
GridFEgrid ()
int getElmNo ()
real x1 ()
real y1 ()
real x2 ()
real y2 ()
real x3 ()
real y3 ()
real det ()
real dN1x ()
real dN1y ()
real dN2x ()
real dN2y ()
real dN3x ()
real dN3y ()
int n1 ()
int n2 ()
int n3 ()
real area ()
real maxAngle ()
real minAngle ()
real angle (int i)
real angle1 ()
real angle2 ()
real angle3 ()
real inRadius ()
real circumRadius ()
Ptv(real) inCenter ()
void inCenter (real &cx, real &cy)
Ptv(real) circumCenter ()
void circumCenter (real &cx, real &cy)
Ptv(real) centroid ()
void centroid (real &cx, real &cy)
real centroidx ()
real centroidy ()
real midpt1x ()
real midpt1y ()
real midpt2x ()
real midpt2y ()
real midpt3x ()
real midpt3y ()
Ptv(real) normal (int i)
Ptv(real) normal1 ()
Ptv(real) normal2 ()
Ptv(real) normal3 ()
void normal1 (real &nx, real &ny)
void normal2 (real &nx, real &ny)
void normal3 (real &nx, real &ny)
real h ()
real maxLength ()
real minLength ()
real edgeLength (int i)
real l1 ()
real l2 ()
real l3 ()
real l1sq ()
real l2sq ()
real l3sq ()
real circumference ()
real xmax ()
real xmin ()
real ymax ()
real ymin ()
real a11 ()
real a12 ()
real a21 ()
real a13 ()
real a31 ()
real a22 ()
real a23 ()
real a32 ()
real a33 ()
Ptv(real) localCoordinates (real x, real y)
real barycentric1 (real x, real y)
real barycentric2 (real x, real y)
real barycentric3 (real x, real y)
void barycentric (real x, real y, NUMT &phi1, NUMT &phi2, NUMT &phi3)
bool inSide (real x, real y)
bool outSide (real x, real y)
bool onTriangle (real x, real y)
real qualityMeasure (int i)
real etahH ()
real etaincirc ()
real etaMaxAngle ()
real etapltmg ()
void testComputations ()
bool ok () const
void print (Os os) const
bool areQuadNodesAtMidPoints ()
void quadShape (real r, real s, real t, real &psi1, real &psi2, real &psi3, real &psi4, real &psi5, real &psi6)
void dNq123 (real r, real s, real t, real &psi1x, real &psi1y, real &psi2x, real &psi2y, real &psi3x, real &psi3y)
void dNq456 (real r, real s, real t, real &psi4x, real &psi4y, real &psi5x, real &psi5y, real &psi6x, real &psi6y)
 COPY_CONSTRUCTOR (ToolsElmT3n2D)
 ASSIGNMENT_OPERATOR (ToolsElmT3n2D)


Detailed Description

finite element for ElmT3n2D for efficient programming.

NAME: ToolsElmT3n2D - finite element for ElmT3n2D for efficient programming

DESCRIPTION:

The purpose of this class is to collect all the computations involving the geometry of a triangle in one place. A major consideration is efficiency. This motivates the use of inlining where possible, and in some cases a delibarete omission of functionality that would be too much of a bootleneck.

Applications of this class include programming of finite element assembly, mesh generation, interpolation and more. The class is mainly meant for elements of type "ElmT3n2D". However, if there are nodes at midpoints of edges it may also be used for "ElmT6n2D" computations.


Constructor & Destructor Documentation

ToolsElmT3n2D::ToolsElmT3n2D ( )
 

There is one empty constructor and one where the grid can be attached. The function "checkGrid" is used to examine if all elements of the attached grid are of correct type. Prior to using the member functions in this class, data for the element in question must be loaded by a call to "refill".

ToolsElmT3n2D::ToolsElmT3n2D ( GridFE * grid )
 

See documentation of one of the overloaded constructor.

ToolsElmT3n2D::~ToolsElmT3n2D ( )
 


Member Function Documentation

ToolsElmT3n2D::ASSIGNMENT_OPERATOR ( ToolsElmT3n2D )
 

ToolsElmT3n2D::COPY_CONSTRUCTOR ( ToolsElmT3n2D )
 

real ToolsElmT3n2D::a11 ( ) [inline]
 

returns the product of gradients "a11"=("dN1","dN1"), where (,) is the discrete scalar product. In general, the function "a"ij (for i,j=1,2,3) computes the product "a"ij = ("dN"i,"dN"j). These products are often occurring in finite element assembly.

real ToolsElmT3n2D::a12 ( ) [inline]
 

real ToolsElmT3n2D::a13 ( ) [inline]
 

real ToolsElmT3n2D::a21 ( ) [inline]
 

real ToolsElmT3n2D::a22 ( ) [inline]
 

real ToolsElmT3n2D::a23 ( ) [inline]
 

real ToolsElmT3n2D::a31 ( ) [inline]
 

real ToolsElmT3n2D::a32 ( ) [inline]
 

real ToolsElmT3n2D::a33 ( ) [inline]
 

real ToolsElmT3n2D::angle ( int i )
 

returns the value of angle number "i" for the loaded element (measured in radians).

real ToolsElmT3n2D::angle1 ( ) [inline]
 

returns the value of angle number 1 for the loaded element(measured in radians). The functions "angle2" and "angle3" return the values for the angles 2 and 3.

real ToolsElmT3n2D::angle2 ( ) [inline]
 

real ToolsElmT3n2D::angle3 ( ) [inline]
 

bool ToolsElmT3n2D::areQuadNodesAtMidPoints ( )
 

returns true if the extra nodes in the "ElmT6n2D" element are located at the midpoints of the edges, otherwise returning false. (This function is intended for "ElmT6n2D" elements).

real ToolsElmT3n2D::area ( ) [inline]
 

returns the area of the triangle.

void ToolsElmT3n2D::attach ( GridFE * grid )
 

void ToolsElmT3n2D::barycentric ( real x,
real y,
NUMT & phi1,
NUMT & phi2,
NUMT & phi3 ) [inline]
 

returns the barycentric coordinates for a given point, this is the same as the value of the basis functions at the point.

real ToolsElmT3n2D::barycentric1 ( real x,
real y ) [inline]
 

real ToolsElmT3n2D::barycentric2 ( real x,
real y ) [inline]
 

real ToolsElmT3n2D::barycentric3 ( real x,
real y ) [inline]
 

void ToolsElmT3n2D::centroid ( real & cx,
real & cy ) [inline]
 

See documentation of one of the overloaded functions.

Ptv(real) ToolsElmT3n2D::centroid ( ) [inline]
 

returns the centroid of the triangle (the gravity point). There is one version using a "Ptv" object, as well as one using scalars. The functions "centroidx" and "centroidy" return the "x" and "y"-coordinates of the centroid, respectively.

real ToolsElmT3n2D::centroidx ( ) [inline]
 

real ToolsElmT3n2D::centroidy ( ) [inline]
 

bool ToolsElmT3n2D::checkGrid ( int e )
 

See documentation of one of the overloaded functions.

bool ToolsElmT3n2D::checkGrid ( )
 

checks that (a) a grid is attached, and (b) the grid contains only "ElmT3n2D" elements.

void ToolsElmT3n2D::circumCenter ( real & cx,
real & cy ) [inline]
 

See documentation of one of the overloaded functions.

Ptv(real) ToolsElmT3n2D::circumCenter ( ) [inline]
 

returns the center of the circumscribed circle. There is one version using a "Ptv" object, as well as one using scalars.

real ToolsElmT3n2D::circumRadius ( ) [inline]
 

returns the radius of the circumscribed circle.

real ToolsElmT3n2D::circumference ( ) [inline]
 

real ToolsElmT3n2D::dN1x ( ) [inline]
 

returns the value in "x"-direction for the gradient of the linear shape function "N1" associated with node 1. Corresponding treatment of nodes 2 and 3 is delivered by the functions "dN2x" and "dN3x".

real ToolsElmT3n2D::dN1y ( ) [inline]
 

returns the value in "y"-direction for the gradient of the linear shape function "N1" associated with node 1. Corresponding treatment of nodes 2 and 3 is delivered by the functions "dN2y" and "dN3y".

real ToolsElmT3n2D::dN2x ( ) [inline]
 

real ToolsElmT3n2D::dN2y ( ) [inline]
 

real ToolsElmT3n2D::dN3x ( ) [inline]
 

real ToolsElmT3n2D::dN3y ( ) [inline]
 

void ToolsElmT3n2D::dNq123 ( real r,
real s,
real t,
real & psi1x,
real & psi1y,
real & psi2x,
real & psi2y,
real & psi3x,
real & psi3y ) [inline]
 

computes and returns the values of the three gradient functions associated with nodes 1,2,3 at a given barycentric position. (This function is intended for "ElmT6n2D" elements, and requires the extra nodes to located at the midpoints of the edges).

void ToolsElmT3n2D::dNq456 ( real r,
real s,
real t,
real & psi4x,
real & psi4y,
real & psi5x,
real & psi5y,
real & psi6x,
real & psi6y ) [inline]
 

computes and returns the values of the three extra gradient functions associated with nodes 4,5,6 at a given barycentric position. (This function is intended for "ElmT6n2D" elements, and requires the extra nodes to located at the midpoints of the edges).

real ToolsElmT3n2D::det ( ) [inline]
 

returns the Jacobi determinant (twice the area of triangle).

real ToolsElmT3n2D::edgeLength ( int i )
 

returns the length of edge number "i".

real ToolsElmT3n2D::etaMaxAngle ( ) [inline]
 

returns a measure based on the maximum angle.

real ToolsElmT3n2D::etahH ( ) [inline]
 

returns the ratio between the small length scale "h" and the diameter.

real ToolsElmT3n2D::etaincirc ( ) [inline]
 

returns the ratio between the radii of inscribed and circumscribed circles.

real ToolsElmT3n2D::etapltmg ( ) [inline]
 

returns the quality measure used in the software package "PLTMG".

int ToolsElmT3n2D::getElmNo ( ) [inline]
 

returns the current element number.

GridFE & ToolsElmT3n2D::grid ( ) [inline]
 

returns access to the grid from which the element is read.

real ToolsElmT3n2D::h ( ) [inline]
 

returns small length scale of the triangle defined as "h" = 2*"area"/"diameter", where "diameter" is the longest edge of the triangle. A geometrical interpretation is that "h" is the height of the normal to the longest edge.

void ToolsElmT3n2D::inCenter ( real & cx,
real & cy ) [inline]
 

See documentation of one of the overloaded functions.

Ptv(real) ToolsElmT3n2D::inCenter ( ) [inline]
 

returns the center of the inscribed circle. There is one version using a "Ptv" object, as well as one using scalars.

real ToolsElmT3n2D::inRadius ( ) [inline]
 

returns the radius of the inscribed circle.

bool ToolsElmT3n2D::inSide ( real x,
real y )
 

returns true if the point is inside the triangle, otherwise it returns false (not yet implemented).

real ToolsElmT3n2D::l1 ( ) [inline]
 

See documentation of one of the overloaded functions.

real ToolsElmT3n2D::l1sq ( ) [inline]
 

See documentation of one of the overloaded functions.

real ToolsElmT3n2D::l2 ( ) [inline]
 

real ToolsElmT3n2D::l2sq ( ) [inline]
 

real ToolsElmT3n2D::l3 ( ) [inline]
 

real ToolsElmT3n2D::l3sq ( ) [inline]
 

Ptv(real) ToolsElmT3n2D::localCoordinates ( real x,
real y ) [inline]
 

given a point, compute its local coordinates.

real ToolsElmT3n2D::maxAngle ( ) [inline]
 

returns the maximum angle for the loaded element (measured in radians). Notice that if edge 1 is the longest edge then angle3 is the largest angle. See the figure above for the numbering convention.

real ToolsElmT3n2D::maxLength ( ) [inline]
 

returns the length of the longest edge.

real ToolsElmT3n2D::midpt1x ( ) [inline]
 

returns the "x"-value of the midpoint on edge number 1. See the figure above for numbering convention. The functions "midpt2x" and "midpt3x" work similarly for egdes 2 and 3.

real ToolsElmT3n2D::midpt1y ( ) [inline]
 

returns the "y"-value of the midpoint on edge number 1. See the figure above for numbering convention. The functions "midpt2y" and "midpt3y" work similarly for egdes 2 and 3.

real ToolsElmT3n2D::midpt2x ( ) [inline]
 

real ToolsElmT3n2D::midpt2y ( ) [inline]
 

real ToolsElmT3n2D::midpt3x ( ) [inline]
 

real ToolsElmT3n2D::midpt3y ( ) [inline]
 

real ToolsElmT3n2D::minAngle ( ) [inline]
 

returns the minimum angle for the loaded element (measured in radians).

real ToolsElmT3n2D::minLength ( ) [inline]
 

returns the length of the shortest edge.

int ToolsElmT3n2D::n1 ( ) [inline]
 

returns the global grid node number for the first vertex (node 1). The functions "n2" and "n3" treat nodes 2 and 3 correspondingly.

int ToolsElmT3n2D::n2 ( ) [inline]
 

int ToolsElmT3n2D::n3 ( ) [inline]
 

Ptv(real) ToolsElmT3n2D::normal ( int i )
 

returns the outer unit normal for edge number "i".

void ToolsElmT3n2D::normal1 ( real & nx,
real & ny ) [inline]
 

See documentation of one of the overloaded functions.

Ptv(real) ToolsElmT3n2D::normal1 ( ) [inline]
 

returns the outer unit normal for edge number 1. There is one version using a "Ptv" object, as well as one using scalars. The functions "normal2" and "normal3" work similarly for edges 2 and 3.

void ToolsElmT3n2D::normal2 ( real & nx,
real & ny ) [inline]
 

Ptv(real) ToolsElmT3n2D::normal2 ( ) [inline]
 

void ToolsElmT3n2D::normal3 ( real & nx,
real & ny ) [inline]
 

Ptv(real) ToolsElmT3n2D::normal3 ( ) [inline]
 

bool ToolsElmT3n2D::ok ( ) const
 

returns true if a grid attached, otherwise it returns false.

bool ToolsElmT3n2D::onTriangle ( real x,
real y )
 

returns true if the point is on the triangle boundary, otherwise it returns false (not yet implemented).

bool ToolsElmT3n2D::outSide ( real x,
real y )
 

returns true if the point outside the triangle, otherwise it returns false (not yet implemented).

void ToolsElmT3n2D::print ( Os os ) const
 

not yet implemented.

void ToolsElmT3n2D::quadShape ( real r,
real s,
real t,
real & psi1,
real & psi2,
real & psi3,
real & psi4,
real & psi5,
real & psi6 ) [inline]
 

computes and returns the values of the six basis functions at a given barycentric position (This function is intended for "ElmT6n2D" elements, and requires the extra nodes to located at the midpoints of the edges).

real ToolsElmT3n2D::qualityMeasure ( int i )
 

returns some some quality measures for triangles. The result is normalized such that the output is 1.0 for an equilateral triangle and tends towards 0.0 for a triangle of degenerate shape. The argument "i" can be 1 (see "etahH"), 2 (see "etaincirc"), 3 (see "etaMaxAngle"), or 4 (see "etapltmg").

void ToolsElmT3n2D::refill ( int elm_no )
 

loads the data for triangle number "elm_no" from the grid and compute gradients.

void ToolsElmT3n2D::testComputations ( )
 

test that the implementation is correct by writing a report on the properties of the loaded element.

real ToolsElmT3n2D::x1 ( ) [inline]
 

returns the "x"-coordinate of the first triangle node. The functions "x2" and "x3" do the same thing for the two other nodes. (Recall the counter-clockwise direction).

real ToolsElmT3n2D::x2 ( ) [inline]
 

real ToolsElmT3n2D::x3 ( ) [inline]
 

real ToolsElmT3n2D::xmax ( ) [inline]
 

real ToolsElmT3n2D::xmin ( ) [inline]
 

real ToolsElmT3n2D::y1 ( ) [inline]
 

returns the "y"-coordinate of the first triangle node. The functions "y2" and "y3" do the same thing for the two other nodes. (Recall the counter-clockwise direction).

real ToolsElmT3n2D::y2 ( ) [inline]
 

real ToolsElmT3n2D::y3 ( ) [inline]
 

real ToolsElmT3n2D::ymax ( ) [inline]
 

real ToolsElmT3n2D::ymin ( ) [inline]
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.