#include <ElmDef.h>
Inheritance diagram for ElmDef::

Public Methods | |
| virtual | ~ElmDef () |
| int | getNoSpaceDim () const |
| int | getNoGeomtFunc () const |
| int | getNoBasisFunc () const |
| int | getNoBasisNodes () const |
| int | getNoSides () const |
| Ptv(int) | getOrder () const |
| NumItgDomain | getDomainShape () const |
| bool | isoparametric () const |
| ElementType | getElementType () const |
| virtual NumItgDomain | getSideShape (int side) const=0 |
| virtual void | geomtFunc (Vec(real) &N, const Ptv(real) &loc_pt) const=0 |
| virtual void | basisFunc (Vec(real) &N, const Ptv(real) &loc_pt) const=0 |
| virtual void | dLocGeomtFunc (Mat(real) &dNloc, const Ptv(real) &loc_pt) const=0 |
| virtual void | dLocBasisFunc (Mat(real) &dNloc, const Ptv(real) &loc_pt) const=0 |
| virtual void | d2LocBasisFunc (ArrayGen(real) &d2Nloc, const Ptv(real) &loc_pt) const |
| void | mapping (Ptv(real) &glob_pt, const Ptv(real) &loc_pt, const Mat(real) &coor) const |
| void | mapping (Ptv(real) &glob_pt, const Mat(real) &coor, const Vec(real) &N) const |
| Ptv(real) | mapping (const Ptv(real) &loc_pt, const Mat(real) &coor) const |
| void | consistencyCheck () |
| virtual bool | isInside (const Ptv(real) &locpt) const |
| virtual bool | isStrictlyInside (const Ptv(real) &locpt) const |
| virtual bool | canBeInside (const Ptv(real) &globpt, const Mat(real) &coor) const |
| bool | isOnElmBoundary (const Ptv(real) &locpt) const |
| bool | canBeInsideBox (const Ptv(real) &globpt, const Mat(real) &coor, bool curved) const |
| Ptv(real) | centroid () const |
| virtual bool | findLocPt (const Ptv(real) &globpt, Ptv(real) &locpt, int &niter, real &error, const Mat(real) &coor) |
| virtual void | fillNodePath (MatSimplest(int) &nodes, bool vertices_only) |
| virtual int | getNoGeomtNodesOnSide (int) const |
| virtual int | getNoBasisNodesOnSide (int) const |
| int | getNodeOnSide (int side, int local_node_on_side) const |
| int | getBasisNodeOnSide (int side, int local_node_on_side) const |
| virtual int | getNoDof4scalarFunction (int) const |
| void | getNodeOnSide (int side, VecSimple(int) &nodes) const |
| virtual int | getNoNodesOnEdge () const |
| virtual bool | applicationDepPrms () |
| virtual void | drawElement (const Mat(real) &coor, GraphBasics &plotter, int resolution=1) const=0 |
| virtual void | drawSide (int side, const Mat(real) &coor, GraphBasics &plotter, int resolution=1) const=0 |
| virtual void | drawEdge (int side1, int side2, const Mat(real) &coor, GraphBasics &plotter, int resolution=1) const |
| void | setResolution2DGrid (int nintervals) |
| 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 i, int j, int side) const |
| virtual Ptv(real) | getCenterPt2DGrid (int i, int j, RectanglePartition ind, int side) const |
| virtual void | calcMidSideNodes (Mat(real) &) |
| void | calcMidSideNodes (Mat(real) &coor, ElmDef *interpol_elm, const Mat(real) &coor_interpol_elm) |
| void | print (Os os) const |
| Ptv(real) | getLocalGeomtCoor (int local_node) const |
| Ptv(real) | getLocalBasisCoor (int local_node) const |
| virtual bool | basisFuncNodes (MatSimple(real) &loc_coor) |
Public Attributes | |
| int | ngno_on_a_side |
| int | nbno_on_a_side |
| bool | special_mapping |
| bool | value_node_rep |
| bool | corner_nodes |
Protected Methods | |
| ElmDef (int nne_geomt, int nne_basis, int nmodes, int nbf, int nsd, int nsides, int max_ngno_on_a_side, int max_nbno_on_a_side, const Ptv(int) &order, NumItgDomain domainshape, ElementType elmtype) | |
| ElmDef (int nne, int nsd, int nsides, int nno_on_a_side, int order, NumItgDomain domainshape, ElementType elmtype) | |
| virtual Ptv(real) | setCentroid () const |
| bool | checkNandPt (Vec(real) &N, const Ptv(real) &pt, bool geomt) const |
| bool | checkdNandPt (Mat(real) &dN, const Ptv(real) &pt, bool geomt) const |
| void | drawBoxElmEdge (int side1, int side2, const Mat(real) &coor, GraphBasics &plotter, int resolution=1) const |
| void | drawCurvedLine (int vc, const Ptv(real) &from, const Ptv(real) &to, const Mat(real) &coor, int resolution, GraphBasics &plotter) const |
| void | drawBoxElmSide (int side, const Mat(real) &coor, GraphBasics &plotter, int resolution) const |
| void | drawAllSides (const Mat(real) &coor, GraphBasics &plotter, int resolution) const |
| Ptv(real) | getPt2DGridSqr (double i, double j, int limit) const |
| Ptv(real) | getPt2DGridSqr (double i, double j, int limit, int side) const |
| Ptv(real) | getPt2DGridTri (double i, double j, int limit) const |
| Ptv(real) | getPt2DGridTri (double i, double j, int limit, int side) const |
| Ptv(real) | getCenterPt2DGridSqr (int i, int j, RectanglePartition ind) const |
| Ptv(real) | getCenterPt2DGridSqr (int i, int j, RectanglePartition ind, int side) const |
| Ptv(real) | getCenterPt2DGridTri (int i, int j, RectanglePartition ind) const |
| Ptv(real) | getCenterPt2DGridTri (int i, int j, RectanglePartition ind, int side) const |
Protected Attributes | |
| int | nsd |
| int | nne_geomt |
| int | nne_basis |
| int | nmodes |
| int | nbf |
| int | nsides |
| Ptv(int) | order |
| bool | isoparametric_elm |
| NumItgDomain | domainshape |
| ElementType | elmtype |
| MatSimple(real) | geomt_coor |
| MatSimple(real) | basis_coor |
| Ptv(real) | loc_centroid |
| Vec(real) | workgeomt |
| Vec(real) | workbasis |
| MatSimple(int) | geomt_nodes_sides |
| MatSimple(int) | basis_nodes_sides |
| int | resol2Dgrid |
NAME: ElmDef - abstract base class for definition of finite elements (local system)
DESCRIPTION:
The class contains data structures and functions for describing a finite element in its local element coordinate system. Particular elements are implemented as derived classes of class "ElmDef". A programmer should normally not operate on element subclasses using an "ElmDef" handle (or pointer/reference). Instead the programmer should apply the "HandleElmDefs" handle which has additional features for easy updating the current element, given its name and the number of space dimensions.
Each finite element is of a particular type, for example bilinear element, triquadratic element and so on. In general the geometric shape of the element is determined by the mapping from a local coordinate system onto the physical coordinate system. The functions that are used in that mapping are here called element geometry functions. In addition to these functions one must specify the trial functions, that is, the basis functions that are used to approximate the unknown functions in the problem over the element. The basis and geometry functions may in principle be different (that is the case in mixed finite elements methods). However, in many cases they are identical and we then refer to the element as isoparametric.
Given a grid, it may be useful to approximate different unknowns using different basis functions over an element with fixed shape. For example, in fluid flow applications the elements may be quadrilaterals with biquadratic interpolation for velocities and bilinear for the pressure. In that case, the geometry functions are the standard biquadratic functions while the basis functions are bilinear (for pressure) and biquadratic functions (for velocities). Using "ElmDef" objects, the velocities would be isoparametric elements, while the pressure requires a special non-isoparametric element where the geometry functions are biquadratic and the basis functions are bilinear. Such elements can be found in the "ElmDef" hierarchy (see, e.g., "ElmB9gn4bn2D" for an example on the mentioned element for the pressure).
Objects in the "ElmDef" hierarchy are used several places in finite element algorithms (for example, in "FiniteElement" and "FieldFE"). The typical use is when, e.g., basis functions are required for a new element. One checks the element type in the grid, and sends the type (as a "String" or ElementType) to the "HandleElmDefs refill" function which then creates a subclass object in the "ElmDef" hierarchy.
|
|
This base class is initialized completely by its constructor (which is protected and only called from the subclass objects). Derived classes must in addition initialize the arrays "geomt_coor" and "basis_coor" containing the coordinates of the local geometry function nodes and the local basis function nodes (in the local element coordinate system). Similar arrays ("geomt_nodes_sides" and "basis_nodes_sides") containing the local node numbers that belong to the different sides of the element must also be initialized. This type of initialization is performed inside the constructor of the derived classes and should be of no concern for a user of already programmed classes. |
|
|
See documentation of one of the overloaded constructor. |
|
|
|
|
|
returns "true" if the "ElmDef" subclass object needs to communicate with the application (PDE) in order to get access to problem-dependent parameters. Otherwise it returns "false". |
|
|
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 in ElmTensorProd, ElmBH2n1D, ElmB8n2D, ElmB20n3D, ElmT3n2D, ElmT6n2D, ElmT4n3D, ElmT10n3D, ElmB2gn1bn1D, ElmB9gn4bn2D, ElmT3gn1bn2D, ElmT3gn3bn2Du, ElmT3gn3bn2Dv, ElmB4gn1bn2D, ElmB4gn2bn2Du, ElmB4gn2bn2Dv, ElmT3gn4bn2D, ElmT3gn9bn2Du, ElmT3gn9bn2Dv, ElmT6gn3bn2D, ElmT3gn3bn2D, ElmB8gn1bn3D, ElmT4gn5bn3D, ElmT10gn4bn3D, ElmT4gn4bn3D, ElmT4gn1bn3D, ElmT10gn1bn3D, ElmB27gn8bn3D, and ElmB27gn1bn3D. |
|
|
returns an array of the basis function nodal coordinates. |
|
|
See documentation of one of the overloaded functions. |
|
|
if mid-side nodes are missing, calculate their coordinates by an interpolation scheme that is suited for the element. Reimplemented in ElmTensorProd, ElmB9n2D, ElmB8n2D, ElmB27n3D, and ElmB20n3D. |
|
|
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 in ElmB8n2D, ElmB20n3D, ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
same as "canBeInsideBox", but has the possibility of taking curved element sides into account. |
|
|
returns the centroid of the element in local coordinates. |
|
|
|
|
|
|
|
|
checks if the element is in an ok state. No value is returned. If abnormalities are detected, error messages are issued. This function is mainly used for checking the implementations of new elements. |
|
|
the second order derivatives in the local element coordinates of the functions defined by "basisFunc". Reimplemented in ElmTensorProd, ElmB2n1D, ElmBH2n1D, ElmB4n2D, ElmB8n2D, ElmB8n3D, ElmB20n3D, ElmT3n2D, ElmT6n2D, ElmT4n3D, ElmT10n3D, ElmB2gn1bn1D, ElmB9gn4bn2D, ElmT3gn1bn2D, ElmT3gn3bn2Du, ElmT3gn3bn2Dv, ElmB4gn1bn2D, ElmB4gn2bn2Du, ElmB4gn2bn2Dv, ElmT3gn4bn2D, ElmT3gn9bn2Du, ElmT3gn9bn2Dv, ElmT6gn3bn2D, ElmT3gn3bn2D, ElmB8gn1bn3D, ElmT4gn5bn3D, ElmT10gn4bn3D, ElmT4gn4bn3D, ElmT4gn1bn3D, ElmT10gn1bn3D, and ElmB27gn1bn3D. |
|
|
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 in ElmTensorProd, ElmBH2n1D, ElmB8n2D, ElmB20n3D, ElmT3n2D, ElmT6n2D, ElmT4n3D, ElmT10n3D, ElmB2gn1bn1D, ElmB9gn4bn2D, ElmT3gn1bn2D, ElmT3gn3bn2Du, ElmT3gn3bn2Dv, ElmB4gn1bn2D, ElmB4gn2bn2Du, ElmB4gn2bn2Dv, ElmT3gn4bn2D, ElmT3gn9bn2Du, ElmT3gn9bn2Dv, ElmT6gn3bn2D, ElmT3gn3bn2D, ElmB8gn1bn3D, ElmT4gn5bn3D, ElmT10gn4bn3D, ElmT4gn4bn3D, ElmT4gn1bn3D, ElmT10gn1bn3D, ElmB27gn8bn3D, and ElmB27gn1bn3D. |
|
|
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 in ElmTensorProd, ElmB2n1D, ElmB4n2D, ElmB8n2D, ElmB8n3D, ElmB20n3D, ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function for drawing the intersection of two specified sides of an element in the global, physical coordinate system. See "drawElement" for comments. Reimplemented in ElmTensorProd, and ElmB20n3D. |
|
|
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 in ElmTensorProd, ElmB4n2D, ElmB8n2D, ElmB8n3D, ElmB20n3D, ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
function for drawing a specified side of an element in the global, physical coordinate system. See "drawElement" for comments. Reimplemented in ElmTensorProd, ElmB8n2D, ElmB20n3D, ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
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 in ElmB2n1D, ElmB3n1D, ElmB4n2D, ElmB9n2D, ElmB8n2D, ElmT3n2D, and ElmT6n2D. |
|
|
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 in ElmTensorProd, ElmB4n2D, ElmT3n2D, and ElmT4n3D. |
|
|
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 in ElmTensorProd, ElmB2n1D, ElmB4n2D, ElmB8n2D, ElmB8n3D, ElmB20n3D, ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
returns the number of basis function nodes on a side in the element. |
|
|
See documentation of one of the overloaded functions. Reimplemented in ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
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 in ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
returns an enum that reflects the shape of the element, "BOX" versus "TRIANGLE". This is necessary for, among other things, numerical integration over the element. |
|
|
returns the variable "ElementType" (int) which informs about the element type the object ElmDef is filled with. All possible values of "ElementType" is listed in "ElmDef_prm.h". Each implemented version of ElmDef has a unique value of the ElementType. |
|
|
returns the local coordinates of the basis function nodes. |
|
|
returns the local coordinates of the geometry nodes. |
|
|
returns the number of basis (trial) functions on the element. |
|
|
returns the number of nodes defining basis (trial) functions on the element. |
|
|
returns the number of basis (trial) function nodes on a specified side of the element. Reimplemented in ElmB4gn2bn2Du, and ElmB4gn2bn2Dv. |
|
|
returns the number of degrees of freedom at a nodal point that the element needs to represent a scalar finite element function. For all elements where the nodal values are used in the definition of the function, there is one degree of freedom per node. However, special elements, like the 1D Hermite cubic element, have two degrees of freedom per node (the function value and the derivative). Elements in the p version of the finite element method typically have many sidemodes, which in the Diffpack terminology translates to many degrees of freedom per side node (and correspondingly many degrees of freedom per internal node - one internal node is associated with all the bubble functions). For an "ElmDef" subclass object one should have the following relation: The sum of "getNoDof4scalarFunction" over all "nne_basis" nodes must equal "nbf". This can be used to implicitly define the concept basis function nodes for a given element. Reimplemented in ElmBH2n1D. |
|
|
returns the number of geometry functions. |
|
|
returns the number of geometry nodes on a specified side of the element. |
|
|
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 in ElmTensorProd, ElmB8n2D, ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
returns the number of sides (edges) of the element. |
|
|
returns the number of physical space dimensions of the element in the reference coordinate system. |
|
|
See documentation of one of the overloaded functions. |
|
|
given a side and a local node on this side (the local node is numbered from 1 to the number of nodes on a side) the function returns the cooresponding node number in the local element system. For example, "ElmB4n2D getNodeOnSide(2,1)" equals 3. An overloaded version takes a "VecSimple(int)" argument and fills it with all the node numbers that belong to the specified side. This version takes a redim of the vector and may hence require memory allocation. |
|
|
returns the polynomial order of the basis functions on the element. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
returns the shape of the sides of the element. This is the counterpart to "getDomainShape" for example for numerical integration over the sides. Reimplemented in ElmTensorProd, ElmB8n2D, ElmB20n3D, ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
See documentation of one of the overloaded functions. Reimplemented in ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
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 in ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
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 in ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
returns true if the local coordinates are inside but not strictly inside. The function uses "isInside" and "isStrictlyInside". |
|
|
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 in ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
returns a true value if the element is of isoparametric type. |
|
|
See documentation of one of the overloaded functions. |
|
|
See documentation of one of the overloaded functions. |
|
|
maps a point in the local element coordinate system to its corresponding point in the global, physical coordinate system. The function makes use of the virtual "geomtFunc" member function. |
|
|
prints the contents of the element (number of nodes, coordinates of local nodes etc). |
|
|
Reimplemented in ElmT3n2D, ElmT6n2D, ElmT4n3D, and ElmT10n3D. |
|
|
sets the resolution of grids for drawing options. Over a 2D element or over a side in a 3D element one can define a uniformly partitioned grid that can be used for various drawing procedures. This function sets the number of grid intervals in each direction of the grid. Note that the grid is always two-dimensional. The grid can either be boxes or triangles. For accessing the grid points or the centers in the boxes/triangles, see the functions "getVertexPt2DGrid" and "getCenterPt2DGrid." |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|