xc
FE_Element.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.13 $
49 // $Date: 2005/11/29 22:46:50 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/analysis/model/fe_ele/FE_Element.h,v $
51 
52 
53 #ifndef FE_Element_h
54 #define FE_Element_h
55 
56 // File: ~/analysis/model/fe_ele/FE_Element.h
57 //
58 // Written: fmk
59 // Created: 11/96
60 // Revision: A
61 //
62 // Description: This file contains the class definition for FE_Element.
63 //
64 // What: "@(#) FE_Element.h, revA"
65 
66 #include <utility/tagged/TaggedObject.h>
67 #include "utility/matrix/ID.h"
68 #include "solution/analysis/model/UnbalAndTangent.h"
69 
70 namespace XC {
71 class TransientIntegrator;
72 class Element;
73 class Vector;
74 class Matrix;
75 class Integrator;
76 class AnalysisModel;
77 
81 //
83 //
109  {
110  private:
111  int numDOF;
112  UnbalAndTangent unbalAndTangent;
113  AnalysisModel *theModel;
114  Element *myEle;
115  Integrator *theIntegrator;
116 
117  // static variables - single copy for all objects of the class
118  static Matrix errMatrix;
119  static Vector errVector;
120  static UnbalAndTangentStorage unbalAndTangentArray;
121  static int numFEs;
122  void set_pointers(void);
123 
124  protected:
125  void addLocalM_Force(const Vector &accel, double fact = 1.0);
126  void addLocalD_Force(const Vector &vel, double fact = 1.0);
127  void addLocalM_ForceSensitivity(int gradNumber, const Vector &accel, double fact = 1.0);
128  void addLocalD_ForceSensitivity(int gradNumber, const Vector &vel, double fact = 1.0);
129 
130 
131  // protected variables - a copy for each object of the class
132  ID myDOF_Groups;
133  ID myID;
134 
135  friend class AnalysisModel;
136  friend class AutoConstraintHandler;
137  FE_Element(int tag, Element *theElement);
138  FE_Element(int tag, int numDOF_Group, int ndof);
139  public:
140  virtual ~FE_Element(void);
141 
142  // public methods for setting/obtaining mapping information
143  virtual const ID &getDOFtags(void) const;
144  virtual const ID &getID(void) const;
145  void setAnalysisModel(AnalysisModel &theModel);
146  virtual int setID(void);
147 
148  // methods to form and obtain the tangent and residual
149  virtual const Matrix &getTangent(Integrator *theIntegrator);
150  virtual const Vector &getResidual(Integrator *theIntegrator);
151 
152  // methods to allow integrator to build tangent
153  virtual void zeroTangent(void);
154  virtual void addKtToTang(double fact = 1.0);
155  virtual void addKiToTang(double fact = 1.0);
156  virtual void addCtoTang(double fact = 1.0);
157  virtual void addMtoTang(double fact = 1.0);
158 
159  // activate and deactivate FE_Element.
160  void activate(void);
161  void deactivate(void);
162  bool isActive(void) const;
163 
164  // methods to allow integrator to build residual
165  virtual void zeroResidual(void);
166  virtual void addRtoResidual(double fact = 1.0);
167  virtual void addRIncInertiaToResidual(double fact = 1.0);
168 
169  // methods for ele-by-ele strategies
170  virtual const Vector &getTangForce(const Vector &x, double fact = 1.0);
171  virtual const Vector &getK_Force(const Vector &x, double fact = 1.0);
172  virtual const Vector &getKi_Force(const Vector &x, double fact = 1.0);
173  virtual const Vector &getC_Force(const Vector &x, double fact = 1.0);
174  virtual const Vector &getM_Force(const Vector &x, double fact = 1.0);
175  virtual void addM_Force(const Vector &accel, double fact = 1.0);
176  virtual void addD_Force(const Vector &vel, double fact = 1.0);
177 
178  virtual int updateElement(void);
179 
180  virtual Integrator *getLastIntegrator(void);
181  virtual const Vector &getLastResponse(void);
182  Element *getElement(void);
183  std::string getElementClassName(void) const;
184 
185  virtual void Print(std::ostream &, int = 0) {return;};
186 
187  // AddingSensitivity:BEGIN ////////////////////////////////////
188  virtual void addResistingForceSensitivity(int gradNumber, double fact = 1.0);
189  virtual void addM_ForceSensitivity(int gradNumber, const Vector &vect, double fact = 1.0);
190  virtual void addD_ForceSensitivity(int gradNumber, const Vector &vect, double fact = 1.0);
191  virtual int commitSensitivity(int gradNum, int numGrads);
192  // AddingSensitivity:END //////////////////////////////////////
193 
194  };
195 } // end of XC namespace
196 
197 #endif
198 
199 
Unbalanced force vectors and tangent stiffness matrices.
Definition: UnbalAndTangentStorage.h:47
virtual const ID & getDOFtags(void) const
Returns the tags of the associated DOF_Groups.
Definition: FE_Element.cpp:214
virtual const Matrix & getTangent(Integrator *theIntegrator)
Computes and returns the tangent stiffness matrix.
Definition: FE_Element.cpp:303
Float vector abstraction.
Definition: Vector.h:94
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:806
std::string getElementClassName(void) const
Returns the name of the associated element (if any).
Definition: FE_Element.cpp:1104
FE_Element(int tag, Element *theElement)
Construictor that take the corresponding model element.
Definition: FE_Element.cpp:118
virtual ~FE_Element(void)
Destructor.
Definition: FE_Element.cpp:198
virtual const Vector & getResidual(Integrator *theIntegrator)
Computes and returns the residual vector.
Definition: FE_Element.cpp:342
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:441
Vector of integers.
Definition: ID.h:95
virtual void zeroResidual(void)
Zeros the residual vector.
Definition: FE_Element.cpp:550
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:905
Base class for the finite elements.
Definition: Element.h:112
void setAnalysisModel(AnalysisModel &theModel)
Sets the link with the analysis model.
Definition: FE_Element.cpp:231
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:505
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:942
Container for FE_Element and DOF_Group objects created by the constraint handler. ...
Definition: AnalysisModel.h:134
Unbalanced force vector and tangent stiffness matrix.
Definition: UnbalAndTangent.h:41
Base class for the objects that performs the integration of physical properties over the domain to fo...
Definition: Integrator.h:100
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:992
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:410
virtual Integrator * getLastIntegrator(void)
Method which returns the last integrator supplied in a formTangent() or a formResidual() invocation...
Definition: FE_Element.cpp:893
virtual void zeroTangent(void)
Zeros the tangent matrix.
Definition: FE_Element.cpp:381
Element * getElement(void)
Returns a pointer to the associated element.
Definition: FE_Element.cpp:1100
Object idenfied by an integer (tag).
Definition: TaggedObject.h:92
Finite element as seen by analysis.
Definition: FE_Element.h:108
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:472
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Definition: AutoConstraintHandler.h:84
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:653
Matrix of floats.
Definition: Matrix.h:111
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:615
virtual const ID & getID(void) const
Method to return the ID containing equation numbers.
Definition: FE_Element.cpp:223
virtual int setID(void)
Method to set the corresponding index of the ID to value.
Definition: FE_Element.cpp:251
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:579