TransientIntegrator.cppGo to the documentation of this file.00001 /* ****************************************************************** ** 00002 ** OpenSees - Open System for Earthquake Engineering Simulation ** 00003 ** Pacific Earthquake Engineering Research Center ** 00004 ** ** 00005 ** ** 00006 ** (C) Copyright 1999, The Regents of the University of California ** 00007 ** All Rights Reserved. ** 00008 ** ** 00009 ** Commercial use of this program without express permission of the ** 00010 ** University of California, Berkeley, is strictly prohibited. See ** 00011 ** file 'COPYRIGHT' in main directory for information on usage and ** 00012 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. ** 00013 ** ** 00014 ** Developed by: ** 00015 ** Frank McKenna (fmckenna@ce.berkeley.edu) ** 00016 ** Gregory L. Fenves (fenves@ce.berkeley.edu) ** 00017 ** Filip C. Filippou (filippou@ce.berkeley.edu) ** 00018 ** ** 00019 ** ****************************************************************** */ 00020 00021 // $Revision: 1.7 $ 00022 // $Date: 2003/03/06 20:32:01 $ 00023 // $Source: /usr/local/cvs/OpenSees/SRC/analysis/integrator/TransientIntegrator.cpp,v $ 00024 00025 00026 // File: ~/analysis/integrator/TransientIntegrator.C 00027 // 00028 // Written: fmk 00029 // Created: Tue Sept 17 15:54:47: 1996 00030 // Revision: A 00031 // 00032 // Description: This file contains the class definition for TransientIntegrator. 00033 // TransientIntegrator is an algorithmic class for setting up the finite element 00034 // equations for a static analysis and for Incrementing the nodal displacements 00035 // with the values in the soln vector to the LinearSOE object. 00036 // 00037 // What: "@(#) TransientIntegrator.C, revA" 00038 00039 #include <TransientIntegrator.h> 00040 #include <FE_Element.h> 00041 #include <LinearSOE.h> 00042 #include <AnalysisModel.h> 00043 #include <Vector.h> 00044 #include <DOF_Group.h> 00045 #include <FE_EleIter.h> 00046 #include <DOF_GrpIter.h> 00047 00048 TransientIntegrator::TransientIntegrator(int clasTag) 00049 :IncrementalIntegrator(clasTag) 00050 { 00051 00052 } 00053 00054 TransientIntegrator::~TransientIntegrator() 00055 { 00056 00057 } 00058 00059 int 00060 TransientIntegrator::formTangent(int statFlag) 00061 { 00062 int result = 0; 00063 statusFlag = statFlag; 00064 00065 LinearSOE *theLinSOE = this->getLinearSOEPtr(); 00066 AnalysisModel *theModel = this->getAnalysisModelPtr(); 00067 if (theLinSOE == 0 || theModel == 0) { 00068 opserr << "WARNING TransientIntegrator::formTangent() "; 00069 opserr << "no LinearSOE or AnalysisModel has been set\n"; 00070 return -1; 00071 } 00072 00073 // the loops to form and add the tangents are broken into two for 00074 // efficiency when performing parallel computations 00075 00076 theLinSOE->zeroA(); 00077 00078 // loop through the DOF_Groups and add the unbalance 00079 DOF_GrpIter &theDOFs = theModel->getDOFs(); 00080 DOF_Group *dofPtr; 00081 00082 while ((dofPtr = theDOFs()) != 0) { 00083 if (theLinSOE->addA(dofPtr->getTangent(this),dofPtr->getID()) <0) { 00084 opserr << "TransientIntegrator::formTangent() - failed to addA:dof\n"; 00085 result = -1; 00086 } 00087 } 00088 00089 // loop through the FE_Elements getting them to add the tangent 00090 FE_EleIter &theEles2 = theModel->getFEs(); 00091 FE_Element *elePtr; 00092 while((elePtr = theEles2()) != 0) { 00093 if (theLinSOE->addA(elePtr->getTangent(this),elePtr->getID()) < 0) { 00094 opserr << "TransientIntegrator::formTangent() - failed to addA:ele\n"; 00095 result = -2; 00096 } 00097 } 00098 00099 return result; 00100 } 00101 00102 00103 00104 00105 int 00106 TransientIntegrator::formEleResidual(FE_Element *theEle) 00107 { 00108 theEle->zeroResidual(); 00109 theEle->addRIncInertiaToResidual(); 00110 return 0; 00111 } 00112 00113 int 00114 TransientIntegrator::formNodUnbalance(DOF_Group *theDof) 00115 { 00116 theDof->zeroUnbalance(); 00117 theDof->addPIncInertiaToUnbalance(); 00118 return 0; 00119 } |