xc
ProtoBeam2d.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 //ProtoBeam2d.h
29 
30 #ifndef ProtoBeam2d_h
31 #define ProtoBeam2d_h
32 
33 #include "domain/mesh/element/truss_beam_column/BeamColumn.h"
34 #include "domain/mesh/element/utils/physical_properties/ElasticSection2dPhysicalProperties.h"
35 
36 namespace XC {
37 class CrdTransf2d;
38 
42 //
46 class ProtoBeam2d: public BeamColumn
47  {
48  public:
50  protected:
52 
53  PhysProp physicalProperties;
55  int sendData(Communicator &);
56  int recvData(const Communicator &);
57  void set_material(const Material *m);
58 
59  public:
60  ProtoBeam2d(int tag, int class_tag,const Material *m= nullptr);
61  ProtoBeam2d(int tag, int class_tag, double A, double E, double I, int Nd1, int Nd2);
62  ProtoBeam2d(int tag, int class_tag, double A, double alpha, double E, double G, double I, int Nd1, int Nd2);
63  int getNumDOF(void) const;
64 
65  // Element birth and death stuff.
68 
72  const PrismaticBarCrossSection *getSectionPtr(const size_t &) const;
73  void setMaterial(const Material &);
74  void setMaterial(const std::string &);
75 
76  double getRho(void) const;
77  void setRho(const double &r);
78  double getLinearRho(void) const;
79 
80  inline PhysProp &getPhysicalProperties(void)
81  { return physicalProperties; }
82  inline const PhysProp &getPhysicalProperties(void) const
83  { return physicalProperties; }
84  void setPhysicalProperties(const PhysProp &);
85  inline virtual std::set<std::string> getMaterialNames(void) const
86  { return physicalProperties.getMaterialNames(); }
87 
88 
90  inline const Vector &getInitialSectionDeformation(void) const
91  { return (*physicalProperties[0]).getInitialSectionDeformation(); }
92  virtual const Vector &computeCurrentStrain(void) const;
93  const Vector &getSectionDeformation(void) const;
94  inline const Vector &getInitialStrain(void) const
95  { return (*physicalProperties[0]).getInitialSectionDeformation(); }
96  inline void setInitialStrain(const Vector &e)
97  { (*physicalProperties[0]).setInitialSectionDeformation(e); }
98 
99  virtual int update(void);
100  int commitState(void);
101  int revertToLastCommit(void);
102  int revertToStart(void);
103 
104  void alive(void);
105  void zeroLoad(void);
106  virtual ElementalLoad *createInertiaLoad(const Vector &);
107 
109  Vector getVDirWeakAxisLocalCoord(void) const;
110  double getStrongAxisAngle(void) const;
111  double getWeakAxisAngle(void) const;
112 
113  virtual const Matrix &getExtrapolationMatrix(void) const
114  { return extrapolation_matrix; }
115 
116  boost::python::list getValuesAtNodes(const std::string &, bool silent= false) const;
117  };
118 } // end of XC namespace
119 
120 #endif
PhysProp physicalProperties
pointers to the material objects and physical properties.
Definition: ProtoBeam2d.h:53
Float vector abstraction.
Definition: Vector.h:94
static Matrix extrapolation_matrix
Extrapolation matrix.
Definition: ProtoBeam2d.h:51
ProtoBeam2d(int tag, int class_tag, const Material *m=nullptr)
Default constructor.
Definition: ProtoBeam2d.cc:69
Communication parameters between processes.
Definition: Communicator.h:66
void zeroLoad(void)
Removes the element loads.
Definition: ProtoBeam2d.cc:331
Base class for Beam-column elements with PrismaticBarCrossSection material.
Definition: BeamColumn.h:45
double getWeakAxisAngle(void) const
Returns the angle between element weak axis and local XZ plane.
Definition: ProtoBeam2d.cc:313
const Vector & getSectionDeformation(void) const
Return the section generalized strain.
Definition: ProtoBeam2d.cc:223
const Vector & getPersistentInitialSectionDeformation(void) const
Returns the value of the persistent (does not get wiped out by zeroLoad) initial deformation of the s...
Definition: ProtoBeam2d.cc:105
Base class for beam-column cross sections.
Definition: PrismaticBarCrossSection.h:53
virtual ElementalLoad * createInertiaLoad(const Vector &)
Creates the inertia load that corresponds to the acceleration argument.
Definition: ProtoBeam2d.cc:339
void set_material(const Material *m)
Set values to section mass properties.
Definition: ProtoBeam2d.cc:42
Vector persistentInitialDeformation
Persistent initial strain at element level. Used to store the deformation during the inactive phase o...
Definition: ProtoBeam2d.h:54
Base class for materials.
Definition: Material.h:93
virtual const Vector & computeCurrentStrain(void) const
Compute the current strain.
Definition: ProtoBeam2d.cc:206
const PrismaticBarCrossSection * getSectionPtr(const size_t &) const
Returns a pointer to the i-th section of the element.
Definition: ProtoBeam2d.cc:136
const CrossSectionProperties2d & getSectionProperties(void) const
Return section properties.
Definition: ProtoBeam2d.cc:122
int sendData(Communicator &)
Send members through the communicator argument.
Definition: ProtoBeam2d.cc:171
int getNumDOF(void) const
Return the number of degrees of freedom of the element.
Definition: ProtoBeam2d.cc:100
Vector getVDirWeakAxisLocalCoord(void) const
Returns the direction vector of element weak axis expressed in the local coordinate system...
Definition: ProtoBeam2d.cc:198
void setRho(const double &r)
Sets linear density.
Definition: ProtoBeam2d.cc:163
double getRho(void) const
Return linear density.
Definition: ProtoBeam2d.cc:159
int revertToLastCommit(void)
Revert the element to the its last commited state.
Definition: ProtoBeam2d.cc:286
virtual std::set< std::string > getMaterialNames(void) const
Return the names of the material(s) of the element.
Definition: ProtoBeam2d.h:85
double getStrongAxisAngle(void) const
Returns the angle between element strong axis and local XZ plane.
Definition: ProtoBeam2d.cc:305
Mechanical (E, G) and mass properties of a section (area, moments of inertia,...) for a bi-dimensiona...
Definition: CrossSectionProperties2d.h:55
Vector getVDirStrongAxisLocalCoord(void) const
Returns the direction vector of element strong axis expressed in the local coordinate system...
Definition: ProtoBeam2d.cc:189
void alive(void)
Reactivates the element.
Definition: ProtoBeam2d.cc:320
Base class for 2D beam elements.
Definition: ProtoBeam2d.h:46
boost::python::list getValuesAtNodes(const std::string &, bool silent=false) const
Return a python list with the values of the argument property at element nodes.
Definition: ProtoBeam2d.cc:358
Three-dimensional elastic section physical properties.
Definition: ElasticSection2dPhysicalProperties.h:41
double getLinearRho(void) const
Return linear density.
Definition: ProtoBeam2d.cc:167
void setSectionProperties(const CrossSectionProperties2d &)
Set section properties.
Definition: ProtoBeam2d.cc:130
int setInitialSectionDeformation(const Vector &)
Set the element initial strain.
Definition: ProtoBeam2d.cc:216
virtual int update(void)
Update element state.
Definition: ProtoBeam2d.cc:240
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
void setMaterial(const Material &)
Set the element material.
Definition: ProtoBeam2d.cc:145
Matrix of floats.
Definition: Matrix.h:111
Base class for loads over elements.
Definition: ElementalLoad.h:79
int commitState(void)
Commit the element state.
Definition: ProtoBeam2d.cc:274
int recvData(const Communicator &)
Receives members through the communicator argument.
Definition: ProtoBeam2d.cc:180
int revertToStart(void)
Revert the the element to the its initial state.
Definition: ProtoBeam2d.cc:296
void incrementPersistentInitialDeformationWithCurrentDeformation(void)
Increments the persistent (does not get wiped out by zeroLoad) initial deformation of the section...
Definition: ProtoBeam2d.cc:112