xc
ProtoBeam3d.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 //ProtoBeam3d.h
29 
30 #ifndef ProtoBeam3d_h
31 #define ProtoBeam3d_h
32 
33 #include "domain/mesh/element/Element1D.h"
34 #include "domain/mesh/element/utils/physical_properties/ElasticSection3dPhysicalProperties.h"
35 
36 namespace XC {
38 //
40 class ProtoBeam3d: public Element1D
41  {
42  public:
44  protected:
45  PhysProp physicalProperties;
47  int sendData(Communicator &);
48  int recvData(const Communicator &);
49  void set_material(const Material *m);
50 
51  public:
52  ProtoBeam3d(int tag, int class_tag,const Material *m= nullptr);
53  ProtoBeam3d(int tag, int class_tag, int Nd1, int Nd2);
54  ProtoBeam3d(int tag, int class_tag, double A, double E, double G, double Jx, double Iy, double Iz, int Nd1, int Nd2);
55  ProtoBeam3d(int tag, int class_tag, double A, double alpha_y, double alpha_z, double E, double G, double Jx, double Iy, double Iz, int Nd1, int Nd2);
56  int getNumDOF(void) const;
57 
58  // Element birth and death stuff.
61 
65  void setMaterial(const std::string &);
66 
67  double getRho(void) const;
68  void setRho(const double &);
69  double getLinearRho(void) const;
70 
71  inline PhysProp &getPhysicalProperties(void)
72  { return physicalProperties; }
73  inline const PhysProp &getPhysicalProperties(void) const
74  { return physicalProperties; }
75  void setPhysicalProperties(const PhysProp &);
76  inline virtual std::set<std::string> getMaterialNames(void) const
77  { return physicalProperties.getMaterialNames(); }
78 
79  int setInitialSectionDeformation(const Vector &);
80  inline const Vector &getInitialSectionDeformation(void) const
81  { return (*physicalProperties[0]).getInitialSectionDeformation(); }
82  virtual const Vector &computeCurrentStrain(void) const;
83  const Vector &getSectionDeformation(void) const;
84  inline const Vector &getInitialStrain(void) const
85  { return (*physicalProperties[0]).getInitialSectionDeformation(); }
86  inline void setInitialStrain(const Vector &e)
87  { (*physicalProperties[0]).setInitialSectionDeformation(e); }
88 
89 
90  virtual int update(void);
91  int commitState(void);
92  int revertToLastCommit(void);
93  int revertToStart(void);
94 
95  void alive(void);
96  void zeroLoad(void);
97  virtual void createInertiaLoad(const Vector &);
98 
100  Vector getVDirWeakAxisLocalCoord(void) const;
101  double getStrongAxisAngle(void) const;
102  double getWeakAxisAngle(void) const;
103 
104  boost::python::list getValuesAtNodes(const std::string &, bool silent= false) const;
105  };
106 } // end of XC namespace
107 
108 #endif
Vector getVDirWeakAxisLocalCoord(void) const
Returns the direction vector of element weak axis expressed in the local coordinate system...
Definition: ProtoBeam3d.cc:196
int getNumDOF(void) const
return the number of DOF associated with the element.
Definition: ProtoBeam3d.cc:113
Mechanical (E, G) and mass properties of a section (area, moments of inertia,...) in a three-dimensio...
Definition: CrossSectionProperties3d.h:42
int commitState(void)
Commit the element state.
Definition: ProtoBeam3d.cc:300
Float vector abstraction.
Definition: Vector.h:94
Base class for 3D beams.
Definition: ProtoBeam3d.h:40
Three-dimensional elastic section physical properties.
Definition: ElasticSection3dPhysicalProperties.h:41
const Vector & getPersistentInitialSectionDeformation(void) const
Returns the value of the persistent (does not get wiped out by zeroLoad) initial deformation of the e...
Definition: ProtoBeam3d.cc:118
Communication parameters between processes.
Definition: Communicator.h:66
virtual int update(void)
Update element state.
Definition: ProtoBeam3d.cc:257
int sendData(Communicator &)
Send members through the communicator argument.
Definition: ProtoBeam3d.cc:169
PhysProp physicalProperties
pointers to the material objects and physical properties.
Definition: ProtoBeam3d.h:45
Base class for materials.
Definition: Material.h:93
double getRho(void) const
Return linear density.
Definition: ProtoBeam3d.cc:157
const Vector & getSectionDeformation(void) const
Return the section generalized strain.
Definition: ProtoBeam3d.cc:235
Vector getVDirStrongAxisLocalCoord(void) const
Returns the direction vector of element strong axis expressed in the local coordinate system...
Definition: ProtoBeam3d.cc:187
void alive(void)
Reactivates the element.
Definition: ProtoBeam3d.cc:338
void zeroLoad(void)
Removes the element loads.
Definition: ProtoBeam3d.cc:349
double getStrongAxisAngle(void) const
Returns the angle between element strong axis and local XZ plane.
Definition: ProtoBeam3d.cc:205
double getWeakAxisAngle(void) const
Returns the angle between element weak axis and local XZ plane.
Definition: ProtoBeam3d.cc:213
Base class for one-dimensional elements (beam,truss,...)
Definition: Element1D.h:52
ProtoBeam3d(int tag, int class_tag, const Material *m=nullptr)
Default constructor.
Definition: ProtoBeam3d.cc:63
void setMaterial(const std::string &)
Set the element material.
Definition: ProtoBeam3d.cc:149
double getLinearRho(void) const
Return linear density.
Definition: ProtoBeam3d.cc:165
void setRho(const double &)
Sets linear density.
Definition: ProtoBeam3d.cc:161
void setSectionProperties(const CrossSectionProperties3d &)
Set section properties.
Definition: ProtoBeam3d.cc:143
virtual const Vector & computeCurrentStrain(void) const
Compute the current strain.
Definition: ProtoBeam3d.cc:220
virtual void createInertiaLoad(const Vector &)
Creates the inertia load that corresponds to the acceleration argument.
Definition: ProtoBeam3d.cc:331
int revertToStart(void)
Revert the the element to the its start state.
Definition: ProtoBeam3d.cc:322
virtual std::set< std::string > getMaterialNames(void) const
Return the names of the material(s) of the element.
Definition: ProtoBeam3d.h:76
int recvData(const Communicator &)
Receives members through the communicator argument.
Definition: ProtoBeam3d.cc:178
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
void set_material(const Material *m)
Set values to section mass properties.
Definition: ProtoBeam3d.cc:37
int revertToLastCommit(void)
Revert the element to the its last commited state.
Definition: ProtoBeam3d.cc:312
const CrossSectionProperties3d & getSectionProperties(void) const
Return section properties.
Definition: ProtoBeam3d.cc:135
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: ProtoBeam3d.cc:364
Vector persistentInitialDeformation
Persistent initial strain at element level. Used to store the deformation during the inactive phase o...
Definition: ProtoBeam3d.h:46
void incrementPersistentInitialDeformationWithCurrentDeformation(void)
Increments the persistent (does not get wiped out by zeroLoad) initial deformation of the section...
Definition: ProtoBeam3d.cc:125