Class xlifepp::GeomElement#

class GeomElement#

object represents the geometric support of mesh elements.

It either a plain element or a side element (side of a GeomElement).

  • when it is a plain element, there is always a MeshElement associated to its but no parentSides

  • when it is a side element, there is at least a parent (parentSides is not empty) and by default no MeshElement, but if required, MeshElement may be constructed (buildSideMeshElement)

Public Functions

GeomElement(const GeomElement&)#

copy constructor

GeomElement(const Mesh*, const RefElement*, dimen_t, number_t)#

construct a plain element from Mesh, ReferenceElement and space dimension

inline GeomElement(const Mesh *m = nullptr, number_t n = 0)#

basic constructor

GeomElement(GeomElement*, number_t, number_t)#

construct a side element from GeomElement parent and side number

inline ~GeomElement()#

destructor

MeshElement *buildSideMeshElement() const#

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

Point center() const#

compute the center of element

centroid of element (computed if not available)

inline void clearGeomMapData()#

clear geometric map data (i.e geoMapData object)

bool contains(const std::vector<real_t>&)#

true if point p as vector belongs to element

void deleteMeshElement()#

destroy meshElement information

const Point &edgeVertex(number_t i, number_t e) const#

return the ith vertex of edge e>=1 (i=1,…) (side in 2D, side of side in 3D)

dimen_t elementDim() const#

return dimension of the element

GeoNumPair elementSharingSide(number_t s) const#

if exists, return the side element associated to side s>=1 else return 0

return the adjacent element by side s as a pair of (GeomElement*, number_t)

std::vector<GeoNumPair> elementsSharingSideOfSide(number_t s, bool o = false) const#

return the list of adjacent elements by side of side s

std::vector<GeoNumPair> elementsSharingVertex(number_t v, bool o = false) const#

return the list of adjacent elements by vertex v

string_t encodeElement(number_t s = 0, number_t ss = 0) const#

string key of element or side element or side of side element from ascending vertex numbers

string_t encodeElementNodes(number_t s = 0) const#

string key of element or side element from ascending node numbers

inline const GeomRefElement *geomRefElement(number_t i = 0) const#

return geomrefelement if i=0 else geomrefelement of side i

inline bool hasMeshElement() const#

true if it handles a MeshElement structure

inline bool isSideElement() const#

true if it is a side element

real_t measure(const number_t sideNo = 0) const#

return measure of element if side_no = 0, measure of side number side_no > 0

MeshElement *meshElement()#

return meshElement_p if not null (non const) else error

const MeshElement *meshElement() const#

return meshElement_p if not null else error

inline const Mesh *&meshP()#

return mesh pointer

inline const Mesh *meshP() const#

return mesh pointer

number_t nodeNumber(number_t i) const#

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

std::vector<number_t> nodeNumbers(number_t s = 0) const#

return the global numbers of nodes if s=0, of side s else

const std::vector<real_t> &normalVector() const#

return normal vector to element according to orientation

return outward normal vector on element

std::vector<real_t> normalVector(number_t s) const#

return outward normal vector on side s>0 (not normalized) or normal to element when s=0

return outward normal vector on side

inline number_t &number()#

returns element number (writable)

inline number_t number() const#

returns element number

number_t numberOfNodes() const#

returns number of nodes of element

inline number_t numberOfParents() const#

number of parents of side element

number_t numberOfSideOfSides() const#

returns number of edges (edges in 3D)

number_t numberOfSides() const#

returns number of sides (faces in 3D, edges in 2D)

number_t numberOfVertices() const#

returns number of vertices of element

GeomElement &operator=(const GeomElement&)#

assign operator

const GeomElement *parent(number_t i = 0) const#

return i-th parent (no check)

const GeomElement *parentInDomain(const MeshDomain*) const#

look for a parent in a domain (if exists return the first one)

const GeoNumPair parentSide(number_t i) const#

return i-th parent and its side (no check)

inline std::vector<GeoNumPair> &parentSides()#

access to parentSides_

inline const std::vector<GeoNumPair> &parentSides() const#

access to parentSides_ (const)

void print(std::ostream&) const#

print geomelement characteristics

void printVertices(std::ostream&, IOFormat f = _undefFormat) const#

print vertices in default format, raw format and matlab format

Point projection(const std::vector<real_t>&, real_t&)#

projection of a point onto element

const RefElement *refElement(number_t i = 0) const#

return reference element if i=0 else ref element of side i

ShapeType shapeType(number_t i = 0) const#

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

const Point &sideOfSideVertex(number_t i, number_t ss) const#

return the ith vertex of side of side ss>=1 (i=1,…)

real_t size() const#

return measure of element if side_no = 0, measure of side number side_no > 0

characteristic size of element (computed if not available)

dimen_t spaceDim() const#

return space dimension, i.e nodes dimension

std::vector<GeomElement*> splitP1() const#

split element in first order elements and return as a list

std::vector<real_t> tangentVector(number_t) const#

return tangent vector on an edge (not normalized)

return outward normal vector on side

const Point &vertex(number_t i, number_t s = 0) const#

return the ith vertex of element or side s (i=1,…)

number_t vertexNumber(number_t i) const#

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

std::vector<number_t> vertexNumbers(number_t s = 0) const#

return the global numbers of vertices if s=0, of side s else

Public Members

mutable real_t color#

useful to mark an element (default = 0)

number_t domainId#

domain id (default=0)

mutable real_t flag#

useful to mark an element in internal process (default = 0)

number_t materialId#

material id (default= 0)

real_t phi#

angle to describe local curvature (phi in x-z plane), default 0

real_t theta#

angle to describe local curvature (theta in x-y plane), default 0

mutable GeomElement *twin_p#

twin geomElement in case of geomElement on an interface

mutable void *userData_p#

a free pointer allowing users to attach data of any type to the Element (casting and memory management are the responsability of the users)

mutable std::vector<void*> userData_ps#

a free void pointer vector to attach data of any type to the Element (useful when mutiltithreading)

Friends

friend std::ostream &operator<<(std::ostream&, const GeomElement&)#

outputs geomelement characteristics