xc
RegionContainer.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 //RegionContainer.h
29 
30 #ifndef RegionContainer_h
31 #define RegionContainer_h
32 
33 #include <list>
34 #include <set>
35 #include "material/section/repres/SectionMassProperties.h"
36 
37 class Pos2d;
38 class BND2d;
39 class Polygon2d;
40 class HalfPlane2d;
41 
42 namespace XC {
43 class Material;
44 class SectRegion;
45 class QuadSectRegion;
46 class CircularSectRegion;
47 class MaterialHandler;
48 class Vector;
49 class Matrix;
50 
52 //
54 class RegionContainer: protected std::list<SectRegion *>, public SectionMassProperties
55  {
56  public:
57  typedef std::list<SectRegion *> l_reg;
58  typedef l_reg::reference reference;
59  typedef l_reg::const_reference const_reference;
60  typedef l_reg::iterator iterator;
61  typedef l_reg::const_iterator const_iterator;
62  private:
63  void free_mem(void);
64  void free_mem(const size_t i);
65  void copy(const RegionContainer &other);
66  protected:
67 
69  public:
70 
74  ~RegionContainer(void);
75 
76  XC::SectRegion *push_back(const SectRegion &reg);
77  inline size_t size(void) const
78  { return l_reg::size(); }
79  inline bool empty(void) const
80  { return l_reg::empty(); }
81 
82  void clear(void);
83 
84  const_iterator begin(void) const;
85  const_iterator end(void) const;
86  iterator begin(void);
87  iterator end(void);
88 
89  QuadSectRegion *newQuadRegion(const std::string &);
90  CircularSectRegion *newCircularRegion(const std::string &);
91 
92  size_t getNumCells(void) const;
93 
94  std::set<const Material *>getMaterials(void) const;
95  std::set<Material *>getMaterials(void);
96  boost::python::list getMaterialsPy(void);
97 
98  boost::python::list getRegionsContoursPy(void) const;
99  std::list<Polygon2d> getRegionsContours(void) const;
100  std::list<Polygon2d> getContours(void) const;
101  BND2d getBnd(void) const;
102  RegionContainer Intersection(const HalfPlane2d &) const;
103 
104  double getAreaGrossSection(void) const;
106  double getIyGrossSection(void) const;
107  double getIzGrossSection(void) const;
108  double getPyzGrossSection(void) const;
109 
110  Vector getCenterOfMassHomogenizedSection(const double &E0) const;
111  double getAreaHomogenizedSection(const double &E0) const;
112  double getIyHomogenizedSection(const double &E0) const;
113  double getIzHomogenizedSection(const double &E0) const;
114  double getPyzHomogenizedSection(const double &E0) const;
115 
116  void Print(std::ostream &s) const;
117  };
118 
119 std::ostream &operator<<(std::ostream &,const RegionContainer &);
120 
121 } // end of XC namespace
122 
123 
124 #endif
Circular shaped patch.
Definition: CircularSectRegion.h:46
"boundary" en dos dimensiones.
Definition: BND2d.h:38
Float vector abstraction.
Definition: Vector.h:94
boost::python::list getRegionsContoursPy(void) const
Return the contours of the regions in a Python list.
Definition: RegionContainer.cc:192
double getPyzHomogenizedSection(const double &E0) const
Returns homogenized product of inertia of the cross-section with respect to the axis parallel to y an...
Definition: RegionContainer.cc:446
double getIzGrossSection(void) const
Returns the moment of inertia of the gross cross-section with respect to the axis parallel to z axis ...
Definition: RegionContainer.cc:293
Section composed of some regions.
Definition: RegionContainer.h:54
Posición en dos dimensiones.
Definition: Pos2d.h:41
boost::python::list getMaterialsPy(void)
Return a Python list of pointers to the different region materials.
Definition: RegionContainer.cc:175
double getIyGrossSection(void) const
Returns the moment of inertia of the gross cross-section with respect to the axis parallel to y passi...
Definition: RegionContainer.cc:279
double getAreaHomogenizedSection(const double &E0) const
Returns the homogenized area of the regions.
Definition: RegionContainer.cc:323
std::list< Polygon2d > getRegionsContours(void) const
Returns a list with the regions contours.
Definition: RegionContainer.cc:203
CircularSectRegion * newCircularRegion(const std::string &)
Aggregates a new circularl region.
Definition: RegionContainer.cc:95
std::list< Polygon2d > getContours(void) const
Return the regions contours.
Definition: RegionContainer.cc:212
XC::SectRegion * push_back(const SectRegion &reg)
Adds a region to the container.
Definition: RegionContainer.cc:118
double getAreaGrossSection(void) const
Returns the regions area.
Definition: RegionContainer.cc:246
QuadSectRegion * newQuadRegion(const std::string &)
Aggregates a new quadrilateral region.
Definition: RegionContainer.cc:80
BND2d getBnd(void) const
Return the regions boundary-.
Definition: RegionContainer.cc:219
MaterialHandler * material_handler
Material definition handler (searching,...).
Definition: RegionContainer.h:68
void Print(std::ostream &s) const
Print stuff.
Definition: RegionContainer.cc:477
std::set< const Material * > getMaterials(void) const
Return a list of const pointers to the different region materials.
Definition: RegionContainer.cc:147
~RegionContainer(void)
Destructor.
Definition: RegionContainer.cc:110
Quad that discretizes in quad cells.
Definition: QuadSectRegion.h:54
Polígono en dos dimensiones.
Definition: Polygon2d.h:38
double getIyHomogenizedSection(const double &E0) const
Returns homogenized moment of inertia of the cross-section with respect to the axis parallel to y pas...
Definition: RegionContainer.cc:386
RegionContainer(MaterialHandler *ml)
Constructor.
Definition: RegionContainer.cc:62
RegionContainer & operator=(const RegionContainer &)
Assignment operator.
Definition: RegionContainer.cc:71
double getIzHomogenizedSection(const double &E0) const
Returns homogenized moment of inertia of the cross-section with respect to the axis parallel to z pas...
Definition: RegionContainer.cc:416
void clear(void)
Erases all regions.
Definition: RegionContainer.cc:114
Material handler (definition, searching,...).
Definition: MaterialHandler.h:46
Region of a section that corresponds with a material.
Definition: SectRegion.h:58
Half plane in a two-dimensional space.
Definition: HalfPlane2d.h:38
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
size_t getNumCells(void) const
Returns the total number of cells.
Definition: RegionContainer.cc:135
Vector getCenterOfMassGrossSection(void) const
Returns the center of gravity of the gross cross-section.
Definition: RegionContainer.cc:255
Cross-section representation able to return mechanical propertis a area, moments of inertia...
Definition: SectionMassProperties.h:51
double getPyzGrossSection(void) const
Returns the product of inertia of the gross cross-section respecto a los axis parallel to the y y al ...
Definition: RegionContainer.cc:307