xc
FE_Element.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 ** Commercial use of this program without express permission of the **
36 ** University of California, Berkeley, is strictly prohibited. See **
37 ** file 'COPYRIGHT' in main directory for information on usage and **
38 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
39 ** **
40 ** Developed by: **
41 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
42 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
43 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
44 ** **
45 ** ****************************************************************** */
46 
47 // $Revision: 1.13 $
48 // $Date: 2005/11/29 22:46:50 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/analysis/model/fe_ele/FE_Element.h,v $
50 
51 
52 #ifndef FE_Element_h
53 #define FE_Element_h
54 
55 // File: ~/analysis/model/fe_ele/FE_Element.h
56 //
57 // Written: fmk
58 // Created: 11/96
59 // Revision: A
60 //
61 // Description: This file contains the class definition for FE_Element.
62 //
63 // What: "@(#) FE_Element.h, revA"
64 
65 #include <utility/tagged/TaggedObject.h>
66 #include "utility/matrix/ID.h"
67 #include "solution/analysis/UnbalAndTangent.h"
68 
69 namespace XC {
70 class TransientIntegrator;
71 class Element;
72 class Vector;
73 class Matrix;
74 class Integrator;
75 class AnalysisModel;
76 
80 //
82 //
108  {
109  private:
110  int numDOF;
111  UnbalAndTangent unbalAndTangent;
112  AnalysisModel *theModel;
113  Element *myEle;
114  Integrator *theIntegrator;
115 
116  // static variables - single copy for all objects of the class
117  static Matrix errMatrix;
118  static Vector errVector;
119  static UnbalAndTangentStorage unbalAndTangentArray;
120  static int numFEs;
121  void set_pointers(void);
122 
123  protected:
124  void addLocalM_Force(const Vector &accel, double fact = 1.0);
125  void addLocalD_Force(const Vector &vel, double fact = 1.0);
126  void addLocalM_ForceSensitivity(int gradNumber, const Vector &accel, double fact = 1.0);
127  void addLocalD_ForceSensitivity(int gradNumber, const Vector &vel, double fact = 1.0);
128 
129 
130  // protected variables - a copy for each object of the class
131  ID myDOF_Groups;
132  ID myID;
133 
134  friend class AnalysisModel;
135  FE_Element(int tag, Element *theElement);
136  FE_Element(int tag, int numDOF_Group, int ndof);
137  public:
138  virtual ~FE_Element(void);
139 
140  // public methods for setting/obtaining mapping information
141  virtual const ID &getDOFtags(void) const;
142  virtual const ID &getID(void) const;
143  void setAnalysisModel(AnalysisModel &theModel);
144  virtual int setID(void);
145 
146  // methods to form and obtain the tangent and residual
147  virtual const Matrix &getTangent(Integrator *theIntegrator);
148  virtual const Vector &getResidual(Integrator *theIntegrator);
149 
150  // methods to allow integrator to build tangent
151  virtual void zeroTangent(void);
152  virtual void addKtToTang(double fact = 1.0);
153  virtual void addKiToTang(double fact = 1.0);
154  virtual void addCtoTang(double fact = 1.0);
155  virtual void addMtoTang(double fact = 1.0);
156 
157  // methods to allow integrator to build residual
158  virtual void zeroResidual(void);
159  virtual void addRtoResidual(double fact = 1.0);
160  virtual void addRIncInertiaToResidual(double fact = 1.0);
161 
162  // methods for ele-by-ele strategies
163  virtual const Vector &getTangForce(const Vector &x, double fact = 1.0);
164  virtual const Vector &getK_Force(const Vector &x, double fact = 1.0);
165  virtual const Vector &getC_Force(const Vector &x, double fact = 1.0);
166  virtual const Vector &getM_Force(const Vector &x, double fact = 1.0);
167  virtual void addM_Force(const Vector &accel, double fact = 1.0);
168  virtual void addD_Force(const Vector &vel, double fact = 1.0);
169 
170  virtual int updateElement(void);
171 
172  virtual Integrator *getLastIntegrator(void);
173  virtual const Vector &getLastResponse(void);
174  Element *getElement(void);
175 
176  virtual void Print(std::ostream &, int = 0) {return;};
177 
178  // AddingSensitivity:BEGIN ////////////////////////////////////
179  virtual void addResistingForceSensitivity(int gradNumber, double fact = 1.0);
180  virtual void addM_ForceSensitivity(int gradNumber, const Vector &vect, double fact = 1.0);
181  virtual void addD_ForceSensitivity(int gradNumber, const Vector &vect, double fact = 1.0);
182  virtual int commitSensitivity(int gradNum, int numGrads);
183  // AddingSensitivity:END //////////////////////////////////////
184 
185  };
186 } // end of XC namespace
187 
188 #endif
189 
190 
Unbalanced force vector and tangent stiffness matrix.
Definition: UnbalAndTangentStorage.h:42
virtual const ID & getDOFtags(void) const
Returns the tags of the associated DOF_Groups.
Definition: FE_Element.cpp:213
virtual const Matrix & getTangent(Integrator *theIntegrator)
Computes and returns the tangent stiffness matrix.
Definition: FE_Element.cpp:298
Float vector abstraction.
Definition: Vector.h:93
virtual void Print(std::ostream &, int=0)
Print stuff.
Definition: FE_Element.h:176
virtual const Vector & getM_Force(const Vector &x, double fact=1.0)
Returns the product of elements current mass matrix and a Vector whose values are obtained by taking ...
Definition: FE_Element.cpp:735
FE_Element(int tag, Element *theElement)
Construictor that take the corresponding model element.
Definition: FE_Element.cpp:117
virtual ~FE_Element(void)
Destructor.
Definition: FE_Element.cpp:197
virtual const Vector & getResidual(Integrator *theIntegrator)
Computes and returns the residual vector.
Definition: FE_Element.cpp:335
virtual void addCtoTang(double fact=1.0)
Adds the product of fact times the element&#39;s damping matrix to the tangent.
Definition: FE_Element.cpp:434
Vector of integers.
Definition: ID.h:93
virtual void zeroResidual(void)
Zeros the residual vector.
Definition: FE_Element.cpp:528
virtual const Vector & getLastResponse(void)
A method which invokes getLastResponse() on the Integrator object that was last passed as an argument...
Definition: FE_Element.cpp:829
Base class for the finite elements.
Definition: Element.h:109
void setAnalysisModel(AnalysisModel &theModel)
Sets the link with the analysis model.
Definition: FE_Element.cpp:230
virtual void addKiToTang(double fact=1.0)
Adds the product of fact times the element&#39;s initial stiffness matrix to the tangent.
Definition: FE_Element.cpp:498
virtual void addM_Force(const Vector &accel, double fact=1.0)
Adds to the residual the product of elements current mass matrix and a Vector whose values are obtain...
Definition: FE_Element.cpp:866
Container for FE_Element and DOF_Group objects created by the constraint handler. ...
Definition: AnalysisModel.h:133
Unbalanced force vector and tangent stiffness matrix.
Definition: UnbalAndTangent.h:40
Base class for the objects that performs the integration of physical properties over the domain to fo...
Definition: Integrator.h:99
virtual void addD_Force(const Vector &vel, double fact=1.0)
Adds to the residual the product of elements current damping matrix and a Vector whose values are obt...
Definition: FE_Element.cpp:913
virtual void addKtToTang(double fact=1.0)
Adds the product of fact times the element&#39;s tangent stiffness matrix to the tangent.
Definition: FE_Element.cpp:403
virtual Integrator * getLastIntegrator(void)
Method which returns the last integrator supplied in a formTangent() or a formResidual() invocation...
Definition: FE_Element.cpp:817
virtual void zeroTangent(void)
Zeros the tangent matrix.
Definition: FE_Element.cpp:374
Element * getElement(void)
Returns a pointer to the associated element.
Definition: FE_Element.cpp:1012
Object idenfied by an integer (tag).
Definition: TaggedObject.h:91
Finite element as seen by analysis.
Definition: FE_Element.h:107
virtual void addMtoTang(double fact=1.0)
Adds the product of fact times the element&#39;s mass matrix to the tangent.
Definition: FE_Element.cpp:465
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
virtual const Vector & getTangForce(const Vector &x, double fact=1.0)
Returns the product of FE_Elements current tangent matrix and a Vector whose values are obtained by t...
Definition: FE_Element.cpp:631
Matrix of floats.
Definition: Matrix.h:108
virtual void addRIncInertiaToResidual(double fact=1.0)
Adds to the residual vector the product of the elements residual load vector with inertia forces incl...
Definition: FE_Element.cpp:593
virtual const ID & getID(void) const
Method to return the ID containing equation numbers.
Definition: FE_Element.cpp:222
virtual int setID(void)
Method to set the corresponding index of the ID to value.
Definition: FE_Element.cpp:250
virtual void addRtoResidual(double fact=1.0)
Adds to the residual vector the product of the elements residual load vector and fact.
Definition: FE_Element.cpp:557