xc
QuadSectRegion.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 //QuadSectRegion.h
29 // Written by Remo M. de Souza
30 // December 1998
31 
32 #ifndef QuadSectRegion_h
33 #define QuadSectRegion_h
34 
35 #include <material/section/repres/section_geometry/region/QuadCellRegion.h>
36 #include "utility/matrix/Matrix.h"
37 
38 class Quadrilateral2d;
39 
40 namespace XC {
41 
42 // Vertices order: I->J->K->L.
43 //
44 // L +---+---+---+---+ K
45 // | | | | |
46 // +---+---+---+---+ nDivJK= 2
47 // | | | | |
48 // I +---+---+---+---+ J
49 // nDivIJ= 4
50 
52 //
55  {
56  private:
57  Matrix vertCoord;
58  public:
59  QuadSectRegion(Material *mat= nullptr);
60  QuadSectRegion(Material *, int numSubdivIJ, int numSubdivJK, const Matrix &vertexCoords);
61 
62  // edition functions
63  void setVertCoords(const Matrix &vertexCoords);
64 
65  int setTileSizeIJ(const double &size);
66  int setTileSizeJK(const double &size);
67  int setTileSize(const double &sizeIJ, const double &sizeJK);
68 
69  const Grid2d &getMesh(void) const;
70  const VectorCells &getCells(void) const;
71  SectRegion *getCopy(void) const;
72 
73  const Matrix &getVertCoords(void) const;
74  double getMaxY(void) const;
75  double getMaxZ(void) const;
76  Pos2d getPMax(void) const;
77  void setPMax(const Pos2d &);
78  double getMinY(void) const;
79  double getMinZ(void) const;
80  Pos2d getPMin(void) const;
81  void setPMin(const Pos2d &);
82  Pos2d getIVertex(void) const;
83  Pos2d getJVertex(void) const;
84  Pos2d getKVertex(void) const;
85  Pos2d getLVertex(void) const;
86  void setVertices(const Pos2d &vI, const Pos2d &vJ, const Pos2d &vK, const Pos2d &vL);
87  Quadrilateral2d getQuad(void) const;
88  void setQuad(const Quadrilateral2d &);
89  void setPolygon(const Polygon2d &);
90  Polygon2d getPolygon(void) const;
91  void swap(void);
92 
93 
94  void Print(std::ostream &s, int flag =0) const;
95  friend std::ostream &operator<<(std::ostream &, QuadSectRegion &);
96  };
97 
98 std::ostream &operator<<(std::ostream &, QuadSectRegion &);
99 } // end of XC namespace
100 
101 
102 #endif
103 
104 
SectRegion * getCopy(void) const
Returns a copy of the region.
Definition: QuadSectRegion.cc:288
Pos2d getJVertex(void) const
Returns position of J vertex.
Definition: QuadSectRegion.cc:155
Pos2d getPMax(void) const
Returns upper right corner.
Definition: QuadSectRegion.cc:121
Pos2d getIVertex(void) const
Returns position of I vertex.
Definition: QuadSectRegion.cc:151
int setTileSizeIJ(const double &size)
Sets numbers of divisions to get a tile IJ side smaller than size.
Definition: QuadSectRegion.cc:61
Posición en dos dimensiones.
Definition: Pos2d.h:41
Region of a section that creates quadrilateral cells.
Definition: QuadCellRegion.h:51
Base class for materials.
Definition: Material.h:93
void setQuad(const Quadrilateral2d &)
Assigns vertex coordinates from the given quadrilateral.
Definition: QuadSectRegion.cc:190
void setPMax(const Pos2d &)
Sets upper right corner.
Definition: QuadSectRegion.cc:125
Quadrilateral2d getQuad(void) const
Returns a quadrilateral object (geometry).
Definition: QuadSectRegion.cc:167
int setTileSize(const double &sizeIJ, const double &sizeJK)
Sets numbers of divisions to get tile sizes smaller than sizeIJ and sizeJK.
Definition: QuadSectRegion.cc:79
Quad that discretizes in quad cells.
Definition: QuadSectRegion.h:54
Polígono en dos dimensiones.
Definition: Polygon2d.h:38
Grid in a two-dimensional space.
Definition: Grid2d.h:32
Pos2d getPMin(void) const
Returns lower left corner.
Definition: QuadSectRegion.cc:136
void setPolygon(const Polygon2d &)
Assigns vertex coordinates from the given polygon.
Definition: QuadSectRegion.cc:198
Polygon2d getPolygon(void) const
Return the region contour.
Definition: QuadSectRegion.cc:214
void setPMin(const Pos2d &)
Sets upper right corner.
Definition: QuadSectRegion.cc:140
const Grid2d & getMesh(void) const
Generate mesh and return a reference to it.
Definition: QuadSectRegion.cc:226
Region of a section that corresponds with a material.
Definition: SectRegion.h:58
const VectorCells & getCells(void) const
Returns the cell container.
Definition: QuadSectRegion.cc:229
void setVertices(const Pos2d &vI, const Pos2d &vJ, const Pos2d &vK, const Pos2d &vL)
Assing the vertices from the given points.
Definition: QuadSectRegion.cc:181
Quadrilateral on a bi-dimensional space.
Definition: Quadrilateral2d.h:44
Pos2d getLVertex(void) const
Returns position of L vertex.
Definition: QuadSectRegion.cc:163
Cells vector.
Definition: VectorCells.h:42
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Matrix of floats.
Definition: Matrix.h:111
int setTileSizeJK(const double &size)
Sets numbers of divisions to get a tile JK side smaller than size.
Definition: QuadSectRegion.cc:70
Pos2d getKVertex(void) const
Returns position of K vertex.
Definition: QuadSectRegion.cc:159