Class xlifepp::Segment#

class Segment : public xlifepp::Curve#

definition of a segment geometry in R^3

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

  • _xmin, _xmax: to define a Segment along the x axis

  • _v1, _v2: to define a Segment from its bounds

  • _nnodes: to define the number of nodes on the Segment

  • _hsteps: to define the local mesh steps on the bounds of a Segment

  • _domain_name: to define the domain name

  • _side_names/_vertex_names: to define the side names

  • _varnames: to define the variable names for print purpose

Public Functions

Segment()#

default constructor

default is segment [0,1]

Segment(const Segment&)#

copy constructor

Segment(Parameter p1, Parameter p2)#

key-value constructor

inline virtual ~Segment()#

destructor

virtual string_t asString() const#

format as string

inline virtual Geometry *clone() const#

virtual copy constructor for Geometry

inline virtual void computeMB()#

computes the minimal box

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

returns list of curves (const)

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

parametrization (1-t)*p1+t*p2

inverse of parametrization t=(p-p1|p2-p1)/|p2-p1|^2

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

apply a homothety on a Segment (1 key)

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

apply a homothety on a Segment (2 keys)

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

apply a homothety on a Segment

inline virtual Segment &homothetize(real_t factor)#

apply a homothety on a Segment

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

inverse of parametrization t=(p-p1|p2-p1)/|p2-p1|^2

inline virtual bool isPlane() const#

return true if geometry is plane

bool isTranslated(const Geometry &g, Point &T)#

rue if current is translated from g, T the translation vector

true if current is translated from g, T the translation vector

inline 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)

virtual std::vector<Point*> nodes()#

returns list of every node (non const)

virtual std::vector<const Point*> nodes() const#

returns list of every node (const)

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

apply a point reflection on a Segment (1 key)

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

apply a point reflection on a Segment

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

apply a reflection2d on a Segment (1 key)

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

apply a reflection2d on a Segment (2 keys)

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

apply a reflection2d on a Segment

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

apply a reflection2d on a Segment

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

apply a reflection3d on a Segment (1 key)

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

apply a reflection3d on a Segment (2 keys)

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

apply a reflection3d on a Segment

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

apply a reflection3d on a Segment

Segment &reverse()#

reverse orientation of segment

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

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

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

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

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

apply a rotation 2D on a Segment

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

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

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

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

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

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

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

apply a rotation on a Segment

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

apply a rotation on a Segment

inline virtual Segment &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 Segment

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

apply a rotation 3D on a Segment

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

apply a rotation 3D on a Segment

inline virtual Segment *segment()#

access to child Segment object

inline virtual const Segment *segment() const#

access to child Segment object (const)

virtual Segment &transform(const Transformation &t)#

apply a geometrical transformation on a Segment

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

apply a translation on a Segment (1 key)

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

apply a translation on a Segment (3 reals version)

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

apply a translation on a Segment (vector version)