Geometric element#

A mesh consists mainly of a list of nodes and a list of geometric elements. XLiFE++ makes a distinction between two types of geometric element:

  • the complete element with all geometric information (MeshElement class)

  • the side element that refers to a side of an other geometric element (GeomElement class)

Actually, complete elements are GeomElement objects that handle a MeshElement allocated pointer whereas side elements are GeomElement objects that handle a list of parent elements (a pair of GeomElement* and side number). By default, MeshElement pointer is not allocated for side element, but it can be allocated using the GeomElement::buildSideMeshElement function.

../../_images/GeomElement.png

In advanced use, users may have to manipulate GeomElement/MeshElement objects.

Table 3 Main data handled by GeomElement#

number_

unique id number of geometric element

meshElement_p

MeshElement pointer (may be null when a side element)

parentSides_

list of parents (vector<GeoNumPair>) if a side element, empty when a mesh element

materialId

material id (Number, default= 0)

domainId

domain id (Number, default= 0)

color

useful to mark an element (Real, default= 0)

theta, phi

local curvatures angles (x-y plane, x-z plane); (Real, default= 0)

twin_p

twin GeomElement in case of GeomElement on an interface

userData_p

a free pointer (void*) allowing users to attach data of any type to the Element

userData_ps

a free void pointers vector (vector<void*>) to attach data of any type to the Element (useful when mutiltithreading)

Note

userData_p and userData_ps are free pointers dedicated to users to do specific calculations that are not managed by XLiFE++; the casting and memory management associated with these pointers are the responsibility of users.

Table 4 Main data handled by MeshElement#

nodes

a subset of Mesh::nodes (direct access to nodes, vector<Point*>)

nodeNumbers

a subset of mesh node numbers (direct access to node numbers, vector<Number*>)

vertexNumbers

a subset of mesh node numbers (vector<Number*>, may be equal to nodeNumbers, index starts from 1)

measures

length or area or volume of element and of its sides (vector<Real*>)

size

characteristic size of element (Real, set by computeMeasures)

centroid

centroid of the element (Point, set by computeMeasures)

orientation

element orientation (sign of jacobian determinant, 0 means unset orientation)

refElt_p

pointer to the reference element (RefElement*) attached to the mesh element

geomMapData_p

pointer to a geometric calculation structure (GeomMapData*), handling map from reference element, jacobian,…

linearMap

true if the geometric map \(\varphi_\ell\) from reference element is linear (for instance first order simplicial element)

The GeomElement class collects all the member functions related to geometric element being either a mesh element or a side element.

Table 5 Useful functions attached to GeomElement#

number

returns element number as Number

elementDim, spaceDim

return the dimension of the element and the nodes dimansion as Dimen

shapeType(s)

return the shape type of element (s=0) and its sides s>0 (_segment, _triangle, …)

meshElement, isSideElement

return MeshElement* pointer (null if not allocated) and true if it is a side element

buildSideMeshElement

create a MeshElement object when element is a side element (not automatic)

numberOfParents

return number of parents if a side element

parentSide(i), parentSides

return return i-th parent and its side (no check) or access to parentSides_ as a vector<GeoNumPair>

numberOfNodes, numberOfVertices, numberOfSides, numberOfSideOfSides

returns number of nodes, of vertices, of sides, of sides of side of element

vertexNumber(i), nodeNumber(i)

return the global number of vertex/node i (i=1,…)

vertexNumbers(s), nodeNumber(s)

return the global numbers of vertices/nodes if s=0, of side s else (as a vector<Number>)

vertex(i, s), sideOfSideVertex(i, s), edgeVertex(i, e)

return as Point the i-th vertex of element or side, side of side or edge s>=1 (i=1,…)

elementSharingSide(s), elementsSharingVertex(i)

return the adjacent element by side s or vertex i as a GeoNumPair

center, size, measure(s),

return the center of element (as a Point), a characteristic size of element (diameter of the circumscribed ball or max of length of edges), the measure of element if s = 0 or the measure of side s > 0

normalVector(s), tangentVector(s)

return outward normal/tangent vector on side s>0, if s=0 normal/tangent vector to element

contains(pt)

return true if mesh element contains a point pt given as a Point

projection(pt, dist)

projection of a point onto mesh element (return a Point and the distance to element)

print, printVertices or operator <<

display information related to current mesh element

Most of member functions of GeomElement call member functions of MeshElement. But there are specific functions attached to MeshElement:

Table 6 Additional functions attached to MeshElement#

refElement(s)

return reference element ( as a RefElement*) related to element if s =0 or related to side element s >0

geomMapData(pt)

build GeomMapData structure at point pt and return a reference to

clearGeomMapDa

clear GeomMapData object

computeMeasures

compute measure of element and its side

computeOrientation

compute orientation of element: sign(det(jacobian))

MeshElement manages a pointer to a GeomMapData object that handles data and tools attached to the map \(\varphi_\ell\) from reference element to geometric element:

Table 7 Main data related to GeomMapData class#

geomElement_p

pointer to GeomElement object

currentPoint

point in reference element used for calculation

jacobianMatrix, inverseJacobianMatrix

jacobian matrix of mapping from reference element to current one, inverse jacobian matrix (when needed)

jacobianDeterminant, differentialElement

jacobian determinant and differential element for elementary integrals

normalVector, tangentVector, bitangentVector,

unit outward normal/tangent/bi-tangent vector at a given boundary point

metricTensor, metricTensorDeterminant

symetric metric tensor (t_i|t_j) and metric_tensor determinant

Table 8 Main function related to GeomMapData class#

geomMap(pt,*s*)

mapping from ref. elt onto geom. elt (return a Point).

geomMapInverse(pt)

inverse mapping from elt onto ref. elt.

piolaMap

Piola mapping from ref. elt onto geom. elt. Element (shape functions known)

covariantPiolaMap(pt), contravariantPiolaMap(pt)

return the covariant/contraariant Piola map matrix at current point (Matrix<real_t>)

computeJacobianMatrix(pt)

compute jacobian matrix at a point (return a Matrix<real_t>))

computeJacobianDeterminant

compute jacobian determinant (return a real_t))

invertJacobianMatrix

compute inverse of jacobian matrix (jacobian already computed)

computeDifferentialElement

compute differential element assuming jacobian matrix is update

computeNormalVector, computeOrientedNormal

computes (oriented) normal vector at a point of element, assuming jacobian matrix is update

computeTangentVector

compute tangent (and bitangent) vector at currernr point

omputeMetricTensor

compute metric tensor for surface differential geometry

computeSurfaceGradient

compute surface gradient gradS from 2D reference gradient (grad0, grad1)

print and operator <<

display information