Class xlifepp::Triangle#

class Triangle : public xlifepp::Polygon#

definition of a triangular geometry in R^3

Triangle constructors are based on a key-value system. Here are the available keys:

  • _v1, _v2, _v3: to define the vertices of the triangle, counterclockwise oriented

  • _nnodes: to define the number of nodes on each edge of the Triangle

  • _hsteps: to define the local mesh steps on the vertices of the Triangle

  • _domain_name: to define the domain name

  • _side_names/_edge_names: to define the side names

  • _vertex_names: to define the side of side names

  • _varnames: to define the variable names for print purpose

Public Functions

Triangle()#

default constructor

default triangle is (0,0) (1,0) (0,1), parametrization not allocated

Triangle(const Point &p1, const Point &p2, const Point &p3, const std::vector<number_t> &n = std::vector<number_t>(3, 2), const string_t &domName = string_t(), const std::vector<string_t> &sideNames = std::vector<string_t>(3, ""), const std::vector<string_t> &sideOfSideNames = std::vector<string_t>(3, ""))#

default constructor with 3 Point

Triangle(const Point &p1, const Point &p2, const Point &p3, const std::vector<real_t> &h, const string_t &domName = string_t(), const std::vector<string_t> &sideNames = std::vector<string_t>(3, ""), const std::vector<string_t> &sideOfSideNames = std::vector<string_t>(3, ""))#

default constructor with 3 Point

Triangle(Parameter p1, Parameter p2, Parameter p3)#

key-value constructor

inline virtual ~Triangle()#

destructor

virtual string_t asString() const#

format as string

inline virtual Geometry *clone() const#

virtual copy constructor for Geometry

inline virtual Polygon *clonePG() const#

virtual copy constructor for Polygon

inline virtual Surface *cloneS() const#

virtual copy constructor for Surface

Vector<real_t> duffyParametrization(const Point &pt, Parameters &pars, DiffOpType d = _id) const#

duffy parametrization on [0,1]x[0,1]

Duffy parametrization: p=(1-u)*p1+u(1-v)*p2+uv*p3 with 0<= u,v <=1 u=0, 0<=v<=1 -> p1 u=1, 0<=v<=1 -> [p2,p3] v=0, 0<=u<=1 -> [p1,p2] v=1, 0<=u<=1 -> [p1,p3].

Vector<real_t> funParametrization(const Point &pt, Parameters &pars, DiffOpType d = _id) const#

barycentric parametrization (1-u-v)*p1+u*p2+v*p3

parametrization (P1) : p = (1-u-v)*p1+u*p2+v*p3 = p1+u*(p2-p1)+v*(p3-p1) with 0<= u+v <=1

inline virtual Triangle &homothetize(const Parameter &p1)#

apply a homothety on a Triangle (1 key)

inline virtual Triangle &homothetize(const Parameter &p1, const Parameter &p2)#

apply a homothety on a Triangle (2 keys)

inline virtual Triangle &homothetize(const Point &c = Point(0., 0., 0.), real_t factor = 1.)#

apply a homothety on a Triangle

inline virtual Triangle &homothetize(real_t factor)#

apply a homothety on a Triangle

Vector<real_t> invDuffyParametrization(const Point &pt, Parameters &pars, DiffOpType d = _id) const#

inverse of duffy parametrization u,v)=invf(p)

inverse of Duffy parametrization u =( p-p1).o32 / (p2-p1).o32 with o32 any orthogonal vector to p3-p2 uv = (p-p1).o21 / (p3-p2).o21 with o21 any orthogonal vector to p2-p if p=p1 then u=0 and v may be anything

Vector<real_t> invParametrization(const Point &pt, Parameters &pars, DiffOpType d = _id) const#

inverse of barycentric parametrization (u,v)=invf(p)

inverse of parametrization (u,v)=invf(p)

virtual real_t measure() const#

return the length/area/volume of the geometry

inline virtual std::vector<number_t> nbElementsForGmshGeneration() const#

