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 "material/section/repres/SectionMassProperties.h"
35 
36 class Pos2d;
37 class BND2d;
38 class Polygon2d;
39 class HalfPlane2d;
40 
41 namespace XC {
42 
43 class SectRegion;
44 class QuadSectRegion;
45 class CircularSectRegion;
46 class MaterialHandler;
47 class Vector;
48 class Matrix;
49 
51 //
53 class RegionContainer: protected std::list<SectRegion *>, public SectionMassProperties
54  {
55  public:
56  typedef std::list<SectRegion *> l_reg;
57  typedef l_reg::reference reference;
58  typedef l_reg::const_reference const_reference;
59  typedef l_reg::iterator iterator;
60  typedef l_reg::const_iterator const_iterator;
61  private:
62  void free_mem(void);
63  void free_mem(const size_t i);
64  void copy(const RegionContainer &other);
65  protected:
66 
68  public:
69 
73  ~RegionContainer(void);
74 
75  XC::SectRegion *push_back(const SectRegion &reg);
76  inline size_t size(void) const
77  { return l_reg::size(); }
78  inline bool empty(void) const
79  { return l_reg::empty(); }
80 
81  void clear(void);
82 
83  const_iterator begin(void) const;
84  const_iterator end(void) const;
85  iterator begin(void);
86  iterator end(void);
87 
88  QuadSectRegion *newQuadRegion(const std::string &);
89  CircularSectRegion *newCircularRegion(const std::string &);
90 
91  size_t getNumCells(void) const;
92 
93  std::list<Polygon2d> getRegionsContours(void) const;
94  std::list<Polygon2d> getContours(void) const;
95  BND2d getBnd(void) const;
96  RegionContainer Intersection(const HalfPlane2d &) const;
97 
98  double getAreaGrossSection(void) const;
100  double getIyGrossSection(void) const;
101  double getIzGrossSection(void) const;
102  double getPyzGrossSection(void) const;
103 
104  Vector getCenterOfMassHomogenizedSection(const double &E0) const;
105  double getAreaHomogenizedSection(const double &E0) const;
106  double getIyHomogenizedSection(const double &E0) const;
107  double getIzHomogenizedSection(const double &E0) const;
108  double getPyzHomogenizedSection(const double &E0) const;
109 
110  void Print(std::ostream &s) const;
111  };
112 
113 std::ostream &operator<<(std::ostream &,const RegionContainer &);
114 
115 } // end of XC namespace
116 
117 
118 #endif
Circular shaped patch.
Definition: CircularSectRegion.h:46
"boundary" en dos dimensiones.
Definition: BND2d.h:38
Float vector abstraction.
Definition: Vector.h:94
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:392
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:239
Section composed of some regions.
Definition: RegionContainer.h:53
Posición en dos dimensiones.
Definition: Pos2d.h:41
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:225
double getAreaHomogenizedSection(const double &E0) const
Returns the homogenized area of the regions.
Definition: RegionContainer.cc:269
std::list< Polygon2d > getRegionsContours(void) const
Returns a list with the regions contours.
Definition: RegionContainer.cc:150
CircularSectRegion * newCircularRegion(const std::string &)
Aggregates a new circularl region.
Definition: RegionContainer.cc:98
std::list< Polygon2d > getContours(void) const
Return the regions contours.
Definition: RegionContainer.cc:159
XC::SectRegion * push_back(const SectRegion &reg)
Adds a region to the container.
Definition: RegionContainer.cc:121
double getAreaGrossSection(void) const
Returns the regions area.
Definition: RegionContainer.cc:192
QuadSectRegion * newQuadRegion(const std::string &)
Aggregates a new quadrilateral region.
Definition: RegionContainer.cc:83
MaterialHandler * material_handler
Material definition handler (searching,...).
Definition: RegionContainer.h:67
void Print(std::ostream &s) const
Print stuff.
Definition: RegionContainer.cc:423
~RegionContainer(void)
Destructor.
Definition: RegionContainer.cc:113
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:332
RegionContainer(MaterialHandler *ml)
Constructor.
Definition: RegionContainer.cc:65
RegionContainer & operator=(const RegionContainer &)
Assignment operator.
Definition: RegionContainer.cc:74
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:362
void clear(void)
Erases all regions.
Definition: RegionContainer.cc:117
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:138
Vector getCenterOfMassGrossSection(void) const
Returns the center of gravity of the gross cross-section.
Definition: RegionContainer.cc:201
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:253