xc
Quadrilateral2d.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 //Quadrilateral2d.h
22 
23 #ifndef QUADRILATERAL2D_H
24 #define QUADRILATERAL2D_H
25 
26 #include "Polygon2d.h"
27 #include <tuple>
28 
29 class Triangle2d;
30 class Pos2dArray;
31 
32 // Vertex order: 1->2->3->4.
33 //
34 // 4 +---------------+ 3
35 // | |
36 // | |
37 // | |
38 // 1 +---------------+ 2
39 
40 
42 //
45  {
46  public:
47  Quadrilateral2d(void);
48  Quadrilateral2d(const Pos2d &p1,const Pos2d &p2,const Pos2d &p3,const Pos2d &p4);
49 
50  virtual GeomObj *getCopy(void) const
51  { return new Quadrilateral2d(*this); }
52  void push_back(const Pos2d &);
53 
54  std::vector<double> getNaturalCoordinates(const Pos2d &) const;
55  std::vector<std::vector<double> > getNaturalCoordinates(const std::list<Pos2d> &) const;
56  boost::python::list getNaturalCoordinatesPy(const boost::python::list &) const;
57  std::vector<double> Ni(const Pos2d &) const;
58  std::vector<std::vector<double> > Ni(const std::list<Pos2d> &) const;
59  boost::python::list NiPy(const Pos2d &) const;
60  boost::python::list NiPy(const boost::python::list &) const;
61  Pos2d getMidpoint(void) const;
62 
63  Triangle2d getFirstTriangle(void) const;
64  Triangle2d getSecondTriangle(void) const;
65  Pos2dArray genMesh(int n1,int n2) const;
66  Pos2dArray genBilinMesh(const size_t &n1,const size_t &n2) const;
67  };
68 #endif
Triangle in a two-dimensional space.
Definition: Triangle2d.h:38
Quadrilateral2d(void)
Default constructor.
Definition: Quadrilateral2d.cc:38
Pos2dArray genBilinMesh(const size_t &n1, const size_t &n2) const
Returns a point grid (the routine is taken from OpenSees).
Definition: Quadrilateral2d.cc:327
Pos2dArray genMesh(int n1, int n2) const
Returns a point grid.
Definition: Quadrilateral2d.cc:317
Pos2d getMidpoint(void) const
Return the intersection between the lines that join the midpoints of the quadrilateral sides...
Definition: Quadrilateral2d.cc:279
Posición en dos dimensiones.
Definition: Pos2d.h:41
Array of positions in a two-dimensional space.
Definition: Pos2dArray.h:38
std::vector< double > getNaturalCoordinates(const Pos2d &) const
Return natural coordinates for point xy (in cartesian coord.) based on $ 23.6 from Felippa book:"Intr...
Definition: Quadrilateral2d.cc:71
virtual GeomObj * getCopy(void) const
Constructor virtual.
Definition: Quadrilateral2d.h:50
Polígono en dos dimensiones.
Definition: Polygon2d.h:38
Quadrilateral on a bi-dimensional space.
Definition: Quadrilateral2d.h:44
boost::python::list NiPy(const Pos2d &) const
Return a Python list containing the values of the shape functions for the point argument.
Definition: Quadrilateral2d.cc:207
boost::python::list getNaturalCoordinatesPy(const boost::python::list &) const
Return natural coordinates for points xy (in cartesian coord.)
Definition: Quadrilateral2d.cc:161
std::vector< double > Ni(const Pos2d &) const
Return the values of the shape functions for the point argument.
Definition: Quadrilateral2d.cc:186
void push_back(const Pos2d &)
Back inserter.
Definition: Quadrilateral2d.cc:57
Clase base para las entidades geométricas.
Definition: GeomObj.h:40