xc
ElasticBeam2d.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 /* ****************************************************************** **
29 ** OpenSees - Open System for Earthquake Engineering Simulation **
30 ** Pacific Earthquake Engineering Research Center **
31 ** **
32 ** **
33 ** (C) Copyright 1999, The Regents of the University of California **
34 ** All Rights Reserved. **
35 ** **
36 ** Commercial use of this program without express permission of the **
37 ** University of California, Berkeley, is strictly prohibited. See **
38 ** file 'COPYRIGHT' in main directory for information on usage and **
39 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
40 ** **
41 ** Developed by: **
42 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
43 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
44 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
45 ** **
46 ** ****************************************************************** */
47 
48 // $Revision: 1.10 $
49 // $Date: 2003/03/11 20:42:39 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/element/elasticBeamColumn/ElasticBeam2d.h,v $
51 
52 
53 // File: ~/model/ElasticBeam2d.h
54 //
55 // Written: fmk 11/95
56 // Revised:
57 //
58 // Purpose: This file contains the class definition for ElasticBeam2d.
59 // ElasticBeam2d is a plane frame member.
60 
61 #ifndef ElasticBeam2d_h
62 #define ElasticBeam2d_h
63 
64 #include "domain/mesh/element/truss_beam_column/elasticBeamColumn/ElasticBeam2dBase.h"
65 #include "domain/mesh/element/utils/fvectors/FVectorBeamColumn2d.h"
66 #include "domain/mesh/element/utils/coordTransformation/CrdTransf2d.h"
67 
68 namespace XC {
69 class Channel;
70 class Information;
71 class Response;
72 class CrossSectionProperties3d;
73 
77  {
78  private:
79  double d;
80 
81  static Matrix K;
82  static Vector P;
83 
84  static Matrix kb;
85  mutable Vector q;
88 
89  int release;
90 
91  void init(void);
92  protected:
93  DbTagData &getDbTagData(void) const;
94  int sendData(Communicator &comm);
95  int recvData(const Communicator &comm);
96 
97  public:
98  ElasticBeam2d(int tag= 0);
99  ElasticBeam2d(int tag,const Material *m,const CrdTransf *trf);
100  ElasticBeam2d(int tag, double A, double E, double I,
101  int Nd1, int Nd2, CrdTransf2d &theTransf,
102  double d = 0.0, double rho = 0.0, int release= 0);
103  Element *getCopy(void) const;
104 
105  const Vector &computeCurrentStrain(void) const;
106 
107  inline int getReleaseCode(void) const
108  { return release; }
109  inline void setReleaseCode(const int &rc)
110  { release= rc; }
111 
112  virtual int update(void);
113  int commitState(void);
114  int revertToLastCommit(void);
115  int revertToStart(void);
116 
117  inline double getDepth(void) const
118  { return d; }
119  void setDepth(const double &h)
120  { d= h; }
121 
122  const Matrix &getTangentStiff(void) const;
123  const Matrix &getInitialStiff(void) const;
124  const Matrix &getMass(void) const;
125 
126  void zeroLoad(void);
127  int addLoad(ElementalLoad *, double loadFactor);
128  int addInertiaLoadToUnbalance(const Vector &accel);
129 
130  const Vector &getResistingForce(void) const;
131  const Vector &getResistingForceIncInertia(void) const;
132 
133  int sendSelf(Communicator &);
134  int recvSelf(const Communicator &);
135 
136  void Print(std::ostream &s, int flag = 0) const;
137 
139  inline double getV(void) const
140  { return -(q(1)+q(2))/theCoordTransf->getInitialLength(); }
142  inline double getV1(void) const
143  { return getV()-p0[1]; }
145  inline double getV2(void) const
146  { return getV()+p0[2]; }
147 
149  inline double getN1(void) const
150  { return q(0)-p0[0]; }
152  inline double getN2(void) const
153  { return q(0); }
154 
156  inline double getM1(void) const
157  { return -q(1); }
159  inline double getM2(void) const
160  { return q(2); }
161 
162 
163  Response *setResponse(const std::vector<std::string> &argv, Parameter &param);
164  int getResponse(int responseID, Information &info);
165 
166  int setParameter(const std::vector<std::string> &argv, Parameter &param);
167  int updateParameter(int parameterID, Information &info);
168 
169  };
170 } // end of XC namespace
171 
172 #endif
173 
174 
int setParameter(const std::vector< std::string > &argv, Parameter &param)
Sets the value param to the parameter argv.
Definition: ElasticBeam2d.cpp:597
Float vector abstraction.
Definition: Vector.h:94
const Matrix & getTangentStiff(void) const
getTangent stiffness matrix.
Definition: ElasticBeam2d.cpp:177
void Print(std::ostream &s, int flag=0) const
Print stuff.
Definition: ElasticBeam2d.cpp:517
ElasticBeam2d(int tag=0)
Default constructor.
Definition: ElasticBeam2d.cpp:94
double getV1(void) const
Internal shear force at the back end.
Definition: ElasticBeam2d.h:142
Information about an element.
Definition: Information.h:81
Communication parameters between processes.
Definition: Communicator.h:66
Base class response objects.
Definition: Response.h:81
const Vector & computeCurrentStrain(void) const
Compute the current strain.
Definition: ElasticBeam2d.cpp:131
CrdTransf provides the abstraction of a frame coordinate transformation.
Definition: CrdTransf.h:88
virtual int update(void)
Update element state.
Definition: ElasticBeam2d.cpp:141
Base class for materials.
Definition: Material.h:93
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
int commitState(void)
Commit the element state.
Definition: ElasticBeam2d.cpp:149
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: ElasticBeam2d.cpp:467
double getV(void) const
Internal shear force in the middle of the element.
Definition: ElasticBeam2d.h:139
int revertToLastCommit(void)
Revert the element to its last commited state.
Definition: ElasticBeam2d.cpp:161
int updateParameter(int parameterID, Information &info)
Updates the parameter identified by parameterID with info.
Definition: ElasticBeam2d.cpp:632
Base class for the finite elements.
Definition: Element.h:112
int recvSelf(const Communicator &)
Receive the object.
Definition: ElasticBeam2d.cpp:504
2D elastic beam element.
Definition: ElasticBeam2d.h:76
Base class for 2D coordinate transformation.
Definition: CrdTransf2d.h:78
int sendData(Communicator &comm)
Send members through the communicator argument.
Definition: ElasticBeam2d.cpp:474
double getM2(void) const
Internal bending moment at the front end.
Definition: ElasticBeam2d.h:159
Element * getCopy(void) const
Virtual constructor.
Definition: ElasticBeam2d.cpp:127
int sendSelf(Communicator &)
Send the object.
Definition: ElasticBeam2d.cpp:491
double getN2(void) const
Internal axial force at the front end.
Definition: ElasticBeam2d.h:152
const Vector & getResistingForceIncInertia(void) const
Return the element resisting force including inertia effects.
Definition: ElasticBeam2d.cpp:436
double getInitialLength(void) const
Return the initial length of the element.
Definition: CrdTransf2d.h:106
int addLoad(ElementalLoad *, double loadFactor)
Add the load to the element.
Definition: ElasticBeam2d.cpp:309
double getM1(void) const
Internal bending moment at the back end.
Definition: ElasticBeam2d.h:156
int revertToStart(void)
Revert the element state to the start.
Definition: ElasticBeam2d.cpp:169
CrdTransf2d * theCoordTransf
Coordinate transformation.
Definition: ElasticBeam2dBase.h:42
Internal forces for a beam-column 2D element.
Definition: FVectorBeamColumn2d.h:41
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Matrix of floats.
Definition: Matrix.h:111
const Matrix & getInitialStiff(void) const
Return initial stiffness matrix.
Definition: ElasticBeam2d.cpp:237
Parameter.
Definition: Parameter.h:68
Base class for loads over elements.
Definition: ElementalLoad.h:79
int recvData(const Communicator &comm)
Receives members through the communicator argument.
Definition: ElasticBeam2d.cpp:483
Base class for 2D elastic beam elements.
Definition: ElasticBeam2dBase.h:39
void zeroLoad(void)
Make the load null.
Definition: ElasticBeam2d.cpp:301
double getV2(void) const
Internal shear force at the front end.
Definition: ElasticBeam2d.h:145
int getResponse(int responseID, Information &info)
Obtain information from an analysis.
Definition: ElasticBeam2d.cpp:566
const Vector & getResistingForce(void) const
Return the element resisting force.
Definition: ElasticBeam2d.cpp:376
const Matrix & getMass(void) const
Return the mass matrix.
Definition: ElasticBeam2d.cpp:276
double getN1(void) const
Internal axial force at the back end.
Definition: ElasticBeam2d.h:149