xc
RegionContainer.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 //RegionContainer.h
28 
29 #ifndef RegionContainer_h
30 #define RegionContainer_h
31 
32 #include <list>
33 #include "material/section/repres/SectionMassProperties.h"
34 
35 class Pos2d;
36 class BND2d;
37 class Polygon2d;
38 class HalfPlane2d;
39 
40 namespace XC {
41 
42 class SectRegion;
43 class QuadSectRegion;
44 class CircularSectRegion;
45 class MaterialHandler;
46 class Vector;
47 class Matrix;
48 
50 //
52 class RegionContainer: protected std::list<SectRegion *>, public SectionMassProperties
53  {
54  public:
55  typedef std::list<SectRegion *> l_reg;
56  typedef l_reg::reference reference;
57  typedef l_reg::const_reference const_reference;
58  typedef l_reg::iterator iterator;
59  typedef l_reg::const_iterator const_iterator;
60  private:
61  void free_mem(void);
62  void free_mem(const size_t i);
63  void copy(const RegionContainer &otra);
64  protected:
65 
67  public:
68 
72  ~RegionContainer(void);
73 
74  XC::SectRegion *push_back(const SectRegion &reg);
75  inline size_t size(void) const
76  { return l_reg::size(); }
77  inline bool empty(void) const
78  { return l_reg::empty(); }
79 
80  void clear(void);
81 
82  const_iterator begin(void) const;
83  const_iterator end(void) const;
84  iterator begin(void);
85  iterator end(void);
86 
87  QuadSectRegion *newQuadRegion(const std::string &);
88  CircularSectRegion *newCircularRegion(const std::string &);
89 
90  size_t getNumCells(void) const;
91 
92  std::list<Polygon2d> getRegionsContours(void) const;
93  std::list<Polygon2d> getContours(void) const;
94  BND2d getBnd(void) const;
95  RegionContainer Intersection(const HalfPlane2d &) const;
96 
97  double getAreaGrossSection(void) const;
99  double getIyGrossSection(void) const;
100  double getIzGrossSection(void) const;
101  double getPyzGrossSection(void) const;
102 
103  Vector getCenterOfMassHomogenizedSection(const double &E0) const;
104  double getAreaHomogenizedSection(const double &E0) const;
105  double getIyHomogenizedSection(const double &E0) const;
106  double getIzHomogenizedSection(const double &E0) const;
107  double getPyzHomogenizedSection(const double &E0) const;
108 
109  void Print(std::ostream &s) const;
110  };
111 
112 std::ostream &operator<<(std::ostream &,const RegionContainer &);
113 
114 } // end of XC namespace
115 
116 
117 #endif
Circular shaped patch.
Definition: CircularSectRegion.h:45
Float vector abstraction.
Definition: Vector.h:93
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:377
double getIzGrossSection(void) const
Returns the moment of inertia of the gross cross-section with respect to the axis paralelo al z por e...
Definition: RegionContainer.cc:236
Section composed of some regions.
Definition: RegionContainer.h:52
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:222
double getAreaHomogenizedSection(const double &E0) const
Returns the homogenized area of the regions.
Definition: RegionContainer.cc:266
std::list< Polygon2d > getRegionsContours(void) const
Returns a list with the regions contours.
Definition: RegionContainer.cc:147
CircularSectRegion * newCircularRegion(const std::string &)
Aggregates a new circularl region.
Definition: RegionContainer.cc:96
std::list< Polygon2d > getContours(void) const
Return the regions contours.
Definition: RegionContainer.cc:156
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:189
QuadSectRegion * newQuadRegion(const std::string &)
Aggregates a new quadrilateral region.
Definition: RegionContainer.cc:82
MaterialHandler * material_handler
Material definition handler (searching,...).
Definition: RegionContainer.h:66
void Print(std::ostream &s) const
Print stuff.
Definition: RegionContainer.cc:405
~RegionContainer(void)
Destructor.
Definition: RegionContainer.cc:110
Quad that discretizes in quad cells.
Definition: QuadSectRegion.h:53
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:323
RegionContainer(MaterialHandler *ml)
Constructor.
Definition: RegionContainer.cc:64
RegionContainer & operator=(const RegionContainer &)
Assignment operator.
Definition: RegionContainer.cc:73
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:350
void clear(void)
Erases all regions.
Definition: RegionContainer.cc:114
Material handler (definition, searching,...).
Definition: MaterialHandler.h:45
Region of a section that corresponds with a material.
Definition: SectRegion.h:57
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
size_t getNumCells(void) const
Returns the número total de celdas.
Definition: RegionContainer.cc:135
Vector getCenterOfMassGrossSection(void) const
Returns the centro de gravedad of the gross cross-section.
Definition: RegionContainer.cc:198
Cross-section representation able to return mechanical propertis a area, moments of inertia...
Definition: SectionMassProperties.h:49
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:250