XC Open source finite element analysis program
UpdatedLagrangianBeam2D.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 /* ****************************************************************** **
28 ** OpenSees - Open System for Earthquake Engineering Simulation **
29 ** Pacific Earthquake Engineering Research Center **
30 ** **
31 ** **
32 ** (C) Copyright 1999, The Regents of the University of California **
33 ** All Rights Reserved. **
34 ** **
35 ** See file 'COPYRIGHT' in main directory for information on usage **
36 ** and redistribution of OpenSees, and for a DISCLAIMER OF ALL **
37 ** WARRANTIES. **
38 ** **
39 ** UpdatedLagrangianBeam2D.h: interface for UpdatedLagrangianBeam2D **
40 ** Developed by: **
41 ** Rohit Kaul (rkaul@stanford.edu) **
42 ** Greg Deierlein (ggd@stanford.edu) **
43 ** **
44 ** John A. Blume Earthquake Engineering Center **
45 ** Stanford University **
46 ** ****************************************************************** **/
47 
48 
49 // UpdatedLagrangianBeam2D.h: interface for the UpdatedLagrangianBeam2D class
50 // Written: rkaul
51 //
52 // Description: This file contains the class definition for UpdatedLagrangianBeam2D.
53 
54 // UpdatedLagrangianBeam2D is an abstract class providing most methods required by
55 // the base class "Element", for 2D beam-column elements. Geometric
56 // nonlinearity is incorporated at this level using updated lagrangian
57 // formulation
58 
59 #ifndef UpdatedLagrangianElement2D
60 #define UpdatedLagrangianElement2D
61 
62 
63 
64 #include <domain/mesh/node/Node.h>
65 #include <utility/matrix/Matrix.h>
66 #include <utility/matrix/Vector.h>
67 #include <domain/mesh/element/Element1D.h>
68 
69 namespace XC {
70 class Response;
71 
73 //
76  {
77  protected:
78  bool isLinear;
79  int numDof;
80  mutable double L;
81  mutable double sn, cs;
82  double massDof;
83 
84  Node *end1Ptr(void);
85  const Node *end1Ptr(void) const;
86  Node *end2Ptr(void);
87  const Node *end2Ptr(void) const;
88  double L_hist, cs_hist, sn_hist;
89 
90  mutable Vector eleForce;
91  Vector eleForce_hist;
92 
93  int nodeRecord, dofRecord;
94  mutable int m_Iter;
95 
96  mutable Matrix *Ki;
97 
98  static Matrix K, Kg, Kt; // stiffness matrices
99  static Matrix M; // mass matrix
100  static Matrix D; // damping matrix
101  static Matrix T; // transformation matrix
102 
103  static Vector disp;
104  static Vector force;
105 
106  // ZeroVector and ZeroMatrix should always have zero value,
107  // used for quick return
108  static Vector ZeroVector;
109  static Matrix ZeroMatrix;
110 
111  // used for temporarily storing nodal displacements
112  static Vector end1IncrDisp;
113  static Vector end2IncrDisp;
114 
115  virtual void getLocalStiff(Matrix &K) const=0;
116  virtual void getLocalMass(Matrix &M) const=0;
117 
118 
119  void getIncrLocalDisp(Vector &localDisp) const;
120  void getTrialNaturalDisp(Vector &localDisp);
121  void getIncrNaturalDisp(Vector &nDisp) const;
122  void getConvLocalDisp(Vector &lDisp);
123  void getTrialLocalDisp(Vector &lDisp) const;
124  void getTrialLocalForce(Vector &force) const;
125 
126  virtual void updateState(void) const;
127 
128  void addInternalGeomStiff(Matrix &K) const;
129  void addExternalGeomStiff(Matrix &K) const;
130 
131  void transformToGlobal(Matrix &K) const;
132  public:
133  UpdatedLagrangianBeam2D(int classTag);
134  UpdatedLagrangianBeam2D(int tag, int classTag, int nd1, int nd2, bool islinear = false);
135  virtual ~UpdatedLagrangianBeam2D(void);
136 
138  // Overridden public methods, defined in Element class
139  // (see ~/OpenSees/SRC/element/Element.h)
141  public:
142  virtual int update(void);
143  // void setEndRelease(ID &g);
144 
145  int getNumDOF(void) const;
146  virtual void setDomain(Domain *theDomain);
147 
148  virtual int commitState(void);
149  virtual int revertToLastCommit(void);
150 
151  // methods to return the current linearized stiffness,
152  // damping and mass matrices
153  virtual const Matrix &getTangentStiff(void) const;
154  virtual const Matrix &getInitialStiff(void) const;
155  virtual const Matrix &getMass(void) const;
156 
157  // methods for returning and applying loads
158  virtual Vector &getUVLoadVector(double q1, double q2);
159  int addLoad(const Vector &load);
160  int addLoad(ElementalLoad *theLoad, double loadFactor)
161  { return -1;}
162  int addInertiaLoadToUnbalance(const Vector &accel)
163  { return -1;}
164 
165  virtual const Vector &getResistingForce(void) const;
166  const Vector &getResistingForceIncInertia(void) const;
167 
168  virtual Response *setResponse(const std::vector<std::string> &argv,
169  Information &eleInformation);
170  virtual int getResponse(int responseID, Information &eleInformation);
171  };
172 } // end of XC namespace
173 
174 
175 #endif // !defined(UpdatedLagrangianElement2D)
virtual int commitState(void)
Consuma el estado of the element.
Definition: UpdatedLagrangianBeam2D.cpp:169
Vector load
vector for applying loads
Definition: Element.h:129
virtual int update(void)
Actualiza el estado of the element.
Definition: UpdatedLagrangianBeam2D.cpp:163
Domain (mesh and boundary conditions) of the finite element model.
Definition: Domain.h:98
Definition: Vector.h:82
virtual const Matrix & getMass(void) const
Returns the mass matrix.
Definition: UpdatedLagrangianBeam2D.cpp:383
Mesh node.
Definition: Node.h:99
Information about an element.
Definition: Information.h:80
Lagrangian 2D beam element.
Definition: UpdatedLagrangianBeam2D.h:75
Base class for loads over elements.
Definition: ElementalLoad.h:73
Base class for one-dimensional elements (beam,truss,...)
Definition: Element1D.h:51
virtual void updateState(void) const
Updates the values of element length and direction.
Definition: UpdatedLagrangianBeam2D.cpp:204
double cs
Element direction.
Definition: UpdatedLagrangianBeam2D.h:81
virtual void setDomain(Domain *theDomain)
Sets the domain for the element.
Definition: UpdatedLagrangianBeam2D.cpp:118
Definition: Matrix.h:82
double L
Element length.
Definition: UpdatedLagrangianBeam2D.h:80
const Vector & getResistingForceIncInertia(void) const
Returns the action of the element over its attached nodes. Computes damping matrix.
Definition: UpdatedLagrangianBeam2D.cpp:538
================================================================================
Definition: ContinuaReprComponent.h:34
Definition: Response.h:71