xc
Pos3dArray.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 //Pos3dArray
22 
23 #ifndef POS3DARRAY_H
24 #define POS3DARRAY_H
25 
26 #include "Pos3d.h"
27 #include "PosArray.h"
28 
29 class Triangle3d;
30 class Quadrilateral3d;
31 class BND3d;
32 class Trf3d;
33 class Revolution3d;
34 
36 //
38 class Pos3dArray: public PosArray<Pos3d>
39  {
40  Pos3dArray(const PosArray<Pos3d> &mp3d);
41  friend class Pos3dArray3d;
42  Pos3d 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  public:
46  Pos3dArray(const size_t &f=1,const size_t &c=1,const Pos3d &p= Pos3d());
47  Pos3dArray(const Pos3d &p1,const Pos3d &p2,const size_t &num,const GEOM_FT &ratio);
48  Pos3dArray(const Pos3d &p1,const Pos3d &p2,const size_t &ndiv);
49  Pos3dArray(const Pos3d &p1,const Pos3d &p2,const std::vector<GEOM_FT> &longs);
50  Pos3dArray(const Pos3d &p0,const Pos3d &p1,const Pos3d &p2,const size_t &ndiv1,const size_t &ndiv2);
51  Pos3dArray(const Pos3dArray &l1_points,const Pos3dArray &l2_points,const Pos3dArray &l3_points,const Pos3dArray &l4_points);
52  Pos3dArray(const Pos3d &p1,const Pos3d &p2,const Pos3d &p3,const Pos3d &p4,const size_t &ndiv1,const size_t &ndiv2);
53  Pos3d getCenter(void) const;
54  Triangle3d getTriangle1(const size_t &i,const size_t &j) const;
55  Triangle3d getTriangle2(const size_t &i,const size_t &j) const;
56  GEOM_FT Lagrange(const GEOM_FT &tol);
57  void Transform(const Trf3d &trf);
58 
59  size_t getNumQuads(void) const;
60  Quadrilateral3d getQuad(const size_t &i,const size_t &j) const;
61  double getQuadArea(const size_t &i,const size_t &j) const;
62  Pos3d getQuadCentroid(const size_t &i,const size_t &j) const;
63  Vector3d getQuadNormal(const size_t &i,const size_t &j) const;
64  std::vector<Pos3d> getQuadCentroids(void) const;
65  boost::python::list getQuadCentroidsPy(void) const;
66  std::vector<double> getQuadAreas(void) const;
67  boost::python::list getQuadAreasPy(void) const;
68  std::vector<Vector3d> getQuadNormals(void) const;
69  boost::python::list getQuadNormalsPy(void) const;
70  };
71 
72 GEOM_FT dist2(const Pos3dArray &ptos,const Pos3d &pt);
73 bool dist_menor(const Pos3dArray &ptos,const Pos3d &pt,const GEOM_FT &d_max);
74 GEOM_FT dist(const Pos3dArray &ptos,const Pos3d &pt);
75 GEOM_FT pseudo_dist2(const Pos3dArray &ptos,const Pos3d &pt);
76 GEOM_FT pseudo_dist(const Pos3dArray &ptos,const Pos3d &pt);
77 
78 BND3d get_bnd(const Pos3dArray &ptos);
79 
80 Pos3dArray create_revolution_surface(const Revolution3d &r,const Pos3dArray &m);
81 Pos3dArray Quadrilateral(const Pos3d &p1,const Pos3d &p2,const Pos3d &p3,const Pos3d &p4,const size_t &ndiv1,const size_t &ndiv2);
82 
83 #endif
std::vector< Vector3d > getQuadNormals(void) const
Return the positions of the quad normals.
Definition: Pos3dArray.cc:432
boost::python::list getQuadNormalsPy(void) const
Return the positions of the quad normals in a Python list.
Definition: Pos3dArray.cc:449
Plane quadrilateral in a 3D space.
Definition: Quadrilateral3d.h:35
Array of positions in a three-dimensional space.
Definition: Pos3dArray.h:38
size_t getNumQuads(void) const
Return the number of quadrilaterals in the grid.
Definition: Pos3dArray.cc:361
std::vector< Pos3d > getQuadCentroids(void) const
Return the positions of the quad centroids.
Definition: Pos3dArray.cc:365
Triangle3d 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: Pos3dArray.cc:140
double getQuadArea(const size_t &i, const size_t &j) const
Return the area of the quad at i,j:
Definition: Pos3dArray.cc:346
Quadrilateral3d getQuad(const size_t &i, const size_t &j) const
Return the i,j quadrilateral:
Definition: Pos3dArray.cc:335
boost::python::list getQuadCentroidsPy(void) const
Return the positions of the quad centroids in a Python list.
Definition: Pos3dArray.cc:382
Vector3d getQuadNormal(const size_t &i, const size_t &j) const
Return the normal of the quad at i,j:
Definition: Pos3dArray.cc:428
Triangle3d 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: Pos3dArray.cc:152
boost::python::list getQuadAreasPy(void) const
Return the quad areas in a Python list.
Definition: Pos3dArray.cc:410
Triangle in a three-dimensional space.
Definition: Triangle3d.h:34
"boundary" en tres dimensiones.
Definition: BND3d.h:34
GEOM_FT Lagrange(const GEOM_FT &tol)
Set the interior points of the mesh corresponding to the Lagrange interpolation (see page IX-19 of th...
Definition: Pos3dArray.cc:99
void Transform(const Trf3d &trf)
Applies the transformation argument to the matrix.
Definition: Pos3dArray.cc:119
Revolution transformation.
Definition: Revolution3d.h:37
Pos3d getQuadCentroid(const size_t &i, const size_t &j) const
Return the centroid of the quad at i,j:
Definition: Pos3dArray.cc:357
Base class for position matrices used to represent grids of points.
Definition: PosArray.h:37
std::vector< double > getQuadAreas(void) const
Return the areas of the grid quads.
Definition: Pos3dArray.cc:393
Position array in a three-dimensional space.
Definition: Pos3dArray3d.h:37
Base class for quadrilateral domains.
Definition: ShapeFunction.h:181
Posición en tres dimensiones.
Definition: Pos3d.h:44
Three-dimensional transformation.
Definition: Trf3d.h:39
Vector en tres dimensiones.
Definition: Vector3d.h:39