XC Open source finite element analysis program
TransformationDOF_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.5 $
48 // $Date: 2005/08/03 19:12:26 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/analysis/model/dof_grp/TransformationDOF_Group.h,v $
50 
51 
52 #ifndef TransformationDOF_Group_h
53 #define TransformationDOF_Group_h
54 
55 // Written: fmk
56 // Created: 05/99
57 // Revision: A
58 //
59 // Description: This file contains the class definition for
60 // TransformationDOF_Group. A TransformationDOF_Group object is
61 // instantiated by the TransformationConstraintHandler for
62 // every node in the domain which is constrained by an MFreedom_Constraint
63 // or an SFreedom_Constrant.
64 //
65 // What: "@(#) TransformationDOF_Group.h, revA"
66 
67 #include <solution/analysis/model/dof_grp/DOF_Group.h>
68 #include "utility/matrix/Matrix.h"
69 #include "solution/analysis/UnbalAndTangent.h"
70 
71 namespace XC {
72 class MFreedom_ConstraintBase;
73 class MFreedom_Constraint;
74 class MRMFreedom_Constraint;
75 class SFreedom_Constraint;
76 class TransformationConstraintHandler;
77 
79 //
85  {
86  private:
88 
89  Matrix Trans;
90  ID modID;
91  int modNumDOF;
92  UnbalAndTangent unbalAndTangentMod;
93 
94  std::vector<SFreedom_Constraint *> theSPs;
95 
96  // static variables - single copy for all objects of the class
97  static UnbalAndTangentStorage unbalAndTangentArrayMod;
98  static int numTransDOFs;
99  static TransformationConstraintHandler *theHandler;
100 
101  void arrays_setup(int numNodalDOF, int numConstrainedNodeRetainedDOF, int numRetainedNodeDOF);
102  void initialize(TransformationConstraintHandler *);
103  protected:
104  friend class AnalysisModel;
107  std::vector<SFreedom_Constraint *> getSFreedomConstraintArray(int ) const;
110  size_t getNumRetainedNodes(void) const;
111  size_t getNumRetainedNodeDOFs(void) const;
112  std::vector<Node *> getPointersToRetainedNodes(void);
113  const Vector &setupResidual(int numCNodeDOF, const ID &,const ID &, const Vector &, const std::vector<Node *> &,const Vector &(Node::*response)(void) const);
114  const Vector &getCommittedResponse(const Vector &(Node::*response)(void) const);
115  void setupResidual(const Vector &,int (Node::*setTrial)(const Vector &));
116  public:
118 
119  // methods dealing with the ID and transformation matrix
120  int doneID(void);
121  const ID &getID(void) const;
122  virtual void setID(int dof, int value);
123  Matrix *getT(void);
124  virtual int getNumDOF(void) const;
125  virtual int getNumFreeDOF(void) const;
126  virtual int getNumConstrainedDOF(void) const;
127 
128  // methods to form the tangent
129  const Matrix &getTangent(Integrator *theIntegrator);
130 
131  // methods to form the unbalance
132  const Vector &getUnbalance(Integrator *theIntegrator);
133  void addM_Force(const Vector &Udotdot, double fact = 1.0);
134 
135  const Vector &getTangForce(const Vector &x, double fact = 1.0);
136  const Vector &getC_Force(const Vector &x, double fact = 1.0);
137  const Vector &getM_Force(const Vector &x, double fact = 1.0);
138 
139  // methods to obtain committed responses from the nodes
140  const Vector &getCommittedDisp(void);
141  const Vector &getCommittedVel(void);
142  const Vector &getCommittedAccel(void);
143 
144  // methods to update the trial response at the nodes
145  void setNodeDisp(const Vector &u);
146  void setNodeVel(const Vector &udot);
147  void setNodeAccel(const Vector &udotdot);
148 
149  void incrNodeDisp(const Vector &u);
150  void incrNodeVel(const Vector &udot);
151  void incrNodeAccel(const Vector &udotdot);
152 
153  virtual void setEigenvector(int mode, const Vector &eigenvalue);
154 
155  int addSFreedom_Constraint(SFreedom_Constraint &theSP);
156  int enforceSPs(void);
157 
158 // AddingSensitivity:BEGIN ////////////////////////////////////
159  void addM_ForceSensitivity(const Vector &Udotdot, double fact = 1.0);
160  void addD_ForceSensitivity(const Vector &vel, double fact = 1.0);
161  void addD_Force(const Vector &vel, double fact = 1.0);
162 
163  const Vector & getDispSensitivity(int gradNumber);
164  const Vector & getVelSensitivity(int gradNumber);
165  const Vector & getAccSensitivity(int gradNumber);
166  int saveSensitivity(Vector *v,Vector *vdot,Vector *vdotdot,int gradNum,int numGrads);
167 // AddingSensitivity:END //////////////////////////////////////
168  };
169 } // end of XC namespace
170 
171 #endif
172 
Vector de fuerza desequilibrada y tangent stiffness matrix.
Definition: UnbalAndTangentStorage.h:42
void setNodeDisp(const Vector &u)
Method to set the corresponding nodes displacements to the values in u, components identified by myID...
Definition: TransformationDOF_Group.cpp:391
A DOF_Group object is instantiated by the ConstraintHandler for every unconstrained node in the domai...
Definition: DOF_Group.h:94
Definition: Vector.h:82
const ID & getID(void) const
Method to return the current ID.
Definition: TransformationDOF_Group.cpp:199
size_t getNumRetainedNodes(void) const
Returns the number of retained nodes.
Definition: TransformationDOF_Group.cpp:309
Mesh node.
Definition: Node.h:99
std::vector< SFreedom_Constraint * > getSFreedomConstraintArray(int) const
Create SFreedom_Constraint pointer array.
Definition: TransformationDOF_Group.cpp:82
Vector de fuerza desequilibrada y tangent stiffness matrix.
Definition: UnbalAndTangent.h:40
void setNodeVel(const Vector &udot)
Method to set the corresponding nodes velocities to the values in u, components identified by myID...
Definition: TransformationDOF_Group.cpp:406
A TransformationDOF_Group object is instantiated by the TransformationConstraintHandler for every nod...
Definition: TransformationDOF_Group.h:84
const Vector & getCommittedResponse(const Vector &(Node::*response)(void) const)
Returns the commited value for the response.
Definition: TransformationDOF_Group.cpp:337
virtual void setID(int dof, int value)
to set the corresponding index of the ID to value.
Definition: TransformationDOF_Group.cpp:156
void incrNodeVel(const Vector &udot)
Method to set the corresponding nodes velocities increments to the values in u, components identified...
Definition: TransformationDOF_Group.cpp:452
void setNodeAccel(const Vector &udotdot)
Method to set the corresponding nodes accelerations to the values in u, components identified by myID...
Definition: TransformationDOF_Group.cpp:422
const Vector & getCommittedVel(void)
Returns the commited value for the velocity.
Definition: TransformationDOF_Group.cpp:359
TransformationConstraintHandler is a constraint handler for handling constraints using the Transforma...
Definition: TransformationConstraintHandler.h:83
Definition: ID.h:77
Definition: Matrix.h:82
Base class for mult-freedom constraints.
Definition: MFreedom_ConstraintBase.h:57
~TransformationDOF_Group()
Destructor.
Definition: TransformationDOF_Group.cpp:193
MFreedom_ConstraintBase * getMFreedomConstraint(void)
Returns a pointer to the multi-freedom constraint.
Definition: TransformationDOF_Group.cpp:275
const Vector & setupResidual(int numCNodeDOF, const ID &, const ID &, const Vector &, const std::vector< Node * > &, const Vector &(Node::*response)(void) const)
Computes the residual vector and returns it.
Definition: TransformationDOF_Group.cpp:282
const Vector & getCommittedAccel(void)
Returns the commited value for the acceleration.
Definition: TransformationDOF_Group.cpp:363
void incrNodeAccel(const Vector &udotdot)
Method to set the corresponding nodes accelerations increments to the values in u, components identified by myID.
Definition: TransformationDOF_Group.cpp:467
Los objetos de esta clase, dan acceso a los objetos FE_Element y DOF_Group creados por el Constraint ...
Definition: AnalysisModel.h:113
Single freedom constraint.
Definition: SFreedom_Constraint.h:79
void incrNodeDisp(const Vector &u)
Method to set the corresponding nodes displacements increments to the values in u, components identified by myID.
Definition: TransformationDOF_Group.cpp:437
================================================================================
Definition: ContinuaReprComponent.h:34
std::vector< Node * > getPointersToRetainedNodes(void)
Returns a vector with the pointers to the retained nodes.
Definition: TransformationDOF_Group.cpp:326
const Vector & getCommittedDisp(void)
Returns the commited value for the displacement.
Definition: TransformationDOF_Group.cpp:355
Base class for the object that performs the integration of physical properties over the domain to for...
Definition: Integrator.h:91
size_t getNumRetainedNodeDOFs(void) const
Returns the number of retained degrees of freedom (retained nodes x retained DOFs on each node)...
Definition: TransformationDOF_Group.cpp:313