XC Open source finite element analysis program
GeomSection.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 //GeomSection.h
28 
29 #ifndef GeomSection_h
30 #define GeomSection_h
31 
32 #include "material/section/repres/geom_section/region/ListRegiones.h"
33 #include "material/section/repres/geom_section/reinfLayer/ListReinfLayer.h"
34 #include <list>
35 #include "boost/lexical_cast.hpp"
36 #include "Eje.h"
37 #include "material/section/repres/SeccionInerte.h"
38 
39 class Semiplano2d;
40 class Segmento2d;
41 
42 namespace XC {
43 class SisRefScc;
44 class Spot;
45 class Segment;
46 class RegionSecc;
47 class ReinfLayer;
48 class MaterialLoader;
49 class Material;
50 class Vector;
51 class Matrix;
52 class CrossSectionProperties3d;
53 class CrossSectionProperties2d;
54 
56 //
58 //
60 //
63  {
64  public:
65 
66  typedef std::map<size_t,SisRefScc *> lst_sis_ref;
67  typedef std::map<size_t,Spot *> lst_spots;
68  typedef std::map<size_t,Eje *> lst_ejes;
69 
70  protected:
72 
75 
76  lst_sis_ref reference_systems;
77  size_t tag_sis_ref;
78 
79  lst_spots spots;
80  size_t tag_spot;
81  lst_ejes ejes;
82  size_t tag_eje;
83 
84  public:
85  //Constructores
87  inline virtual ~GeomSection(void) {}
88 
89  inline int getTagSisRef(void) const
90  { return tag_sis_ref; }
91  void setTagSisRef(int i)
92  { tag_sis_ref= i; }
93  SisRefScc *get_reference_system(const size_t &id);
94  const SisRefScc *get_reference_system(const size_t &id) const;
95  inline SisRefScc *current_reference_system(void)
96  { return get_reference_system(tag_sis_ref); }
97  const SisRefScc *current_reference_system(void) const
98  { return get_reference_system(tag_sis_ref); }
99  SisRefScc *creaSisRef(const std::string &);
100 
101  // Section edition functions
102  inline int getTagSpot(void) const
103  { return tag_spot; }
104  void setTagSpot(int i)
105  { tag_spot= i; }
106  Spot *busca_spot(const size_t &);
107  const Spot *busca_spot(const size_t &) const;
108  Spot *creaSpot(const Pos2d &);
109  Spot *newSpot(const Pos2d &);
110 
111  inline int getTagEje(void) const
112  { return tag_eje; }
113  void setTagEje(int i)
114  { tag_eje= i; }
115  Eje *busca_eje(const size_t &);
116  const Eje *busca_eje(const size_t &) const;
117  template <class E>
118  Eje *creaEje(void);
119  Segment *newSegment(size_t, size_t);
120 
121  // Section inquiring functions
122  double DistSpots(const size_t &i,const size_t &j) const;
123  Poligono2d getRegionsContour(void) const;
124  Poligono2d getCompressedZoneContour(const Semiplano2d &) const;
125  double getLongCorte(const Recta2d &r) const;
126  std::vector<double> getLongsCorte(const std::list<Recta2d> &lr) const;
127  double getCantoMecanicoZonaComprimida(const Semiplano2d &) const;
128  double getCantoMecanicoZonaTraccionada(const Semiplano2d &) const;
129  double getCantoMecanico(const Recta2d &) const;
130  double getAnchoMecanico(const Recta2d &) const;
131  double getRecubrimiento(const Pos2d &) const;
132  double getAnchoBielaComprimida(const Segmento2d &) const;
133 
134  //Acceso contenedores.
135  inline const ListRegiones &getRegiones(void) const
136  { return regiones; }
137  inline ListRegiones &getRegiones(void)
138  { return regiones; }
139  inline const ListReinfLayer &getCapasArmadura(void) const
140  { return capas_armado; }
141  inline ListReinfLayer &getCapasArmadura(void)
142  { return capas_armado; }
143  GeomSection getGMRegiones(void) const;
144  GeomSection getGMCapasArmado(void) const;
145  GeomSection getSeccionFisurada(const Semiplano2d &) const;
146  size_t getNumFiberData(void) const;
147 
148  double getAreaGrossSection(void) const;
149  Vector getCdgGrossSection(void) const;
150  double getIyGrossSection(void) const;
151  double getIzGrossSection(void) const;
152  double getPyzGrossSection(void) const;
153 
154  Vector getCdgHomogenizedSection(const double &E0) const;
155  double getAreaHomogenizedSection(const double &E0) const;
156  double getIyHomogenizedSection(const double &E0) const;
157  double getIzHomogenizedSection(const double &E0) const;
158  double getPyzHomogenizedSection(const double &E0) const;
159 
160  void Print(std::ostream &s, int flag =0);
161  friend std::ostream &operator<<(std::ostream &s, GeomSection &fiberSectionRepr);
162  };
163 
165 template <class E>
167  {
168  Eje *retval= busca_eje(tag_eje);
169  if(!retval) //It doesn't already exist
170  {
171  retval= new E(this);
172  if(retval)
173  {
174  retval->Nombre()= "l"+boost::lexical_cast<std::string>(tag_eje);
175  ejes[tag_eje]= retval;
176  tag_eje++;
177  }
178  else
179  std::cerr << "No se pudo crear el eje de tag: "
180  << tag_eje << ".\n";
181  }
182  return retval;
183  }
184 
185 } // end of XC namespace
186 
187 
188 #endif
189 
SisRefScc * get_reference_system(const size_t &id)
Returns a pointer to the reference system which identifier is being passed as parameter.
Definition: GeomSection.cc:89
ListRegiones regiones
Region container.
Definition: GeomSection.h:73
double getIzGrossSection(void) const
Inertia of the gross section about an axis parallel to z through its centroid.
Definition: GeomSection.cc:544
Point object for section geometry definition.
Definition: Spot.h:43
MaterialLoader * material_loader
Material handler (searching,...).
Definition: GeomSection.h:71
double getCantoMecanicoZonaTraccionada(const Semiplano2d &) const
Returns the section depth from the border of the half-plane being passed as parameter to the most ten...
Definition: GeomSection.cc:307
Spot * busca_spot(const size_t &)
Returns a pointer to the punto cuyo identificador being passed as parameter.
Definition: GeomSection.cc:115
Definition: Vector.h:82
double getPyzHomogenizedSection(const double &E0) const
Returns homogenized product of inertia of the cross-section with respecto to the axis parallel to y a...
Definition: GeomSection.cc:488
GeomSection getSeccionFisurada(const Semiplano2d &) const
Return a section with only the compressed regions of the section.
Definition: GeomSection.cc:78
std::map< size_t, Eje * > lst_ejes
line container.
Definition: GeomSection.h:68
size_t tag_sis_ref
Default identifier for next spatial reference system.
Definition: GeomSection.h:77
GeomSection getGMRegiones(void) const
Returns a geometry that contains only the regions defined in this object.
Definition: GeomSection.cc:61
double getPyzGrossSection(void) const
Product of inertia of the gross section about y and z axis through its centroid.
Definition: GeomSection.cc:564
lst_spots spots
Point container.
Definition: GeomSection.h:79
double getLongCorte(const Recta2d &r) const
Returns the lengths of the segments that results of cutting the line being passed as parameter with t...
Definition: GeomSection.cc:324
double getAreaHomogenizedSection(const double &E0) const
Returns the homogenized area of the regions.
Definition: GeomSection.cc:419
ListReinfLayer capas_armado
Rebar layers container.
Definition: GeomSection.h:74
double getIzHomogenizedSection(const double &E0) const
Returns homogenized moment of inertia of the cross-section with respecto to the axis parallel to z pa...
Definition: GeomSection.cc:467
double DistSpots(const size_t &i, const size_t &j) const
Return the distancia entre los puntos cuyos identificadores being passed as parameters.
Definition: GeomSection.cc:218
Segment de recta entre dos puntos.
Definition: Segment.h:40
double getIyGrossSection(void) const
Inertia of the gross section about an axis parallel to y through its centroid.
Definition: GeomSection.cc:524
double getCantoMecanico(const Recta2d &) const
Returns the working cross-section depth from the position of the half-plane being passed as parameter...
Definition: GeomSection.cc:271
Lista de regiones.
Definition: ListRegiones.h:52
Segment * newSegment(size_t, size_t)
New segment.
Definition: GeomSection.cc:204
Vector getCdgGrossSection(void) const
Returns gross section centroid position.
Definition: GeomSection.cc:520
std::map< size_t, SisRefScc * > lst_sis_ref
reference systems container.
Definition: GeomSection.h:66
size_t tag_spot
Default identifier for next point.
Definition: GeomSection.h:80
void Print(std::ostream &s, int flag=0)
Printing.
Definition: GeomSection.cc:587
double getRecubrimiento(const Pos2d &) const
Returns the cover for the position being passed as parameter.
Definition: GeomSection.cc:409
lst_sis_ref reference_systems
Spatial reference systems.
Definition: GeomSection.h:76
Eje * creaEje(void)
Creates a new axis.
Definition: GeomSection.h:166
Cross-section representation able to return mechanical propertis a area, moments of inertia...
Definition: SeccionInerte.h:49
Eje * busca_eje(const size_t &)
Returns a pointer to the eje cuyo nombre being passed as parameter.
Definition: GeomSection.cc:135
double getIyHomogenizedSection(const double &E0) const
Returns homogenized moment of inertia of the cross-section with respecto to the axis parallel to y pa...
Definition: GeomSection.cc:446
double getAnchoBielaComprimida(const Segmento2d &) const
Returns the ancho «b0» de la biela comprimida correspondiente al brazo mecánico being passed as param...
Definition: GeomSection.cc:377
Base class for 1D entities in section definition.
Definition: Eje.h:43
std::map< size_t, Spot * > lst_spots
point container.
Definition: GeomSection.h:67
SisRefScc * creaSisRef(const std::string &)
Creates a new reference system of the type being passed as parameter.
Definition: GeomSection.cc:155
double getCantoMecanicoZonaComprimida(const Semiplano2d &) const
Returns the section depth from the border of the half-plane being passed as parameter to the most com...
Definition: GeomSection.cc:291
Material handler (definition, searching,...).
Definition: MaterialLoader.h:45
GeomSection getGMCapasArmado(void) const
Returns a geometry that contains only the regions defined in this object.
Definition: GeomSection.cc:70
lst_ejes ejes
Axis container.
Definition: GeomSection.h:81
Poligono2d getRegionsContour(void) const
Return the contour of the regions.
Definition: GeomSection.cc:235
Contenedor (lista) de capas de armadura.
Definition: ListReinfLayer.h:53
Spot * newSpot(const Pos2d &)
New spot.
Definition: GeomSection.cc:188
Spot * creaSpot(const Pos2d &)
Creates a new point.
Definition: GeomSection.cc:174
std::vector< double > getLongsCorte(const std::list< Recta2d > &lr) const
Returns the lengths of the segments that results of cutting the line being passed as parameter with t...
Definition: GeomSection.cc:336
double getAreaGrossSection(void) const
Returns region&#39;s gross section area.
Definition: GeomSection.cc:509
================================================================================
Definition: ContinuaReprComponent.h:34
Poligono2d getCompressedZoneContour(const Semiplano2d &) const
Returns the contour of the compressed part of the regions.
Definition: GeomSection.cc:251
Cross section geometry.
Definition: GeomSection.h:62
double getAnchoMecanico(const Recta2d &) const
Returns the section width for the bending plane intersect being passed as parameter.
Definition: GeomSection.cc:356
size_t tag_eje
Default identifier for next axis.
Definition: GeomSection.h:82
Reference system used for make easier definining point positions.
Definition: SisRefScc.h:42