Diffpack Documentation


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

ElmT3n2D Class Reference

definition of 2D linear triangle finite element. More...

#include <ElmDefs.h>

Inheritance diagram for ElmT3n2D::

ElmDef HandleId ElmT3gn1bn2D ElmT3gn3bn2D ElmT3gn3bn2Du ElmT3gn3bn2Dv ElmT3gn4bn2D ElmT3gn9bn2Du ElmT3gn9bn2Dv List of all members.

Public Methods

 ElmT3n2D ()
 ~ElmT3n2D ()
virtual Ptv(real) setCentroid () const
virtual bool canBeInside (const Ptv(real) &globpt, const Mat(real) &coor) const
virtual bool isInside (const Ptv(real) &locpt) const
virtual bool isStrictlyInside (const Ptv(real) &locpt) const
virtual bool findLocPt (const Ptv(real) &globpt, Ptv(real) &locpt, int &niter, real &error, const Mat(real) &coor)
virtual NumItgDomain getSideShape (int) const
virtual void geomtFunc (Vec(real) &N, const Ptv(real) &loc_pt) const
virtual void basisFunc (Vec(real) &N, const Ptv(real) &loc_pt) const
virtual void dLocGeomtFunc (Mat(real) &dNloc, const Ptv(real) &loc_pt) const
virtual void dLocBasisFunc (Mat(real) &dNloc, const Ptv(real) &loc_pt) const
virtual void d2LocBasisFunc (ArrayGen(real) &d2Nloc, const Ptv(real) &loc_pt) const
virtual void drawElement (const Mat(real) &coor, GraphBasics &plotter, int resolution=1) const
virtual void drawSide (int side, const Mat(real) &coor, GraphBasics &plotter, int resolution=1) const
virtual int getNoNodesOnEdge () const
virtual Ptv(real) getVertexPt2DGrid (int i, int j) const
virtual Ptv(real) getCenterPt2DGrid (int i, int j, RectanglePartition ind) const
virtual Ptv(real) getVertexPt2DGrid (int, int, int) const
virtual Ptv(real) getCenterPt2DGrid (int, int, RectanglePartition, int) const
virtual void fillNodePath (MatSimplest(int) &nodes, bool vertices_only)

Static Public Methods

void shape (Vec(real) &N, const Ptv(real) &loc_pt)
void dshape (Mat(real) &dNloc, const Ptv(real) &loc_pt)
void calcCoeffInGlobFunc (ArrayGen(real) &coeff, real &volume, const Mat(real) &elmcoor)
void edgeLengthAndNormalVec (int side, real &length, Ptv(real) &normal_vector, const Mat(real) &elmcoor)
void geomtFunc (Vec(real) &N, const Ptv(real) &glob_pt, const Mat(real) &coor)
void basisFunc (Vec(real) &N, const Ptv(real) &glob_pt, const Mat(real) &coor)
void dGlobGeomtFunc (Mat(real) &dHglob, const Ptv(real) &glob_pt, const Mat(real) &coor)
void dGlobBasisFunc (Mat(real) &dHglob, const Ptv(real) &glob_pt, const Mat(real) &coor)
void setUpNodeCoor (MatSimple(real) &geomt_coor_)
void setUpNodesOnSides (MatSimple(int) &geomt_nodes_sides_)

Detailed Description

definition of 2D linear triangle finite element.

NAME: ElmT3n2D - definition of 2D linear triangle finite element

DESCRIPTION:

The class is derived from class "ElmDef" and implements the standard two dimensional 3 node linear triangle element with nodes at the corners.

Most of the operations on this element type are defined through virtual functions or member functions of the base class "ElmDef".


Constructor & Destructor Documentation

ElmT3n2D::ElmT3n2D ( )
 

The only constructor performs all the initialization.

ElmT3n2D::~ElmT3n2D ( ) [inline]
 


Member Function Documentation

void ElmT3n2D::basisFunc ( Vec(real) & N,
const Ptv(real) & glob_pt,
const Mat(real) & coor ) [inline, static]
 

void ElmT3n2D::basisFunc ( Vec(real) & N,
const Ptv(real) & loc_pt ) const [inline, virtual]
 

calculates the basis (trial) functions over the element. In other words, the routine computes the interpolation functions for functions defined over the element. Functions entering differential equations etc should be interpolated according to these basis functions. The return array "N" can be empty (not ok) at input, the "basisFunc" will redimension the array properly. The length of "N" equals the number of basis function nodes in the element. For isoparametric elements "basisFunc" and "geomtFunc" are identical. However, for mixed finite elements, one may have a bilinear geometry function (four nodes) and, e.g., a constant basis function. The basis function has then only one node (for example in the centroid of the element) and the length of "N" will be 1. Confer subclasses and the FAQ for information on conventions regarding basis function nodes and the ordering. It should be mentioned that class "BasisFuncGrid" is used to assign basis nodes to a grid (class "GridFE" is meant to contain the geometry of the grid, including geometry nodes).

Reimplemented from ElmDef.

