Class xlifepp::MeshDomain#
-
class MeshDomain : public xlifepp::GeomDomain#
-
Inheritence diagram for xlifepp::MeshDomain:
Collaboration diagram for xlifepp::MeshDomain:
class to handle domain with mesh description
Public Functions
-
void buildGeomData() const#
-
build measure and orientation of domain elements
-
void buildIsoNodes() const#
-
build isoGeometric nodes in parameters domain
export iso edges in a raw format, if isoNodes have been already built
-
void buildPartitionData(const std::vector<Parameter> &ps)#
-
create the domain made of dom1 elements that are not in dom2
-
void buildSides(std::vector<GeomElement*> &sidelts) const#
-
build vector of side elements of current domain
create side elements (ALL SIDES) of the current domain and store them in geomElements vector algorithm similar to Mesh::buildSides internal tool, called by sidesDomain() but may be used out of this context
-
const std::map<GeomElement*, std::list<GeoNumPair>> &buildSideToExt(const GeomDomain& = GeomDomain()) const#
-
build sideToExt map
-
void buildVertexElements() const#
-
build VertexElementsMap from geomElements
build VertexElements map from geomElements for each vertex v the list of elements having v as vertex
-
virtual void clearGeomMapData()#
-
clear temporary GeomData structures of MeshElement’s
-
inline virtual bool colorFlag() const#
-
return useColorFlag status
-
virtual void computeStatistics(bool computeSideInfo = false)#
-
update geometric domain info (measure, characteristic sizes, …)
-
inline virtual GeomElement *element(number_t k)#
-
access to k-th element (k>=1), 0 if not available
-
inline virtual const GeomElement *element(number_t k) const#
-
access to k-th element (k>=1), 0 if not available
-
std::list<GeomElement*> elementsCloseTo(Point &pt) const#
-
locate elements close to a given point
-
virtual GeomDomain &extendDomain(bool useVertex = false, const GeomDomain &omega = GeomDomain()) const#
-
find or create extension of a side domain
find or create the extension of a side domain two cases are considered: extension from side elements: gives the list of all geometric elements having a side on the side domain, extended name: ‘side domain name’_sextension extension from side vertices: gives the list of all geometric elements having a vertex on the side domain, extended name: ‘side domain name’_vextension the former extension is used when computing integral over side domain involving non tangential operator while the second one is used when extending a function from side to inside domain
useVertex: if true do extension from side vertices else do extension from side elements omega: optional inside domain, restrict extension to elements of omega, when omega is void (or not a MeshDomain) take all parent elements
-
virtual GeomDomain &ficticiousDomain(const GeomDomain &omega) const#
-
find or create a ficticious domain of a side domain
create a ficticious domain of current domain (say gamma) related to a given domain (say omega) the ficticious domain is the set of elements intersecting any element of Gamma the name of ficticious domain is: gamma.name_F_omega.name
the sideToExt map of ficticious domain gives the list of elements of omega intersecting an element of gamma that is useful to compute FEM integral involving unknown on gamma and unknown on omega
generally gamma is a domain of dimension n-1 as domain omega is of dimension n, but the algorithm used is general and is able to deal with any kind of domains whereas the function intersect(GeomElement, GeomElement) can deal with any kind of elements remove elements (set) from current domain, creating new domain if different from current
-
virtual Vector<real_t> getNormal(const Point&, OrientationType = _undefOrientationType, const GeomDomain& = GeomDomain()) const#
-
return normal to the current domain at a given point
return normal to a domain gamma at a given point x, normal orientation may be imposed (_towardsInfinite, _outwardsInfinite, _towardsDomain, _outwardsDomain)
-
virtual bool include(const GeomDomain&) const#
-
true if the current domain includes a given domain (const)
return true if the current domain includes a given domain inclusion has to be understood in a geometric meaning, not in algebraic meaning as side is included in its parent element, a boundary domain may be included in a volumic domain
-
bool include(const MeshDomain &d) const#
-
true if the current domain includes a given mesh domain (const)
-
GeomDomain &internalSidesDomain(const string_t &na = "") const#
-
find or create internal sides domain related to current one
if not exists, builds the domains made of INTERNAL sides of all elements of the current domain if current domain dimension = mesh dimension, the GeomElement* stored in Mesh::Sides are used else new GeomElement are created using MeshDomain::buildSides na : name of the sidesDomain if empty, name will be “sides of “+this->name() when sidesDomain already exists, na has no effect Note : do not confuse internal sides domain built here and sides domain built in sidesDomain and stored in the pointer sidesDomain_p of parent domain
-
bool isCrack() const#
-
true if MeshDomain is a side of a crack
true if MeshDomain is a side of a given mesh domain
-
virtual bool isInterface() const#
-
true if MeshDomain is an interface between domains (first element has more than one parent)
true if MeshDomain is a side of a crack
-
inline virtual bool isIntersection() const#
-
MeshDomain is not an intersection of domains.
-
virtual bool isSideDomain() const#
-
true if MeshDomain is a side of meshdomain (first element has one parent)
return true if MeshDomain is a side of meshdomain (first elment has a parent)
true if MeshDomain is a set of element sides (isSidesOf_p!=nullptr)
-
bool isSideOf(const MeshDomain &d) const#
-
true if MeshDomain is a side of a given mesh domain
-
virtual bool isSidesDomain() const#
-
true if MeshDomain is a set of element sides (isSidesOf_p!=nullptr)
-
inline virtual bool isUnion() const#
-
MeshDomain is not an union of domains.
-
bool isUnionOf(const std::vector<const GeomDomain*>&) const#
-
check if an union of subdomains is equal to the current mesh domain
check if an union of mesh subdomains is equal to the current mesh domain assuming that the current mesh domain includes all domains perform only analysis on the number of elements (not robust)
-
virtual const GeomDomain *largestDomain(std::vector<const GeomDomain*>) const#
-
return the largest domain including list of subdomains
return the largest domain including a list of subdomains (doms), in a geometric meaning, it may be
the current domain if the union is the current domain
one of the domain, if one contains all of the others and is different from current one
the union of subdomains (created if does not exist) else
-
GeomElement *locate(const Point&, bool silent = false) const#
-
locate element containing a given point
-
virtual real_t measure() const#
-
measure (length, surface or volume) of MeshDomain
return the measure (length, surface or volume) of MeshDomain
-
inline virtual MeshDomain *meshDomain()#
-
access to meshDomain pointer
-
inline virtual const MeshDomain *meshDomain() const#
-
access to meshDomain pointer (const)
-
GeomElement *nearest(Point &pt, real_t&) const#
-
locate nearest element of a given point
build isoGeometric nodes in parameters domain
-
std::set<number_t> nodeNumbers() const#
-
return the set of all node numbers of meshdomain, ascending order
-
std::vector<Point> nodes() const#
-
return the set of all nodes of meshdomain, numbers ascending order
-
inline virtual std::pair<OrientationType, const GeomDomain*> normalOrientation() const#
-
return current orientation of normal vectors
-
virtual void print(std::ostream&) const#
-
print MeshDomain informations
-
template<typename Iterator>
std::vector<std::pair<Point, GeomElement*>> projections(Iterator itp, number_t np) const#
-
export to file the edges related to isoNodes (if defined) in a raw format
build the projection of a list of points (given by an iterator) onto the current domain return a vector<std::pair<Point,GeomElement*> > containing for each point the projection P and the GeomElement E containing P input: itp: iterator on the first point (*itp should be a Point&) np : number of points to deal with
build projections of points onto current domain
loop on points(Vi) di=+inf loop on element of current side domain (Ek) compute Pik the projection of Vi on Ek and dik=|Pik-Vi| if(dik<di) Pi=Pik, di=dik
-
void rebuild(const ComparisonFunction<>&, bool restrictedToDomain = false)#
-
rebuild by collecting elements when color satisfies a criterium given by ComparisonFunction
rebuild current domain by collecting elements satisfying a criterium given by a a ComparisonFunction dom = {elt such that cf(elt.color)=true} update all related data
Note
this function rebuilds domain only from mesh elements, if required do not forget to create new elements before
-
void rebuild(const std::map<string_t, std::vector<GeoNumPair>>&, std::map<string_t, GeomElement*>&, const std::map<GeomDomain*, std::set<GeomElement*>*>&)#
-
rebuild a side domain from plain domain elements
rebuild current side domain by collecting side elements being a side of elements of doms sideIndex: vector of sides described as a pair (parent elt pointer, side number) and indexed by a string sideEltIndex: vector of side element indexed by a string parelts: set of parent elements for each involved domains built either boundary (one domain) or interface (two domains)
-
virtual GeomDomain &removeElts(const GeomDomain &dom, const string_t &namedom = "") const#
-
remove dom GeomElements from current domain, creating new GeoDomain if different from current
-
virtual GeomDomain &removeElts(const std::set<GeomElement*> &elts, const string_t &namedom = "") const#
-
remove set of GeomElements from current domain, creating new domain if different from current
remove elements of dom from current domain, creating new domain if different from current
-
void removeExt()#
-
remove extension of current domain
-
void reverseOrientations() const#
-
reverse all the element orientations
-
void setColor(const std::vector<real_t>&, const std::map<number_t, number_t>&, ColoringRule = defaultColoringRule) const#
-
set color of geom elements of domain according to vertex values and a coloring rule
set color of geom elements of domain according to vertex values and a coloring rule val: real vector of values on domain vertices vIndex: map mesh vertex number -> domain vertex number cr: a ColoringRule, i.e; a function of the form: real_t cr(const Geomelement& gelt, const std::vector<real_t>& v)
-
void setColor(const std::vector<Vector<real_t>> &val, const std::map<number_t, number_t> &vIndex, VectorColoringRule = defaultVectorColoringRule) const#
-
set color of geom elements of domain according to vertex vertex values and a vector coloring rule val: vector of real vectors on domain vertices vIndex: map mesh vertex number -> domain vertex number vcr: a VectorColoringRule, i.e; a function of the form: real_t cr(const Geomelement& gelt, const std::vector<Vector<real_t> >& v)
-
inline virtual void setColorFlag(bool f) const#
-
set useColorFlag status
-
virtual void setNormalOrientation(OrientationType, const GeomDomain&) const#
-
set normal orientation of a SpaceDim-1 meshdomain related to a GeomDomain
set orientation of meshElements of a manifold/boundary say a mesh domain of dimension SpaceDim-1
update the member data normalDefinition
compute or update the orientation of geometric elements of the current meshdomain
if the domain is not a domain of dimension SpaceDim-1, nothing is done if ort = _towardsInfinite (resp._outwardsInfinite), geom is not used if ort = _towardsDomain (resp._outwardsDomain), geom has to be a parent domain of boundary domain if orientations have never been computed, compute them using setOrientationForManifold or setOrientationForBoundary if orientations are currently computed, detect if the orientations have to be reversed
for instance , consider the following domains
|------------------------------| | |----> Gamma.setNormalOrientation(_towardsInfinite) | |------------| | = Gamma.setNormalOrientation(_outwardsDomain,Omega2) | | | | | Omega2 | Omega1 | | | | |------------> Sigma.setNormalOrientation(_towardsInfinite) | |------------| | = Sigma.setNormalOrientation(_outwardsDomain,Omega1) | Sigma | = Sigma.setNormalOrientation(_towardsDomain, Omega2) |------------------------------| Gamma
WARNING: - For a non closed manifold/boundary, setNormalOrientation(_towardsInfinite/outwardsInfinite) constructs consistent normal orientations but not predictable, use additional “interior” point
In case of an interface, _outwardsDomain with no domain specified may give inconsistent normal orientations
-
virtual void setNormalOrientation(OrientationType, const Point&) const#
-
set normal orientation of a SpaceDim-1 meshdomain related to a Point
-
virtual void setNormalOrientation(OrientationType = _undefOrientationType, const GeomDomain *gp = nullptr, const Point *p = nullptr) const#
-
set normal orientation of a SpaceDim-1 meshdomain
-
void setOrientationForBoundary(OrientationType ort = _outwardsDomain, const GeomDomain* = nullptr) const#
-
set normal orientation of a boundary
set orientation of meshElements of a boundary of a domain, i.e a sign to apply to normal computed from the jacobian according to an orientation rule
ort: one of direction _towardsInfinite, _outwardsInfinite,_towardsDomain, _outwardsDomain
geom: pointer to (parent) domain concerned by orientation if geom = 0 , compute in/outward normal from first element parent
-
void setOrientationForManifold(OrientationType = _towardsInfinite, const Point *P = nullptr) const#
-
set normal orientation of a manifold
set orientation of meshElements of a manifold say a mesh domain of dimension SpaceDim-1 orientation (-1 or 1) is chosen such as the orientation * normal vector is an outward normal, say going to infinite if ort = _outwardsInfinite, the orientations are reversed P is an additional point used to specify where is the “interior” of an open manifold
| | P |-----> towardsInfinite related to P | | |
first step: compute one normal by element (given by cross product of two first columns of jacobian)
second step: find a path in element list such as two consecutive elements share a side may be more than one path (case of non connected components)
pick one normal (by connected component) and decide the outward orientation by analysis the intersection of a half line and all other elements
travel this path and choose same orientation for all element using a continuity method based on geometric computation
For a non closed manifold, this process constructs consistent normal orientations but not predictable. Use additional point P
NOTE: to be changed in future by numbering analysis
-
void setShapeTypes()#
-
set the element shape types in mesh domain
-
virtual GeomDomain &sidesDomain(const string_t &na = "") const#
-
find or create sides domain related to current one
if not exists, builds the domains made of ALL sides of all elements of the current domain else returns sidesDomain_p if current domain dimension = mesh dimension, the GeomElement stored in Mesh::Sides are used else new GeomElement are created using MeshDomain::buildSides na: name of the sidesDomain if empty, name will be “sides of “+this->name() when sidesDomain already exists, na has no effect
-
void updateDomainParents(bool keep = false)#
-
update parents if keep=false or parents is empty
update domain parents (not the grandparents) loop on domains of mesh with dimension + 1 check if it is a parent checking ONLY the first element
-
void updateSides(std::map<string_t, std::vector<GeoNumPair>>&)#
-
update parent sides of elements of a side domain
update parent sides if a side domain the parent element of a side element may be incomplete, depending on the mesher used this function looks for all parent elements of a side elements and updates the parentSides_ vector of each geometric element works only for side domain sideIndex: sides of mesh indexed by the list of ordered vertex numbers -> list of (parent element, side number) may be constructed here
Public Members
-
mutable bool diffEltComputed = false#
-
true: differential elements are computed
-
const MeshDomain *dualCrackDomain_p = nullptr#
-
other side, if domain is a side of crack else 0
-
const MeshDomain *extensionin_p = nullptr#
-
extension domain pointer, if domain is an extension of a domain, else 0
-
const MeshDomain *extensionof_p = nullptr#
-
side domain pointer, if domain is an extension of a side domain, else 0
-
DomainExtensionType extensionType = _noExtension#
-
extension type
-
std::vector<GeomElement*> geomElements#
-
list of geometric elements
-
mutable bool inverseJacobianComputed = false#
-
true: inverse of jacobians are computed
-
mutable const MeshDomain *isSidesOf_p = nullptr#
-
parent domain when a sides domain
-
mutable bool jacobianComputed = false#
-
true: jacobians are computed
-
mutable KdTree<Point> kdtree#
-
kdtree structure using to fast locate element containing a given point
-
mutable bool normalComputed = false#
-
true: normals are computed
-
mutable std::pair<OrientationType, const GeomDomain*> normalOrientationRule#
-
the normal orientation rule
-
mutable bool orientationComputed = false#
-
true: orientations are computed
-
std::list<MeshDomain*> parents#
-
mesh domain parents if side domain (see updateParents)
-
mutable bool parentSidesUptodate = false#
-
true: parents of side elements are up to date
-
mutable PartitionData *partitionData_p = nullptr#
-
partition data related to mesh domain
-
mutable MeshDomain *sidesDomain_p = nullptr#
-
domain of all sides of current domain (see sidesDomain)
-
mutable std::map<GeomElement*, std::list<GeoNumPair>> sideToExt#
-
map side element -> list of extended elements (for a side domain!)
-
mutable bool useColor = false#
-
true: restrict integral to GeomElement with 0 color (only intg rep), default=false
-
mutable std::map<Point, std::list<GeomElement*>> vertexElements#
-
list of elements by vertex
-
void buildGeomData() const#