Class xlifepp::Polygon#

class Polygon : public xlifepp::Surface#

definition of a polygonal geometry in R^3

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

  • _vertices: the vertices defining the polygon, oriented along the boundary (clockwise or counterclockwise)

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

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

  • _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

Subclassed by xlifepp::Quadrangle, xlifepp::Triangle

Public Functions

Polygon()#

default constructor

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

Polygon(const std::vector<Point> &vertices, const std::vector<number_t> &n = std::vector<number_t>(4, 2), const string_t &domName = string_t(), const std::vector<string_t> &sideNames = std::vector<string_t>(4, ""), const std::vector<string_t> &sideOfSideNames = std::vector<string_t>(4, ""))#

default constructor with vertices

Polygon(const std::vector<Point> &vertices, const std::vector<real_t> &h, const string_t &domName = string_t(), const std::vector<string_t> &sideNames = std::vector<string_t>(4, ""), const std::vector<string_t> &sideOfSideNames = std::vector<string_t>(4, ""))#

default constructor with vertices

Polygon(Parameter p1)#

key-value constructor

inline virtual ~Polygon()#

destructor

virtual string_t asString() const#

format as string

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

returns list of nodes on boundary (const)

virtual Geometry &buildBoundary() const#

create boundary geometry

create boundary geometry of polygons

virtual Point centroid() const#

return centroid of polygon

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

virtual void collect(const string_t &n, std::list<Geometry*>&) const#

collect in a list all canonical geometry’s with name n

collect in a list all canonical geometry’s with name n (may be the polygon itself and some polygon sides)

virtual void computeMB()#

computes the minimal box

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

return list of edges (const)

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

apply a homothety on a Polygon (1 key)

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

apply a homothety on a Polygon (2 keys)

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

apply a homothety on a Polygon

inline virtual Polygon &homothetize(real_t factor)#

apply a homothety on a Polygon

inline virtual bool isPlane() const#

return true if geometry is plane

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<int_t> nnodesPerBorder()#

i-th value is nnodes of the Geometry’s i-th border, else -1 if defined with hsteps

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 Polygon &pointReflect(const Parameter &p1)#

apply a point reflection on a Polygon (1 key)

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

apply a point reflection on a Polygon

inline virtual Polygon *polygon()#

access to child Polygon object

inline virtual const Polygon *polygon() const#

access to child Polygon object (const)

virtual void printDetail(std::ostream &os) const#

print more infos

print additional information

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

apply a reflection2d on a Polygon (1 key)

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

apply a reflection2d on a Polygon (2 keys)

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

apply a reflection2d on a Polygon

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

apply a reflection2d on a Polygon

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

apply a reflection3d on a Polygon (1 key)

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

apply a reflection3d on a Polygon (2 keys)

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

apply a reflection3d on a Polygon

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

apply a reflection3d on a Polygon

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

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

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

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

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

apply a rotation 2D on a Polygon

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

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

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

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

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

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

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

apply a rotation on a Polygon

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

apply a rotation on a Polygon

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

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

apply a rotation 3D on a Polygon

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

apply a rotation 3D on a Polygon

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

return list of surfaces (const)

virtual Polygon &transform(const Transformation &t)#

apply a geometrical transformation on a Polygon

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

apply a translation on a Polygon (1 key)

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

apply a translation on a Polygon (3 reals version)

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

apply a translation on a Polygon (vector version)

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

returns list of vertices (const)