return number of points/arcs/lines/loops/surfaces/extrudable elements of a geometry (only for gmsh generation)

inline virtual number_t nbSides() const#

returns the number of sides return number of points/arcs/lines/loops/surfaces/extrudable elementsof a geometry (only for gmsh generation)

inline virtual Triangle &pointReflect(const Parameter &p1)#

apply a point reflection on a Triangle (1 key)

inline virtual Triangle &pointReflect(const Point &c = Point(0., 0., 0.))#

apply a point reflection on a Triangle

inline virtual Triangle &reflect2d(const Parameter &p1)#

apply a reflection2d on a Triangle (1 key)

inline virtual Triangle &reflect2d(const Parameter &p1, const Parameter &p2)#

apply a reflection2d on a Triangle (2 keys)

inline virtual Triangle &reflect2d(const Point &c, real_t dx, real_t dy = 0.)#

apply a reflection2d on a Triangle

inline virtual Triangle &reflect2d(const Point &c = Point(0., 0.), std::vector<real_t> d = std::vector<real_t>(2, 0.))#

apply a reflection2d on a Triangle

inline virtual Triangle &reflect3d(const Parameter &p1)#

apply a reflection3d on a Triangle (1 key)

inline virtual Triangle &reflect3d(const Parameter &p1, const Parameter &p2)#

apply a reflection3d on a Triangle (2 keys)

inline virtual Triangle &reflect3d(const Point &c, real_t nx, real_t ny, real_t nz = 0.)#

apply a reflection3d on a Triangle

inline virtual Triangle &reflect3d(const Point &c = Point(0., 0., 0.), std::vector<real_t> n = std::vector<real_t>(3, 0.))#

apply a reflection3d on a Triangle

inline virtual Triangle &rotate2d(const Parameter &p1)#

apply a rotation 2D on a Triangle (1 key)

inline virtual Triangle &rotate2d(const Parameter &p1, const Parameter &p2)#

apply a rotation 2D on a Triangle (2 keys)

inline virtual Triangle &rotate2d(const Point &c, real_t angle = 0.)#

apply a rotation 2D on a Triangle

inline virtual Triangle &rotate3d(const Parameter &p1)#

apply a rotation 3D on a Triangle (1 key)

inline virtual Triangle &rotate3d(const Parameter &p1, const Parameter &p2)#

apply a rotation 3D on a Triangle (2 keys)

inline virtual Triangle &rotate3d(const Parameter &p1, const Parameter &p2, const Parameter &p3)#

apply a rotation 3D on a Triangle (3 keys)

inline virtual Triangle &rotate3d(const Point &c, real_t dx, real_t dy, real_t angle)#

apply a rotation on a Triangle

inline virtual Triangle &rotate3d(const Point &c, real_t dx, real_t dy, real_t dz, real_t angle)#

apply a rotation on a Triangle

inline virtual Triangle &rotate3d(const Point &c, std::vector<real_t> d = std::vector<real_t>(3, 0.), real_t angle = 0.)#

apply a rotation 3D on a Triangle

inline virtual Triangle &rotate3d(real_t dx, real_t dy, real_t angle)#

apply a rotation 3D on a Triangle

inline virtual Triangle &rotate3d(real_t dx, real_t dy, real_t dz, real_t angle)#

apply a rotation 3D on a Triangle

virtual std::vector<std::pair<ShapeType, std::vector<const Point*>>> surfs() const#

return list of surfaces (const)

virtual Triangle &transform(const Transformation &t)#

apply a geometrical transformation on a Triangle

inline virtual Triangle &translate(const Parameter &p1)#

apply a translation on a Triangle (1 key)

inline virtual Triangle &translate(real_t ux, real_t uy = 0., real_t uz = 0.)#

apply a translation on a Triangle (3 reals version)

inline virtual Triangle &translate(std::vector<real_t> u)#

apply a translation on a Triangle (vector version)

inline virtual Triangle *triangle()#

access to child Triangle object

inline virtual const Triangle *triangle() const#

access to child Triangle object (const)