xc
UpdatedLagrangianBeam2D.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 ** See file 'COPYRIGHT' in main directory for information on usage **
37 ** and redistribution of OpenSees, and for a DISCLAIMER OF ALL **
38 ** WARRANTIES. **
39 ** **
40 ** UpdatedLagrangianBeam2D.h: interface for UpdatedLagrangianBeam2D **
41 ** Developed by: **
42 ** Rohit Kaul (rkaul@stanford.edu) **
43 ** Greg Deierlein (ggd@stanford.edu) **
44 ** **
45 ** John A. Blume Earthquake Engineering Center **
46 ** Stanford University **
47 ** ****************************************************************** **/
48 
49 
50 // UpdatedLagrangianBeam2D.h: interface for the UpdatedLagrangianBeam2D class
51 // Written: rkaul
52 //
53 // Description: This file contains the class definition for UpdatedLagrangianBeam2D.
54 
55 // UpdatedLagrangianBeam2D is an abstract class providing most methods required by
56 // the base class "Element", for 2D beam-column elements. Geometric
57 // nonlinearity is incorporated at this level using updated lagrangian
58 // formulation
59 
60 #ifndef UpdatedLagrangianElement2D
61 #define UpdatedLagrangianElement2D
62 
63 
64 
65 #include <domain/mesh/node/Node.h>
66 #include <utility/matrix/Matrix.h>
67 #include <utility/matrix/Vector.h>
68 #include <domain/mesh/element/Element1D.h>
69 
70 namespace XC {
71 class Response;
72 
76 //
84  {
85  protected:
86  bool isLinear;
87  int numDof;
88  mutable double L;
89  mutable double sn, cs;
90  double massDof;
91 
92  Node *end1Ptr(void);
93  const Node *end1Ptr(void) const;
94  Node *end2Ptr(void);
95  const Node *end2Ptr(void) const;
96  double L_hist, cs_hist, sn_hist;
97 
98  mutable Vector eleForce;
99  Vector eleForce_hist;
100 
101  int nodeRecord, dofRecord;
102  mutable int m_Iter;
103 
104  mutable Matrix *Ki;
105 
106  static Matrix K, Kg, Kt; // stiffness matrices
107  static Matrix M; // mass matrix
108  static Matrix D; // damping matrix
109  static Matrix T; // transformation matrix
110 
111  static Vector disp;
112  static Vector force;
113 
114  // ZeroVector and ZeroMatrix should always have zero value,
115  // used for quick return
116  static Vector ZeroVector;
117  static Matrix ZeroMatrix;
118 
119  // used for temporarily storing nodal displacements
120  static Vector end1IncrDisp;
121  static Vector end2IncrDisp;
122 
123  virtual void getLocalStiff(Matrix &K) const=0;
124  virtual void getLocalMass(Matrix &M) const=0;
125 
126 
127  void getIncrLocalDisp(Vector &localDisp) const;
128  void getTrialNaturalDisp(Vector &localDisp);
129  void getIncrNaturalDisp(Vector &nDisp) const;
130  void getConvLocalDisp(Vector &lDisp);
131  void getTrialLocalDisp(Vector &lDisp) const;
132  void getTrialLocalForce(Vector &force) const;
133 
134  virtual void updateState(void) const;
135 
136  void addInternalGeomStiff(Matrix &K) const;
137  void addExternalGeomStiff(Matrix &K) const;
138 
139  void transformToGlobal(Matrix &K) const;
140  public:
141  UpdatedLagrangianBeam2D(int classTag);
142  UpdatedLagrangianBeam2D(int tag, int classTag, int nd1, int nd2, bool islinear = false);
143  virtual ~UpdatedLagrangianBeam2D(void);
144 
146  // Overridden public methods, defined in Element class
147  // (see ~/OpenSees/SRC/element/Element.h)
149  public:
150  virtual int update(void);
151  // void setEndRelease(ID &g);
152 
153  int getNumDOF(void) const;
154  virtual void setDomain(Domain *theDomain);
155 
156  virtual int commitState(void);
157  virtual int revertToLastCommit(void);
158 
159  // methods to return the current linearized stiffness,
160  // damping and mass matrices
161  virtual const Matrix &getTangentStiff(void) const;
162  virtual const Matrix &getInitialStiff(void) const;
163  virtual const Matrix &getMass(void) const;
164 
165  // methods for returning and applying loads
166  virtual Vector &getUVLoadVector(double q1, double q2);
167  int addLoad(const Vector &load);
168  int addLoad(ElementalLoad *, double loadFactor)
169  { return -1;}
170  int addInertiaLoadToUnbalance(const Vector &accel)
171  { return -1;}
172 
173  virtual const Vector &getResistingForce(void) const;
174  const Vector &getResistingForceIncInertia(void) const;
175 
176  virtual Response *setResponse(const std::vector<std::string> &argv,
177  Information &eleInformation);
178  virtual int getResponse(int responseID, Information &eleInformation);
179  };
180 } // end of XC namespace
181 
182 
183 #endif // !defined(UpdatedLagrangianElement2D)
Float vector abstraction.
Definition: Vector.h:94
double L
Element length.
Definition: UpdatedLagrangianBeam2D.h:88
Information about an element.
Definition: Information.h:81
Base class response objects.
Definition: Response.h:81
virtual int getResponse(int responseID, Information &eleInformation)
Obtain information from an analysis.
Definition: UpdatedLagrangianBeam2D.cpp:825
virtual int revertToLastCommit(void)
Revert to the last committed state.
Definition: UpdatedLagrangianBeam2D.cpp:236
Base class for one-dimensional elements (beam,truss,...)
Definition: Element1D.h:52
Updated Lagrangian 2D beam element.
Definition: UpdatedLagrangianBeam2D.h:83
virtual const Vector & getResistingForce(void) const
Returns the resisting force vector for the element.
Definition: UpdatedLagrangianBeam2D.cpp:484
virtual void setDomain(Domain *theDomain)
Sets the domain for the element.
Definition: UpdatedLagrangianBeam2D.cpp:118
const Vector & getResistingForceIncInertia(void) const
Returns the resisting force vector including inertia forces.
Definition: UpdatedLagrangianBeam2D.cpp:538
int getNumDOF(void) const
return the number of DOF associated with the element.
Definition: UpdatedLagrangianBeam2D.cpp:336
virtual int update(void)
Updates the element state.
Definition: UpdatedLagrangianBeam2D.cpp:163
virtual const Matrix & getTangentStiff(void) const
Return the tangent stiffness matrix.
Definition: UpdatedLagrangianBeam2D.cpp:339
Vector load
vector for applied nodal loads.
Definition: Element.h:137
double cs
Element direction.
Definition: UpdatedLagrangianBeam2D.h:89
virtual Response * setResponse(const std::vector< std::string > &argv, Information &eleInformation)
setResponse() is a method invoked to determine if the element will respond to a request for a certain...
Definition: UpdatedLagrangianBeam2D.cpp:772
virtual const Matrix & getMass(void) const
Returns the mass matrix.
Definition: UpdatedLagrangianBeam2D.cpp:383
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Matrix of floats.
Definition: Matrix.h:111
virtual void updateState(void) const
Updates the values of element length and direction.
Definition: UpdatedLagrangianBeam2D.cpp:204
Base class for loads over elements.
Definition: ElementalLoad.h:79
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:117
Mesh node.
Definition: Node.h:111
virtual int commitState(void)
Commit the current element state.
Definition: UpdatedLagrangianBeam2D.cpp:169