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