xc
DOF_Group.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.11 $
49 // $Date: 2005/11/28 21:40:46 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/analysis/model/dof_grp/DOF_Group.h,v $
51 
52 
53 #ifndef DOF_Group_h
54 #define DOF_Group_h
55 
56 // File: ~/analysis/model/dof_grp/DOF_Group.h
57 //
58 // Written: fmk
59 // Created: 11/96
60 // Revision: A
61 //
62 // Description: This file contains the class definition for DOF_Group.
63 // A DOF_Group object is instantiated by the ConstraintHandler for
64 // every unconstrained node in the domain. The constrained nodes require
65 // specialised types of DOF_Group; which deal with the constraints. DOF_Group
66 // objects can handle 0 boundary constraints; if the eqn number of a DOF is
67 // less than START_EQN_NUM a value of 0.0 is set for disp, vel and accel when
68 // a setNode*(Vector &) is invoked.
69 //
70 // What: "@(#) DOF_Group.h, revA"
71 
72 #include <utility/matrix/ID.h>
73 #include <utility/tagged/TaggedObject.h>
74 #include <vector>
75 #include "solution/analysis/model/UnbalAndTangent.h"
76 
77 namespace XC {
78 class Node;
79 class Vector;
80 class Matrix;
81 class TransientIntegrator;
82 class Integrator;
83 
87 //
89 //
107 class DOF_Group: public TaggedObject
108  {
109  private:
110  // private variables - a copy for each object of the class
111  ID myID;
112 
113  // static variables - single copy for all objects of the class
114  static Matrix errMatrix;
115  static Vector errVect;
116  static UnbalAndTangentStorage unbalAndTangentArray;
117  static int numDOF_Groups;
118 
119  void inicID(void);
120  protected:
121  void addLocalM_Force(const Vector &Udotdot, double fact = 1.0);
122 
123  // protected variables - a copy for each object of the class
124  mutable UnbalAndTangent unbalAndTangent;
125  Node *myNode;
126 
127  friend class AnalysisModel;
128  friend class AutoConstraintHandler;
129  DOF_Group(int tag, Node *myNode);
130  DOF_Group(int tag, int ndof);
131  public:
132  virtual ~DOF_Group();
133 
134  virtual void setID(int dof, int value);
135  virtual void setID(const ID &values);
136  virtual const ID &getID(void) const;
137  int inicID(const int &value);
138  virtual int doneID(void);
139 
140  virtual int getNodeTag(void) const;
142  inline virtual int getNumDOF(void) const
143  { return myID.Size(); }
144  virtual int getNumFreeDOF(void) const;
145  virtual int getNumConstrainedDOF(void) const;
146 
147  // methods to form the tangent
148  virtual const Matrix &getTangent(Integrator *theIntegrator);
149  virtual void zeroTangent(void);
150  virtual void addMtoTang(double fact = 1.0);
151  virtual void addCtoTang(double fact = 1.0);
152 
153  // methods to form the unbalance
154  virtual const Vector &getUnbalance(Integrator *theIntegrator);
155  virtual void zeroUnbalance(void);
156  virtual void addPtoUnbalance(double fact = 1.0);
157  virtual void addPIncInertiaToUnbalance(double fact = 1.0);
158  virtual void addM_Force(const Vector &Udotdot, double fact = 1.0);
159 
160  virtual const Vector &getTangForce(const Vector &x, double fact = 1.0);
161  virtual const Vector &getC_Force(const Vector &x, double fact = 1.0);
162  virtual const Vector &getM_Force(const Vector &x, double fact = 1.0);
163 
164  // methods to obtain committed responses from the nodes
165  virtual const Vector &getCommittedDisp(void) const;
166  virtual const Vector &getCommittedVel(void) const;
167  virtual const Vector &getCommittedAccel(void) const;
168 
169  // methods to update the trial response at the nodes
170  virtual void setNodeDisp(const Vector &u);
171  virtual void setNodeVel(const Vector &udot);
172  virtual void setNodeAccel(const Vector &udotdot);
173 
174  virtual void incrNodeDisp(const Vector &u);
175  virtual void incrNodeVel(const Vector &udot);
176  virtual void incrNodeAccel(const Vector &udotdot);
177 
178  virtual const Vector &getTrialDisp(void) const;
179  virtual const Vector &getTrialVel(void) const;
180  virtual const Vector &getTrialAccel(void) const;
181 
182  // methods to set the eigen vectors
183  virtual void setEigenvector(int mode, const Vector &eigenvalue);
184 
185  // method added for TransformationDOF_Groups
186  virtual const Matrix *getT(void) const;
187 
188 // AddingSensitivity:BEGIN ////////////////////////////////////
189  virtual void addM_ForceSensitivity(const Vector &Udotdot, double fact = 1.0);
190  virtual void addD_ForceSensitivity(const Vector &vel, double fact = 1.0);
191  virtual void addD_Force(const Vector &vel, double fact = 1.0);
192 
193  virtual const Vector & getDispSensitivity(int gradNumber);
194  virtual const Vector & getVelSensitivity(int gradNumber);
195  virtual const Vector & getAccSensitivity(int gradNumber);
196  virtual int saveSensitivity(Vector *v,Vector *vdot,Vector *vdotdot,int gradNum,int numGrads);
197 // AddingSensitivity:END //////////////////////////////////////
198  virtual void Print(std::ostream &, int = 0) {return;};
199  virtual void resetNodePtr(void);
200  };
201 } // end of XC namespace
202 
203 #endif
204 
virtual void addMtoTang(double fact=1.0)
To add fact times the nodal mass matrix to the tangent matrix.
Definition: DOF_Group.cpp:287
Unbalanced force vectors and tangent stiffness matrices.
Definition: UnbalAndTangentStorage.h:47
virtual const Vector & getCommittedDisp(void) const
To return the committed displacement at the associated node.
Definition: DOF_Group.cpp:496
Float vector abstraction.
Definition: Vector.h:94
virtual void setID(int dof, int value)
to set the corresponding index of the ID to value.
Definition: DOF_Group.cpp:166
virtual const Vector & getTrialVel(void) const
Return trial velocity.
Definition: DOF_Group.cpp:784
virtual int getNumDOF(void) const
Returns the total number of DOFs in the DOF_Group.
Definition: DOF_Group.h:142
virtual void incrNodeVel(const Vector &udot)
Method to set the corresponding nodes velocities to the values in udot, components identified by myID...
Definition: DOF_Group.cpp:707
virtual const Vector & getTrialAccel(void) const
Return trial acceleration.
Definition: DOF_Group.cpp:799
virtual const ID & getID(void) const
Method to return the current ID.
Definition: DOF_Group.cpp:197
Vector of integers.
Definition: ID.h:95
virtual void incrNodeDisp(const Vector &u)
Method to set the corresponding nodes displacements to the.
Definition: DOF_Group.cpp:662
virtual const Vector & getTrialDisp(void) const
Return trial displacement.
Definition: DOF_Group.cpp:769
virtual void zeroUnbalance(void)
To zero the unbalance vector.
Definition: DOF_Group.cpp:328
virtual int getNumFreeDOF(void) const
Returns the total number of free DOFs.
Definition: DOF_Group.cpp:228
Container for FE_Element and DOF_Group objects created by the constraint handler. ...
Definition: AnalysisModel.h:134
virtual ~DOF_Group()
Destructor.
Definition: DOF_Group.cpp:144
virtual void addPtoUnbalance(double fact=1.0)
Adds the product of the unbalanced load at the node and fact to the unbalance vector.
Definition: DOF_Group.cpp:348
Unbalanced force vector and tangent stiffness matrix.
Definition: UnbalAndTangent.h:41
virtual const Vector & getCommittedVel(void) const
Return the committed velocity at the associated node.
Definition: DOF_Group.cpp:515
virtual const Matrix & getTangent(Integrator *theIntegrator)
Returns the current tangent matrix for the DOF_Group.
Definition: DOF_Group.cpp:261
Base class for the objects that performs the integration of physical properties over the domain to fo...
Definition: Integrator.h:100
DOF_Group(int tag, Node *myNode)
Constructor that take the corresponding model node.
Definition: DOF_Group.cpp:116
virtual int getNodeTag(void) const
Returns the tag of the associated node (-1 if there is no associated node).
Definition: DOF_Group.cpp:214
A DOF_Group object is instantiated by the ConstraintHandler for every unconstrained node in the domai...
Definition: DOF_Group.h:107
virtual void setNodeDisp(const Vector &u)
Method to set the corresponding nodes displacements to the values in u, components identified by myID...
Definition: DOF_Group.cpp:561
virtual const Vector & getCommittedAccel(void) const
Return the committed acceleration at the associated node.
Definition: DOF_Group.cpp:534
virtual void setNodeVel(const Vector &udot)
Method to set the corresponding nodes velocities to the values in udot, components identified by myID...
Definition: DOF_Group.cpp:596
Object idenfied by an integer (tag).
Definition: TaggedObject.h:92
virtual int getNumConstrainedDOF(void) const
Returns the total number of constrained DOFs.
Definition: DOF_Group.cpp:244
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
virtual void setNodeAccel(const Vector &udotdot)
Method to set the corresponding nodes accelerations to the values in udotdot, components identified b...
Definition: DOF_Group.cpp:635
Definition: AutoConstraintHandler.h:84
Matrix of floats.
Definition: Matrix.h:111
virtual const Vector & getUnbalance(Integrator *theIntegrator)
Returns the vector holding the unbalance.
Definition: DOF_Group.cpp:332
Mesh node.
Definition: Node.h:111
virtual void zeroTangent(void)
To zero the tangent matrix.
Definition: DOF_Group.cpp:272
int Size(void) const
Returns the vector size.
Definition: ID.h:115