xc
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/RegionContainer.h"
33 #include "material/section/repres/geom_section/reinfLayer/ListReinfLayer.h"
34 #include <list>
35 #include "boost/lexical_cast.hpp"
36 #include "Axis.h"
37 #include "material/section/repres/SectionMassProperties.h"
38 #include <vector>
39 
40 class HalfPlane2d;
41 class Segment2d;
42 
43 namespace XC {
44 class SectionReferenceFrame;
45 class Spot;
46 class Segment;
47 class SectRegion;
48 class ReinfLayer;
49 class MaterialHandler;
50 class Material;
51 class Vector;
52 class Matrix;
53 class CrossSectionProperties3d;
54 class CrossSectionProperties2d;
55 
59 //
61 //
64  {
65  public:
66 
67  typedef std::map<size_t,SectionReferenceFrame *> lst_sis_ref;
68  typedef std::map<size_t,Spot *> lst_spots;
69  typedef std::map<size_t,Axis *> axes_container;
70 
71  protected:
73 
76 
77  lst_sis_ref reference_systems;
78  size_t tag_sis_ref;
79 
80  lst_spots spots;
81  size_t tag_spot;
82  axes_container axes;
83  size_t axis_tag;
84 
85  public:
86  //Constructores
88  inline virtual ~GeomSection(void) {}
89 
90  inline int getReferenceFrameTag(void) const
91  { return tag_sis_ref; }
92  void setReferenceFrameTag(int i)
93  { tag_sis_ref= i; }
95  const SectionReferenceFrame *get_reference_system(const size_t &id) const;
96  inline SectionReferenceFrame *current_reference_system(void)
97  { return get_reference_system(tag_sis_ref); }
98  const SectionReferenceFrame *current_reference_system(void) const
99  { return get_reference_system(tag_sis_ref); }
100  SectionReferenceFrame *createReferenceFrame(const std::string &);
101 
102  // Section edition functions
103  inline int getTagSpot(void) const
104  { return tag_spot; }
105  void setTagSpot(int i)
106  { tag_spot= i; }
107  Spot *busca_spot(const size_t &);
108  const Spot *busca_spot(const size_t &) const;
109  Spot *creaSpot(const Pos2d &);
110  Spot *newSpot(const Pos2d &);
111 
112  inline int getAxisTag(void) const
113  { return axis_tag; }
114  void setAxisTag(int i)
115  { axis_tag= i; }
116  Axis *find_axis(const size_t &);
117  const Axis *find_axis(const size_t &) const;
118  template <class E>
119  Axis *createAxis(void);
120  Segment *newSegment(size_t, size_t);
121 
122  // Section inquiring functions
123  double DistSpots(const size_t &i,const size_t &j) const;
124  Polygon2d getRegionsContour(void) const;
125  Polygon2d getCompressedZoneContour(const HalfPlane2d &) const;
126  double getLongCorte(const Line2d &r) const;
127  std::vector<double> getLongsCorte(const std::list<Line2d> &lr) const;
128  double getCompressedZoneDepth(const HalfPlane2d &) const;
129  double getTensionedZoneDepth(const HalfPlane2d &) const;
130  double getLeverArm(const Line2d &) const;
131  double getAnchoMecanico(const Line2d &) const;
132  double getCover(const Pos2d &) const;
133  double getCompressedStrutWidth(const Segment2d &) const;
134 
135  //Access to containers.
136  inline const RegionContainer &getRegions(void) const
137  { return regions; }
138  inline RegionContainer &getRegions(void)
139  { return regions; }
140  inline const ListReinfLayer &getReinforcementLayers(void) const
141  { return reinforcement_layers; }
142  inline ListReinfLayer &getReinforcementLayers(void)
143  { return reinforcement_layers; }
144  GeomSection getGMRegions(void) const;
146  GeomSection getCrackedSection(const HalfPlane2d &) const;
147  size_t getNumFiberData(void) const;
148 
149  double getAreaGrossSection(void) const;
151  double getIyGrossSection(void) const;
152  double getIzGrossSection(void) const;
153  double getPyzGrossSection(void) const;
154 
155  Vector getCenterOfMassHomogenizedSection(const double &E0) const;
156  double getAreaHomogenizedSection(const double &E0) const;
157  double getIyHomogenizedSection(const double &E0) const;
158  double getIzHomogenizedSection(const double &E0) const;
159  double getPyzHomogenizedSection(const double &E0) const;
160 
161  void Print(std::ostream &s, int flag =0);
162  friend std::ostream &operator<<(std::ostream &, GeomSection &);
163  };
164 
165 std::ostream &operator<<(std::ostream &, GeomSection &);
166 
168 template <class E>
170  {
171  Axis *retval= find_axis(axis_tag);
172  if(!retval) //It doesn't already exist
173  {
174  retval= new E(this);
175  if(retval)
176  {
177  retval->Name()= "l"+boost::lexical_cast<std::string>(axis_tag);
178  axes[axis_tag]= retval;
179  axis_tag++;
180  }
181  else
182  std::cerr << getClassName() << __FUNCTION__
183  << "Can't create axis with tag: "
184  << axis_tag << ".\n";
185  }
186  return retval;
187  }
188 
189 } // end of XC namespace
190 
191 
192 #endif
193 
Cross section geometry.
Definition: GeomSection.h:63
ListReinfLayer reinforcement_layers
Rebar layers container.
Definition: GeomSection.h:75
double getIzGrossSection(void) const
Inertia of the gross section about an axis parallel to z through its centroid.
Definition: GeomSection.cc:550
Float vector abstraction.
Definition: Vector.h:93
MaterialHandler * material_handler
Material handler (searching,...).
Definition: GeomSection.h:72
SectionReferenceFrame * 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
Vector getCenterOfMassGrossSection(void) const
Returns gross section centroid position.
Definition: GeomSection.cc:526
double getCompressedStrutWidth(const Segment2d &) const
Return the width «b0» of the compressed strut that corresponds to the arm lever represented by the se...
Definition: GeomSection.cc:382
double getCompressedZoneDepth(const HalfPlane2d &) const
Return the section depth from the border of the half-plane being passed as parameter to the most comp...
Definition: GeomSection.cc:296
Section composed of some regions.
Definition: RegionContainer.h:52
GeomSection getCrackedSection(const HalfPlane2d &) const
Return a section with only the compressed regions of the section.
Definition: GeomSection.cc:78
Axis * find_axis(const size_t &)
Returns a pointer to the axis which name is being passed as parameter.
Definition: GeomSection.cc:135
size_t tag_sis_ref
Default identifier for next spatial reference system.
Definition: GeomSection.h:78
lst_sis_ref reference_systems
Spatial reference systems.
Definition: GeomSection.h:77
size_t tag_spot
Default identifier for next point.
Definition: GeomSection.h:81
size_t axis_tag
Default identifier for next axis.
Definition: GeomSection.h:83
double getAreaHomogenizedSection(const double &E0) const
Return the homogenized area of the regions.
Definition: GeomSection.cc:425
Spot * busca_spot(const size_t &)
Returns a pointer to the point identified by the argument.
Definition: GeomSection.cc:115
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:473
GeomSection getGMReinforcementLayers(void) const
Returns a geometry that contains only the regions defined in this object.
Definition: GeomSection.cc:70
lst_spots spots
Point container.
Definition: GeomSection.h:80
Polygon2d getCompressedZoneContour(const HalfPlane2d &) const
Return the contour of the compressed part of the regions.
Definition: GeomSection.cc:256
double getLongCorte(const Line2d &r) const
Return the lengths of the segments that results of cutting the line being passed as parameter with th...
Definition: GeomSection.cc:329
Line segment.
Definition: Segment.h:40
std::vector< double > getLongsCorte(const std::list< Line2d > &lr) const
Return the lengths of the segments that results of cutting the line being passed as parameter with th...
Definition: GeomSection.cc:341
std::map< size_t, Spot * > lst_spots
point container.
Definition: GeomSection.h:68
Spot * creaSpot(const Pos2d &)
Creates a new point.
Definition: GeomSection.cc:175
axes_container axes
Axis container.
Definition: GeomSection.h:82
Spot * newSpot(const Pos2d &)
New spot.
Definition: GeomSection.cc:189
double getIyGrossSection(void) const
Inertia of the gross section about an axis parallel to y through its centroid.
Definition: GeomSection.cc:530
Base class for 1D entities in section definition.
Definition: Axis.h:43
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:452
Reference system used for make easier definining point positions.
Definition: SectionReferenceFrame.h:42
void Print(std::ostream &s, int flag=0)
Printing.
Definition: GeomSection.cc:593
Reinf layer container (list).
Definition: ListReinfLayer.h:53
RegionContainer regions
Region container.
Definition: GeomSection.h:74
Point object for section geometry definition.
Definition: Spot.h:43
double getAnchoMecanico(const Line2d &) const
Return the section width for the bending plane intersect being passed as parameter.
Definition: GeomSection.cc:361
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:494
Axis * createAxis(void)
Creates a new axis.
Definition: GeomSection.h:169
std::map< size_t, SectionReferenceFrame * > lst_sis_ref
reference systems container.
Definition: GeomSection.h:67
Material handler (definition, searching,...).
Definition: MaterialHandler.h:45
double getTensionedZoneDepth(const HalfPlane2d &) const
Return the section depth from the border of the half-plane being passed as parameter to the most tens...
Definition: GeomSection.cc:312
double getAreaGrossSection(void) const
Returns region&#39;s gross section area.
Definition: GeomSection.cc:515
SectionReferenceFrame * createReferenceFrame(const std::string &)
Creates a new reference frame of the type being passed as parameter.
Definition: GeomSection.cc:155
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Polygon2d getRegionsContour(void) const
Return the contour of the regions.
Definition: GeomSection.cc:240
Cross-section representation able to return mechanical propertis a area, moments of inertia...
Definition: SectionMassProperties.h:49
double getCover(const Pos2d &) const
Return the cover for the position being passed as parameter.
Definition: GeomSection.cc:414
double DistSpots(const size_t &i, const size_t &j) const
Return the distance between the points identified by the arguments.
Definition: GeomSection.cc:223
double getLeverArm(const Line2d &) const
Return the working cross-section lever arm from the position of the half-plane being passed as parame...
Definition: GeomSection.cc:276
Segment * newSegment(size_t, size_t)
New segment.
Definition: GeomSection.cc:207
GeomSection getGMRegions(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:570
std::map< size_t, Axis * > axes_container
line container.
Definition: GeomSection.h:69