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/Element1D.h"
34 #include "domain/mesh/element/utils/physical_properties/ElasticSection2dPhysicalProperties.h"
35 
36 namespace XC {
37 class CrdTransf2d;
38 
42 //
46 class ProtoBeam2d: public Element1D
47  {
48  public:
50  protected:
51  PhysProp physicalProperties;
53  int sendData(Communicator &);
54  int recvData(const Communicator &);
55  void set_material(const Material *m);
56 
57  public:
58  ProtoBeam2d(int tag, int class_tag,const Material *m= nullptr);
59  ProtoBeam2d(int tag, int class_tag, double A, double E, double I, int Nd1, int Nd2);
60  ProtoBeam2d(int tag, int class_tag, double A, double alpha, double E, double G, double I, int Nd1, int Nd2);
61  int getNumDOF(void) const;
62 
63  // Element birth and death stuff.
66 
70  void setMaterial(const std::string &);
71 
72  double getRho(void) const;
73  void setRho(const double &r);
74  double getLinearRho(void) const;
75 
76  inline PhysProp &getPhysicalProperties(void)
77  { return physicalProperties; }
78  inline const PhysProp &getPhysicalProperties(void) const
79  { return physicalProperties; }
80  void setPhysicalProperties(const PhysProp &);
81  inline virtual std::set<std::string> getMaterialNames(void) const
82  { return physicalProperties.getMaterialNames(); }
83 
85  inline const Vector &getInitialSectionDeformation(void) const
86  { return (*physicalProperties[0]).getInitialSectionDeformation(); }
87  virtual const Vector &computeCurrentStrain(void) const;
88  const Vector &getSectionDeformation(void) const;
89  inline const Vector &getInitialStrain(void) const
90  { return (*physicalProperties[0]).getInitialSectionDeformation(); }
91  inline void setInitialStrain(const Vector &e)
92  { (*physicalProperties[0]).setInitialSectionDeformation(e); }
93 
94  virtual int update(void);
95  int commitState(void);
96  int revertToLastCommit(void);
97  int revertToStart(void);
98 
99  void alive(void);
100  void zeroLoad(void);
101  virtual void createInertiaLoad(const Vector &);
102 
104  Vector getVDirWeakAxisLocalCoord(void) const;
105  double getStrongAxisAngle(void) const;
106  double getWeakAxisAngle(void) const;
107 
108  boost::python::list getValuesAtNodes(const std::string &, bool silent= false) const;
109  };
110 } // end of XC namespace
111 
112 #endif
PhysProp physicalProperties
pointers to the material objects and physical properties.
Definition: ProtoBeam2d.h:51
Float vector abstraction.
Definition: Vector.h:94
ProtoBeam2d(int tag, int class_tag, const Material *m=nullptr)
Default constructor.
Definition: ProtoBeam2d.cc:65
Communication parameters between processes.
Definition: Communicator.h:66
void zeroLoad(void)
Removes the element loads.
Definition: ProtoBeam2d.cc:312
double getWeakAxisAngle(void) const
Returns the angle between element weak axis and local XZ plane.
Definition: ProtoBeam2d.cc:294
const Vector & getSectionDeformation(void) const
Return the section generalized strain.
Definition: ProtoBeam2d.cc:204
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:101
void set_material(const Material *m)
Set values to section mass properties.
Definition: ProtoBeam2d.cc:38
Vector persistentInitialDeformation
Persistent initial strain at element level. Used to store the deformation during the inactive phase o...
Definition: ProtoBeam2d.h:52
Base class for materials.
Definition: Material.h:93
virtual const Vector & computeCurrentStrain(void) const
Compute the current strain.
Definition: ProtoBeam2d.cc:187
const CrossSectionProperties2d & getSectionProperties(void) const
Return section properties.
Definition: ProtoBeam2d.cc:118
int sendData(Communicator &)
Send members through the communicator argument.
Definition: ProtoBeam2d.cc:152
int getNumDOF(void) const
Return the number of degrees of freedom of the element.
Definition: ProtoBeam2d.cc:96
Vector getVDirWeakAxisLocalCoord(void) const
Returns the direction vector of element weak axis expressed in the local coordinate system...
Definition: ProtoBeam2d.cc:179
void setRho(const double &r)
Sets linear density.
Definition: ProtoBeam2d.cc:144
void setMaterial(const std::string &)
Set the element material.
Definition: ProtoBeam2d.cc:132
double getRho(void) const
Return linear density.
Definition: ProtoBeam2d.cc:140
int revertToLastCommit(void)
Revert the element to the its last commited state.
Definition: ProtoBeam2d.cc:267
Base class for one-dimensional elements (beam,truss,...)
Definition: Element1D.h:52
virtual std::set< std::string > getMaterialNames(void) const
Return the names of the material(s) of the element.
Definition: ProtoBeam2d.h:81
double getStrongAxisAngle(void) const
Returns the angle between element strong axis and local XZ plane.
Definition: ProtoBeam2d.cc:286
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:170
void alive(void)
Reactivates the element.
Definition: ProtoBeam2d.cc:301
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:335
Three-dimensional elastic section physical properties.
Definition: ElasticSection2dPhysicalProperties.h:41
double getLinearRho(void) const
Return linear density.
Definition: ProtoBeam2d.cc:148
void setSectionProperties(const CrossSectionProperties2d &)
Set section properties.
Definition: ProtoBeam2d.cc:126
int setInitialSectionDeformation(const Vector &)
Set the element initial strain.
Definition: ProtoBeam2d.cc:197
virtual int update(void)
Update element state.
Definition: ProtoBeam2d.cc:221
virtual void createInertiaLoad(const Vector &)
Creates the inertia load that corresponds to the acceleration argument.
Definition: ProtoBeam2d.cc:320
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
int commitState(void)
Commit the element state.
Definition: ProtoBeam2d.cc:255
int recvData(const Communicator &)
Receives members through the communicator argument.
Definition: ProtoBeam2d.cc:161
int revertToStart(void)
Revert the the element to the its initial state.
Definition: ProtoBeam2d.cc:277
void incrementPersistentInitialDeformationWithCurrentDeformation(void)
Increments the persistent (does not get wiped out by zeroLoad) initial deformation of the section...
Definition: ProtoBeam2d.cc:108