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