xc
Pos2dArray.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. Pérez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //Pos2dArray
22 
23 #ifndef POS2DARRAY_H
24 #define POS2DARRAY_H
25 
26 #include "Pos2d.h"
27 #include "PosArray.h"
28 
29 class Triangle2d;
30 class Quadrilateral2d;
31 class FT_matrix;
32 class Trf2d;
33 
34 
36 //
38 class Pos2dArray: public PosArray<Pos2d>
39  {
40  friend class Pos2dArray3d;
41  typedef PosArray<Pos2d> m_pos;
42  Pos2d pos_lagrangiana(const size_t &i,const size_t &j) const;
43  GEOM_FT dist_lagrange(void) const;
44  GEOM_FT ciclo_lagrange(void);
45 
46  public:
47  Pos2dArray(const size_t &f=1,const size_t &c=1,const Pos2d &p=Pos2d()): m_pos(f,c,p) {}
48  Pos2dArray(const Pos2d &p1,const Pos2d &p2,const size_t &num,const GEOM_FT &ratio);
49  Pos2dArray(const Pos2d &p1,const Pos2d &p2,const size_t &ndiv);
50  Pos2dArray(const Pos2d &p1,const Pos2d &p2,const std::vector<GEOM_FT> &longs);
51  Pos2dArray(const Pos2d &p0,const Pos2d &p1,const Pos2d &p2,const size_t &ndiv1,const size_t &ndiv2);
52  Pos2dArray(const Pos2dArray &,const Pos2dArray &,const Pos2dArray &,const Pos2dArray &);
53 
54  size_t GetNumQuads(void) const;
55  GEOM_FT GetMax(unsigned short int i) const;
56  GEOM_FT GetMin(unsigned short int i) const;
57  GEOM_FT getIx(void) const;
58  GEOM_FT getIy(void) const;
59  GEOM_FT GetPxy(void) const;
60  GEOM_FT Ix(void) const;
61  GEOM_FT Iy(void) const;
62  GEOM_FT Pxy(void) const;
63  Pos2d getCenter(void) const;
64  Pos2d getCenterOfMass(void) const;
65  GEOM_FT GetArea(void) const;
66  Triangle2d getTriangle1(const size_t &i,const size_t &j) const;
67  Triangle2d getTriangle2(const size_t &i,const size_t &j) const;
68  GEOM_FT GetX(const size_t &,const size_t &) const;
69  GEOM_FT GetY(const size_t &,const size_t &) const;
70  const FT_matrix &GetVertCoords(const size_t &,const size_t &) const;
71  Pos2d getPoint(const size_t &,const size_t &) const;
72  Quadrilateral2d GetQuad(const size_t &i,const size_t &j) const;
73  double GetAreaQuad(const size_t &i,const size_t &j) const;
74  Pos2d getQuadCentroid(const size_t &i,const size_t &j) const;
75  std::vector<Pos2d> getQuadCentroids(void) const;
76  boost::python::list getQuadCentroidsPy(void) const;
77  std::vector<double> getQuadAreas(void) const;
78  boost::python::list getQuadAreasPy(void) const;
79  bool In(const Pos2d &, const double &) const;
80 
81  void Transform(const Trf2d &trf2d);
82 
83  GEOM_FT Lagrange(const GEOM_FT &tol);
84  };
85 
86 #endif
std::vector< Pos2d > getQuadCentroids(void) const
Return the positions of the quad centroids.
Definition: Pos2dArray.cc:300
Triangle in a two-dimensional space.
Definition: Triangle2d.h:38
GEOM_FT Lagrange(const GEOM_FT &tol)
Set the interior points of the mesh corresponding to Lagrange interpolation (see page IX-19 from SAP9...
Definition: Pos2dArray.cc:88
GEOM_FT GetPxy(void) const
Return el product of inertia with respect to the axis that pass through the origin.
Definition: Pos2dArray.cc:168
Posición en dos dimensiones.
Definition: Pos2d.h:41
boost::python::list getQuadAreasPy(void) const
Return the quad areas in a Python list.
Definition: Pos2dArray.cc:345
GEOM_FT getIy(void) const
Return the moment of inertia with respect to the axis which is parallel to the y axis through the ori...
Definition: Pos2dArray.cc:135
Triangle2d getTriangle1(const size_t &i, const size_t &j) const
Return the triangle inscribed in the cell of the mesh the has the (i,j) vertex as lower left corner a...
Definition: Pos2dArray.cc:216
const FT_matrix & GetVertCoords(const size_t &, const size_t &) const
Return the coordinates of the i,j point.
Definition: Pos2dArray.cc:241
size_t GetNumQuads(void) const
Return the number of quadrilaterals in the grid.
Definition: Pos2dArray.cc:72
Base class for two-dimensional transformations.
Definition: Trf2d.h:40
Quadrilateral2d GetQuad(const size_t &i, const size_t &j) const
Return the i,j quadrilateral:
Definition: Pos2dArray.cc:260
void Transform(const Trf2d &trf2d)
Applies the transformation to the points.
Definition: Pos2dArray.cc:376
Array of positions in a two-dimensional space.
Definition: Pos2dArray.h:38
GEOM_FT getIx(void) const
Return el moment of inertia with respect to axis parallel to x por el origen.
Definition: Pos2dArray.cc:151
GEOM_FT Ix(void) const
Moment of inertia with respect to axis parallel to x through the center of mass.
Definition: Pos2dArray.cc:193
Pos2d getQuadCentroid(const size_t &i, const size_t &j) const
Return the centroid of the quad at i,j:
Definition: Pos2dArray.cc:296
Pos2d getCenterOfMass(void) const
Return the center of mass.
Definition: Pos2dArray.cc:112
GEOM_FT Iy(void) const
Moment of inertia with respect to the center of mass in local coordinates.
Definition: Pos2dArray.cc:197
double GetAreaQuad(const size_t &i, const size_t &j) const
Return the area of the quad at i,j:
Definition: Pos2dArray.cc:285
GEOM_FT GetX(const size_t &, const size_t &) const
Return the x coordinate of point i,j.
Definition: Pos2dArray.cc:233
Base class for position matrices used to represent grids of points.
Definition: PosArray.h:37
Triangle2d getTriangle2(const size_t &i, const size_t &j) const
Return the triangle inscribed in the cell of the mesh the has the (i,j) vertex as lower left corner a...
Definition: Pos2dArray.cc:228
Pos2d getPoint(const size_t &, const size_t &) const
Return the point i,j.
Definition: Pos2dArray.cc:251
Array of positions ina two-dimensional space.
Definition: Pos2dArray3d.h:35
Quadrilateral on a bi-dimensional space.
Definition: Quadrilateral2d.h:44
GEOM_FT GetMin(unsigned short int i) const
Return the minimum value of the k coordinate.
Definition: Pos2dArray.cc:366
Pos2d getCenter(void) const
Return the position of the midpoint.
Definition: Pos2dArray.cc:108
std::vector< double > getQuadAreas(void) const
Return the areas of the grid quads.
Definition: Pos2dArray.cc:328
GEOM_FT GetY(const size_t &, const size_t &) const
Return the y coordinate of point i,j.
Definition: Pos2dArray.cc:237
GEOM_FT GetMax(unsigned short int i) const
Return the maximum value of the k coordinate.
Definition: Pos2dArray.cc:356
Matrix which components are GEOM_FT numbers.
Definition: FT_matrix.h:40
boost::python::list getQuadCentroidsPy(void) const
Return the positions of the quad centroids in a Python list.
Definition: Pos2dArray.cc:317
GEOM_FT Pxy(void) const
product of inertia with respect to the center of mass in local coordinates.
Definition: Pos2dArray.cc:201