NAME
ElmTensorProd - definition of tensor product finite elements
(hypercubes)
INCLUDE
include "ElmDefs.h"
SYNTAX
class ElmTensorProd : public ElmDef
{
protected:
~ElmTensorProd ();
public:
ElmTensorProd (int nsd, int order);
virtual NumItgDomain getSideShape (int /*side*/) const { return BOX; }
virtual void geomtFunc (Vec(real)& N, const Ptv(real)& loc_pt) const;
virtual void basisFunc (Vec(real)& N, const Ptv(real)& loc_pt) const
{ geomtFunc (N, loc_pt); }
virtual void dLocGeomtFunc (Mat(real)& dNloc, const Ptv(real)& loc_pt) const;
virtual void dLocBasisFunc (Mat(real)& dNloc, const Ptv(real)& loc_pt) const
{ dLocGeomtFunc (dNloc, loc_pt); }
virtual void d2LocBasisFunc(ArrayGen(real)& d2Nloc, const Ptv(real)& loc_pt)
const;
virtual bool findLocPt // find local pt corresponding to global pt
(
const Ptv(real)& globpt, // global pt
Ptv(real)& locpt, // local pt (output)
int& niter, // no of Newton iterations in algorithm
real& error, // error from the Newton iteration
const Mat(real)& coor // global coordinates of the nodes
) { return ElmDef::findLocPt(globpt,locpt,niter,error,coor); }
virtual void drawElement
(const Mat(real)& coor, // global, nodal coordinates
GraphBasics& plotter, // graphics: data, functions, dvi-code
int resolution = 1 // no of line segments along an edge
)const
{ drawAllSides (coor, plotter, resolution); }
virtual void drawSide
( int side, // side number
const Mat(real)& coor, // global, nodal coordinates
GraphBasics& plotter, // graphics: data, functions, dvi-code
int resolution = 1 // no of line segments along an edge
)const
{
if (n1D == 2) resolution = 1;
drawBoxElmSide (side, coor, plotter, resolution);
}
virtual void drawEdge
( int side1, // first side
int side2, // second side
const Mat(real)& coor, // global, nodal coordinates
GraphBasics& plotter, // graphics: data, functions, dvi-code
int resolution = 1 // no of line segments along an edge
)const
{ if (n1D == 2) resolution = 1;
if (nsd == 3) drawBoxElmEdge (side1, side2, coor, plotter, resolution);
else errorFP("ElmTensorProd::drawEdge","undefined function in 2D");
}
virtual void calcMidSideNodes (Mat(real)& coor);
virtual int getNoNodesOnEdge () const { return n1D; }
static void setUpNodesOnSides (int n1D, int nsd, MatSimple(int)& side_nodes);
static void setUpNodeCoor (int n1D, int nsd, MatSimple(real)& loc_coor);
protected:
int n1D; // no of nodes in each space direction, reflects the element order
public:
static void basis1D (Vec(real)& Ni_1D, int n1D, real ksi);
static void Dbasis1D (Vec(real)& dNi_1D, int n1D, real ksi);
static void D2basis1D (Vec(real)& d2Ni_1D, int n1D, real ksi);
CLASS_INFO
};
KEYWORDS
finite element, tensor product element, Lagrange element family
DESCRIPTION
The class is derived from class ElmDef and defines tensor product
elements in their local element coordinate system. Elements in an
arbitrary number of space dimensions are provided. In the present
implementation elements of first and second order are included,
but extensions are possible. That is, this class is suited for
linear (1D), quadratic (1D), bilinear (2D), biquadratic (2D),
trilinear (3D) and triquadratic (3D) elements and their corre
sponding higher dimensional (nD) generalizations.
Most of the operations on this element type are defined through
virtual functions or member functions of the base class ElmDef.
See the documentation of class ElmDef for further explanation of
the interface.
In the ElmDef hierarchy there are specializations of ElmTensor
Prod with more direct names such as ElmB9n2D. In the present
implementation all these specializations inherit their function
ality from class ElmTensorProd such that from a computational
point of view all these classes are equivalent. However, for some
users will prefer to work with concrete names, such as ElmB4n2D,
that reflects both the element shape, the number of nodes and the
space dimension. Implementations such as ElmB4n2D are special
ized for this element and the evaluation of the geometry and
basis functions is more efficient than for ElmTensorProd1. It is
recommended to consult the ElmDef.cpp file and the geomtFunc
functions to check which of the specialized element classes (like
ElmB4n2D, ElmB8n3D etc) that have optimized implementations of
the geometry and basis functions.
CONSTRUCTORS AND INITIALIZATION
The only constructor performs all the initialization.
MEMBER FUNCTIONS
Two STATIC members are explained here (see base class for the
other member functions):
elmSideArea - calculates area of element side
normalVector - finds normalvector to a side
SEE ALSO
class ElmDef, class ElmTensorProd1, class ElmTensorProd2
DEVELOPED BY
SINTEF Applied Mathematics, Oslo, Norway, and University of Oslo,
Dept. of Mathematics, Norway
AUTHOR
Hans Petter Langtangen, SINTEF/UiO