Reimplemented in ElmT3gn1bn2D, ElmT3gn3bn2Du, ElmT3gn3bn2Dv, ElmT3gn4bn2D, ElmT3gn9bn2Du, ElmT3gn9bn2Dv, and ElmT3gn3bn2D.

static void ElmT3n2D::calcCoeffInGlobFunc ( ArrayGen(real) & coeff,
real & volume,
const Mat(real) & elmcoor ) [static]
 

computes the coefficients in the linear expression for the basis functions in global coordinates. That is, `\[` N`_`i = a`_{`0i`}` + `\`sum`_{`r=1`}^`d a`_{`ri`}`x`_`i`\]` The "coeff" variable contains the array `$` a`_{`ri`}` `$`. The "volume" argument is at return equal to the area of the element. With "coeff", "volume" and an integration formula for integrals of `$` N`_`i`^`aN`_`j`^`bN`_`k`^`c `$` over a triangle, it is easy to carry out analytical integration over "ElmT3n2D" elements.

bool ElmT3n2D::canBeInside ( const Ptv(real) & globpt,
const Mat(real) & coor ) const [virtual]
 

returns a true value if a point in the global (physical) coordinate system can be inside the element. The algorithm for detecting whether the point is inside or outside is only approximative. To achieve an exact algorithm, one can use "findLocPt" and then test the local point by using the function "isInside".

Reimplemented from ElmDef.

void ElmT3n2D::d2LocBasisFunc ( ArrayGen(real) & d2Nloc,
const Ptv(real) & loc_pt ) const [virtual]
 

the second order derivatives in the local element coordinates of the functions defined by "basisFunc".

Reimplemented from ElmDef.

Reimplemented in ElmT3gn1bn2D, ElmT3gn3bn2Du, ElmT3gn3bn2Dv, ElmT3gn4bn2D, ElmT3gn9bn2Du, ElmT3gn9bn2Dv, and ElmT3gn3bn2D.

void ElmT3n2D::dGlobBasisFunc ( Mat(real) & dHglob,
const Ptv(real) & glob_pt,
const Mat(real) & coor ) [inline, static]
 

void ElmT3n2D::dGlobGeomtFunc ( Mat(real) & dHglob,
const Ptv(real) & glob_pt,
const Mat(real) & coor ) [static]
 

void ElmT3n2D::dLocBasisFunc ( Mat(real) & dNloc,
const Ptv(real) & loc_pt ) const [inline, virtual]
 

the derivatives in the local element coordinates of the functions defined by "basisFunc." As for the "geomtFunc" and "basisFunc" functions the return array can be empty or have wrong dimension at input. The function will redimension the array properly.

Reimplemented from ElmDef.

Reimplemented in ElmT3gn1bn2D, ElmT3gn3bn2Du, ElmT3gn3bn2Dv, ElmT3gn4bn2D, ElmT3gn9bn2Du, ElmT3gn9bn2Dv, and ElmT3gn3bn2D.

void ElmT3n2D::dLocGeomtFunc ( Mat(real) & dNloc,
const Ptv(real) & loc_pt ) const [virtual]
 

the derivatives in the local element coordinates of the functions defined by "geomtFunc." As for the "geomtFunc" and "basisFunc" functions the return array can be empty or have wrong dimension at input. The function will redimension the array properly.

Reimplemented from ElmDef.

void ElmT3n2D::drawElement ( const Mat(real) & coor,
GraphBasics & plotter,
int resolution = 1 ) const [virtual]
 

function for drawing an element in the global, physical coordinate system. The drawing consists of geometric primitives (line segments) in the "GraphBasics" format. Note that this function does not flush or close the "GraphBasics" file so the physical file may be incomplete after a call to this function. An explicit call to "GraphBasics close" will complete the file and make it ready for reading. The function is used in drawing routines in class "DrawFE".

Reimplemented from ElmDef.

void ElmT3n2D::drawSide ( int side,
const Mat(real) & coor,
GraphBasics & plotter,
int resolution = 1 ) const [virtual]
 

function for drawing a specified side of an element in the global, physical coordinate system. See "drawElement" for comments.

Reimplemented from ElmDef.

static void ElmT3n2D::dshape ( Mat(real) & dNloc,
const Ptv(real) & loc_pt ) [static]
 

evaluates the first derivatives of the basis functions for this element type, given an evaluation point. Primarily for internal use.

static void ElmT3n2D::edgeLengthAndNormalVec ( int side,
real & length,
Ptv(real) & normal_vector,
const Mat(real) & elmcoor ) [static]
 

computes the length of the indicated element side, as well as the outwards unit normal vector for that side. The function needs the element coordinates as input in a "Mat" object with local node numbes as row index and spatial directions as column index.

void ElmT3n2D::fillNodePath ( MatSimplest(int) & nodes,
bool vertices_only ) [virtual]
 

returns an array "nodes" such that side number "s" of the element passes through the nodes "nodes(s,j)" where "j" runs from 1 to the number of nodes on the given side. In case of varying number of nodes per side, the rest of the array row is padded with zeros. The delivered data will deal with local side number "i" in row "i" of "nodes". The orientation of each side is coordinated such that the array describes a counterclockwise traversal of the element boundary. If the flag "vertices_only" is "true", only vertex nodes are returned. Otherwise, non-vertex nodes located on a side (such as midnodes) will also contribute.

Reimplemented from ElmDef.

bool ElmT3n2D::findLocPt ( const Ptv(real) & globpt,
Ptv(real) & locpt,
int & niter,
real & error,
const Mat(real) & coor ) [virtual]
 

given a global point, the function solves the inverse mapping equations to find the corresponding local coordinates. Newton-Raphson iteration is used for the solution. The function is mainly used in the "findElmAndLocPt" functions in class "GridFE".

Reimplemented from ElmDef.

void ElmT3n2D::geomtFunc ( Vec(real) & N,
const Ptv(real) & glob_pt,
const Mat(real) & coor ) [static]
 

void ElmT3n2D::geomtFunc ( Vec(real) & N,
const Ptv(real) & loc_pt ) const [virtual]
 

calculates the geometry functions on the element (see the description above). These functions are used for the isoparametric mapping associated with the element (these functions determine the geometric shape of the element in the global, physical coordinate system). Recall that the geometry functions are defined with respect to the local element coordinate system and the local node numbering of the element. The return array "N" can be empty (not ok) at input; the "geomtFunc" will redimension the array properly. The "N" array contains the values of the geometry functions at the evaluation point. The length of the "N" array equals the number of (geometry) nodes in the element, and the ordering of the entries in "N" follow the ordering of the local nodes

Reimplemented from ElmDef.

Ptv(real) ElmT3n2D::getCenterPt2DGrid ( int i,
int j,
RectanglePartition ind,
int side ) const [inline, virtual]
 

See documentation of one of the overloaded functions.

Reimplemented from ElmDef.

Ptv(real) ElmT3n2D::getCenterPt2DGrid ( int i,
int j,
RectanglePartition ind ) const [inline, virtual]
 

as "getVertexPt2DGrid" but the center point of the box or triangle with index (i,j) is returned. The lower, leftmost box has index (1,1). If triangles are desired, the user must indicate whether the center of the lower or the upper triangle is desired. The "enum" "RectanglePartition" takes the names "LOWER", "UPPER" or "RECTANGLE" indicating lower triangle, upper triangle or four-sided box, respectively.

Reimplemented from ElmDef.

int ElmT3n2D::getNoNodesOnEdge ( ) const [inline, virtual]
 

returns the number of nodes on an edge (an edge is the intersection between two adjacent sides in a 3D element). The function has no meaning for 1D and 2D elements.

Reimplemented from ElmDef.

NumItgDomain ElmT3n2D::getSideShape ( int side ) const [inline, virtual]
 

returns the shape of the sides of the element. This is the counterpart to "getDomainShape" for example for numerical integration over the sides.

Reimplemented from ElmDef.

Ptv(real) ElmT3n2D::getVertexPt2DGrid ( int i,
int j,
int side ) const [inline, virtual]
 

See documentation of one of the overloaded functions.

Reimplemented from ElmDef.

Ptv(real) ElmT3n2D::getVertexPt2DGrid ( int i,
int j ) const [inline, virtual]
 

returns a "Ptv(real)" containing the coordinates of a vertex point (i,j) in the 2D grid over a 2D element or over a side in a 3D element (see function "setResolution2DGrid)." A vertex point is a corner of the boxes/triangles of the 2D grid. The lower, leftmost vertex has coordinates (1,1).

Reimplemented from ElmDef.

bool ElmT3n2D::isInside ( const Ptv(real) & locpt ) const [virtual]
 

returns a true value if the local coordinates of a point implies that the point is inside the element. The function is mainly used to check if "findLocPt" has found a point that is really inside the element.

Reimplemented from ElmDef.

bool ElmT3n2D::isStrictlyInside ( const Ptv(real) & locpt ) const [virtual]
 

returns a true value if the local coordinates of a point implies that the point is -strictly- inside the element, i.e. inside but not on the boundary.

Reimplemented from ElmDef.

Ptv(real) ElmT3n2D::setCentroid ( ) const [virtual]
 

Reimplemented from ElmDef.

static void ElmT3n2D::setUpNodeCoor ( MatSimple(real) & geomt_coor_ ) [static]
 

load the "MatSimple" object with coordinate values for each node in the element. The row index refers to local node numbering, and the column index refers to the spatial direction.

static void ElmT3n2D::setUpNodesOnSides ( MatSimple(int) & geomt_nodes_sides_ ) [static]
 

similar to the "setUpNodeCoor", this function fills a "MatSimple" object with node numbers for each side. The row index refers to side numbers, and the column index refers to local node numbers.

static void ElmT3n2D::shape ( Vec(real) & N,
const Ptv(real) & loc_pt ) [static]
 

evaluates the basis functions for this element type, given an evaluation point. Primarily for internal use (used by the virtual functions "geomtfunc" and "basisfunc".


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