Class xlifepp::PiecewiseParametrization#

class PiecewiseParametrization : public xlifepp::Parametrization#

Inheritence diagram for xlifepp::PiecewiseParametrization:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "2" [label="xlifepp::Parametrization" tooltip="xlifepp::Parametrization"] "1" [label="xlifepp::PiecewiseParametrization" tooltip="xlifepp::PiecewiseParametrization" fillcolor="#BFBFBF"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for xlifepp::PiecewiseParametrization:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "22" [label="xlifepp::Collection< string_t >" tooltip="xlifepp::Collection< string_t >"] "15" [label="xlifepp::Matrix< real_t >" tooltip="xlifepp::Matrix< real_t >"] "19" [label="xlifepp::Vector< real_t >" tooltip="xlifepp::Vector< real_t >"] "30" [label="xlifepp::Vector< xlifepp::Vector< real_t > >" tooltip="xlifepp::Vector< xlifepp::Vector< real_t > >"] "39" [label="std::list< std::pair< number_t, real_t > >" tooltip="std::list< std::pair< number_t, real_t > >"] "11" [label="std::map< number_t, std::vector< number_t > >" tooltip="std::map< number_t, std::vector< number_t > >"] "9" [label="std::map< number_t, xlifepp::Geometry * >" tooltip="std::map< number_t, xlifepp::Geometry * >"] "38" [label="std::map< string_t, number_t >" tooltip="std::map< string_t, number_t >"] "41" [label="std::map< xlifepp::Parametrization *, std::vector< number_t > >" tooltip="std::map< xlifepp::Parametrization *, std::vector< number_t > >"] "42" [label="std::map< xlifepp::Parametrization *, std::vector< std::pair< xlifepp::Parametrization *, number_t > > >" tooltip="std::map< xlifepp::Parametrization *, std::vector< std::pair< xlifepp::Parametrization *, number_t > > >"] "44" [label="std::map< xlifepp::Parametrization *, xlifepp::Triplet<> >" tooltip="std::map< xlifepp::Parametrization *, xlifepp::Triplet<> >"] "43" [label="std::map< xlifepp::Triplet<>, std::pair< xlifepp::Parametrization *, xlifepp::Transformation * > >" tooltip="std::map< xlifepp::Triplet<>, std::pair< xlifepp::Parametrization *, xlifepp::Transformation * > >"] "40" [label="std::list< T >" tooltip="std::list< T >"] "10" [label="std::map< K, T >" tooltip="std::map< K, T >"] "6" [label="std::vector< T >" tooltip="std::vector< T >"] "25" [label="std::vector< T >" tooltip="std::vector< T >"] "18" [label="std::vector< K >" tooltip="std::vector< K >"] "5" [label="std::vector< RealPair >" tooltip="std::vector< RealPair >"] "21" [label="std::vector< const xlifepp::Transformation * >" tooltip="std::vector< const xlifepp::Transformation * >"] "26" [label="std::vector< number_t >" tooltip="std::vector< number_t >"] "16" [label="std::vector< real_t >" tooltip="std::vector< real_t >"] "35" [label="std::vector< std::vector< GeoNumPair > >" tooltip="std::vector< std::vector< GeoNumPair > >"] "12" [label="std::vector< std::vector< int_t > >" tooltip="std::vector< std::vector< int_t > >"] "23" [label="std::vector< string_t >" tooltip="std::vector< string_t >"] "34" [label="std::vector< xlifepp::GeomDomain * >" tooltip="std::vector< xlifepp::GeomDomain * >"] "33" [label="std::vector< xlifepp::GeomElement * >" tooltip="std::vector< xlifepp::GeomElement * >"] "37" [label="std::vector< xlifepp::Parameter * >" tooltip="std::vector< xlifepp::Parameter * >"] "8" [label="std::vector< xlifepp::Point >" tooltip="std::vector< xlifepp::Point >"] "27" [label="std::vector< xlifepp::Transformation * >" tooltip="std::vector< xlifepp::Transformation * >"] "31" [label="std::vector< xlifepp::Vector< real_t > >" tooltip="std::vector< xlifepp::Vector< real_t > >"] "4" [label="xlifepp::BoundingBox" tooltip="xlifepp::BoundingBox"] "24" [label="xlifepp::Collection< T >" tooltip="xlifepp::Collection< T >"] "13" [label="xlifepp::ExtrusionData" tooltip="xlifepp::ExtrusionData"] "29" [label="xlifepp::GeoNode" tooltip="xlifepp::GeoNode"] "3" [label="xlifepp::Geometry" tooltip="xlifepp::Geometry"] "17" [label="xlifepp::Matrix< K >" tooltip="xlifepp::Matrix< K >"] "32" [label="xlifepp::Mesh" tooltip="xlifepp::Mesh"] "7" [label="xlifepp::MinimalBox" tooltip="xlifepp::MinimalBox"] "36" [label="xlifepp::Parameters" tooltip="xlifepp::Parameters"] "2" [label="xlifepp::Parametrization" tooltip="xlifepp::Parametrization"] "1" [label="xlifepp::PiecewiseParametrization" tooltip="xlifepp::PiecewiseParametrization" fillcolor="#BFBFBF"] "28" [label="xlifepp::Point" tooltip="xlifepp::Point"] "14" [label="xlifepp::Transformation" tooltip="xlifepp::Transformation"] "20" [label="xlifepp::Vector< K >" tooltip="xlifepp::Vector< K >"] "22" -> "23" [dir=forward tooltip="public-inheritance"] "22" -> "24" [dir=forward tooltip="template-instance"] "15" -> "16" [dir=forward tooltip="public-inheritance"] "15" -> "17" [dir=forward tooltip="template-instance"] "19" -> "16" [dir=forward tooltip="public-inheritance"] "19" -> "20" [dir=forward tooltip="template-instance"] "30" -> "31" [dir=forward tooltip="public-inheritance"] "30" -> "20" [dir=forward tooltip="template-instance"] "39" -> "40" [dir=forward tooltip="template-instance"] "11" -> "10" [dir=forward tooltip="template-instance"] "9" -> "10" [dir=forward tooltip="template-instance"] "38" -> "10" [dir=forward tooltip="template-instance"] "41" -> "10" [dir=forward tooltip="template-instance"] "42" -> "10" [dir=forward tooltip="template-instance"] "44" -> "10" [dir=forward tooltip="template-instance"] "43" -> "10" [dir=forward tooltip="template-instance"] "18" -> "6" [dir=forward tooltip="template-instance"] "5" -> "6" [dir=forward tooltip="template-instance"] "21" -> "6" [dir=forward tooltip="template-instance"] "26" -> "6" [dir=forward tooltip="template-instance"] "16" -> "6" [dir=forward tooltip="template-instance"] "35" -> "6" [dir=forward tooltip="template-instance"] "12" -> "6" [dir=forward tooltip="template-instance"] "23" -> "6" [dir=forward tooltip="template-instance"] "34" -> "6" [dir=forward tooltip="template-instance"] "33" -> "6" [dir=forward tooltip="template-instance"] "37" -> "6" [dir=forward tooltip="template-instance"] "8" -> "6" [dir=forward tooltip="template-instance"] "27" -> "6" [dir=forward tooltip="template-instance"] "31" -> "6" [dir=forward tooltip="template-instance"] "4" -> "5" [dir=forward tooltip="usage"] "24" -> "25" [dir=forward tooltip="public-inheritance"] "13" -> "14" [dir=forward tooltip="usage"] "13" -> "22" [dir=forward tooltip="usage"] "13" -> "26" [dir=forward tooltip="usage"] "13" -> "16" [dir=forward tooltip="usage"] "13" -> "19" [dir=forward tooltip="usage"] "13" -> "27" [dir=forward tooltip="usage"] "13" -> "28" [dir=forward tooltip="usage"] "29" -> "29" [dir=forward tooltip="usage"] "29" -> "3" [dir=forward tooltip="usage"] "3" -> "4" [dir=forward tooltip="usage"] "3" -> "7" [dir=forward tooltip="usage"] "3" -> "9" [dir=forward tooltip="usage"] "3" -> "11" [dir=forward tooltip="usage"] "3" -> "12" [dir=forward tooltip="usage"] "3" -> "13" [dir=forward tooltip="usage"] "3" -> "2" [dir=forward tooltip="usage"] "3" -> "3" [dir=forward tooltip="usage"] "3" -> "29" [dir=forward tooltip="usage"] "17" -> "18" [dir=forward tooltip="public-inheritance"] "32" -> "3" [dir=forward tooltip="usage"] "32" -> "8" [dir=forward tooltip="usage"] "32" -> "33" [dir=forward tooltip="usage"] "32" -> "34" [dir=forward tooltip="usage"] "32" -> "26" [dir=forward tooltip="usage"] "32" -> "35" [dir=forward tooltip="usage"] "32" -> "32" [dir=forward tooltip="usage"] "7" -> "8" [dir=forward tooltip="usage"] "36" -> "37" [dir=forward tooltip="usage"] "36" -> "38" [dir=forward tooltip="usage"] "2" -> "3" [dir=forward tooltip="usage"] "2" -> "19" [dir=forward tooltip="usage"] "2" -> "30" [dir=forward tooltip="usage"] "2" -> "32" [dir=forward tooltip="usage"] "2" -> "36" [dir=forward tooltip="usage"] "2" -> "39" [dir=forward tooltip="usage"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "1" -> "8" [dir=forward tooltip="usage"] "1" -> "41" [dir=forward tooltip="usage"] "1" -> "42" [dir=forward tooltip="usage"] "1" -> "26" [dir=forward tooltip="usage"] "1" -> "43" [dir=forward tooltip="usage"] "1" -> "44" [dir=forward tooltip="usage"] "28" -> "16" [dir=forward tooltip="public-inheritance"] "14" -> "15" [dir=forward tooltip="usage"] "14" -> "19" [dir=forward tooltip="usage"] "14" -> "21" [dir=forward tooltip="usage"] "20" -> "18" [dir=forward tooltip="public-inheritance"] }

PiecewiseParametrization class handles a global parametrization of multiple patches: basically a list of standard parametrizations Main data members: map<Parametrization*, vector<pair<Parametrization*,number_t> > > neighborParsMap: map Parametrization* -> neighbor Parametrizations vector vector<Point> vertices: list of all vertices of parametrizations (stored once) map<Parametrization*, vector<number_t> > vertexIndexes: map Parametrization* -> vertex numbers with parameters correspondance index: u=0->1, u=1->2, v=0->3, v=1->4, w=0->5, w=1->6 the neighbor parametrization and vertexIndexes vector are stored according to the parameters correspondance.

EXPERIMENTAL: global C0 parametrization, additional structures Vector <number_t> ns: the numbers n1, n2, n3 map<Triplet, pair<Parametrization*, Transformation*>>> parsMap: map (i,j,k) -> (Parametrization*, Transformation*) (i=1,n1, ,j=1,n2, k=1,n3) map<Parametrization*, Triplet> parsRMap: reverse map Parametrization* -> i,j,k u in [0,1] if curve, (u,v) in [0,1]x[0,1] if surface, (u,v,w) in [0,1]x[0,1]x[0,1] if volume u-interval [0,1] is split in n1 parts [0,1/n1],[1/n1,2/n1], … [(n1-1)/n1,1] defined if curve v-interval [0,1] is split in n2 parts [0,1/n2],[1/n2,2/n2], … [(n2-1)/n2,1] defined if surface w-interval [0,1] is split in n3 parts [0,1/n3],[1/n3,2/n3], … [(n3-1)/n3,1] defined if volume if defines n1 x n2 x n3 cells (Cijk)on which may be attached a parametrization Pijk or not and a tranfer fuction that maps (u,v,w) -> Tijk(n1*u-i+1, n2*v-j+1, n3*w-k+1) in [0,1]x[0,1]x[0,1] where T: [0,1]x[0,1]x[0,1] -> [0,1]x[0,1]x[0,1] is a linear transformation that maps parameters of Pijk the global parametrization may be discontinuous at interfaces except if the algorithm build continous parametrization by matching parameters on interfaces Note: Parametrization* involved here are shared pointers (no clone), null Transformation pointer means no transformation (say id) transformation pointers should be deleted as they are built on memory stack

Public Functions

PiecewiseParametrization(Geometry *g, number_t n1, number_t n2 = 0, number_t n3 = 0)#

basic constructor

bool add(Parametrization *p, Transformation *tr, number_t i, number_t j = 0, number_t k = 0)#

add parametrisation to map (return false if fails)

void buildNeighborParsMap(std::map<std::set<number_t>, std::list<std::pair<Geometry*, number_t>>> &sidemap)#

destructor build the neighborParsMap

build the map neighborParsMap: Parametrization* -> vector of (Parametrization*,side number)

void buildReverseMap()#

build the reverse map

void buildVertices()#

build vertices

build vertices vector and vertexIndexes map

inline virtual Vector<real_t> curvatures(const Point &P, DiffOpType d = _id) const#

< shortcut to the first length if few

inline virtual Vector<real_t> lengths(const Point &P, DiffOpType d = _id) const#

< local lengths of a curve: sqrt(x1’(t)^2+x2’(t)^2+…)

Parametrization *locateParametrization(const Point &p, const Point &dp, Parametrization *par0, Point &q, real_t &d) const#

locate parametrization related to a physical point, update parameter point q and distance d

locate parametrization or nearest parametrization (generalization of toParameter function) p: point to be located dp: a direction to choose parametrization when on boundary (if void not used) par0 : first parametrization candidate (may be 0) q: parameter point found d: maximal distance p-par(q), output the distance found (if d=0, search parametrization such that par(q)=p) return Parametrization if found else return 0, q and d are updated

  • when d>0 and p does not belongs to a patch, for each parametrization a “projection” of p is done and the smallest distance (if <d) gives the parametrization the projection is the following: . project p on the linear patchs get from vertices of the parametrization. It gives some barycentric coordinates (l1,l2,…) related to the vertices . use this barycentric coordinates to get a parameter q by linear interpolation . project q on the parameters domain . “projection” of p: pr = par(q) and distance = norm(pr-p);

  • when there is more than one admissible parametrizations and one dp direction, the parametrizations selected is the one with the smallest angle between the projection of dp and dp inverse function of the parametrization

virtual void print(std::ostream&) const#

print utility

virtual Point toParameter(const Point &p) const#

inverse function of the parametrization

Public Members

std::map<Parametrization*, std::vector<std::pair<Parametrization*, number_t>>> neighborParsMap#

nneighbor parametrizations for each parametrization

std::map<Triplet<>, std::pair<Parametrization*, Transformation*>> parsMap#

map (i,j,k) -> Parametrization*

std::map<Parametrization*, Triplet<>> parsRMap#

reverse map Parametrization* -> (i,j,k)

std::map<Parametrization*, std::vector<number_t>> vertexIndexes#

for each Parametrization, list of vertex indices

std::vector<Point> vertices#

list of vertices