Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

EigenIntegrator.cpp

Go 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.1.1.1 $
00022 // $Date: 2000/09/15 08:23:17 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/analysis/integrator/EigenIntegrator.cpp,v $
00024                                                                         
00025                                                                         
00026 // File: ~/analysis/integrator/eigenIntegrator/EigenIntegrator.C
00027 //
00028 // Written: Jun Peng
00029 // Created: Wed Jan 27, 1999
00030 // Revision: A
00031 //
00032 // Description: This file contains the class definition of EigenIntegrator.
00033 // EigenIntegrator is an algorithmic class for setting up the finite element 
00034 // equations for a eigen problem analysis.
00035 //
00036 // This class is inheritanted from the base class of Integrator which was
00037 // created by fmk (Frank).
00038 
00039 
00040 #include "EigenIntegrator.h"
00041 #include <FE_Element.h>
00042 #include <AnalysisModel.h>
00043 #include <EigenSOE.h>
00044 #include <Vector.h>
00045 #include <DOF_Group.h>
00046 #include <FE_EleIter.h>
00047 #include <DOF_GrpIter.h>
00048 
00049 EigenIntegrator::EigenIntegrator()
00050   :Integrator(EigenINTEGRATOR_TAGS_Eigen),
00051    theSOE(0), theAnalysisModel(0)
00052 {
00053 
00054 }
00055 
00056 EigenIntegrator::~EigenIntegrator()
00057 {
00058 
00059 }
00060 
00061 void
00062 EigenIntegrator::setLinks(AnalysisModel &theModel, EigenSOE &theSysOE)
00063 {
00064     theAnalysisModel = &theModel;
00065     theSOE = &theSysOE;
00066 }
00067 
00068 int 
00069 EigenIntegrator::formEleTangent(FE_Element *theEle)
00070 {
00071   if (flagK == 0)
00072       return this->formEleTangK(theEle);
00073   else
00074       return this->formEleTangM(theEle);
00075 }
00076 
00077 int 
00078 EigenIntegrator::formNodTangent(DOF_Group *theDof)
00079 {
00080   return this->formNodTangM(theDof);
00081 }
00082 
00083 int 
00084 EigenIntegrator::formEleResidual(FE_Element *theEle)
00085 {
00086     return 0;
00087 }
00088 
00089 int 
00090 EigenIntegrator::formNodUnbalance(DOF_Group *theDof)
00091 {
00092     return 0;
00093 }
00094 
00095 int 
00096 EigenIntegrator::newStep()
00097 {
00098     return 0;
00099 }
00100 
00101 int 
00102 EigenIntegrator::getLastResponse(Vector &result, const ID &id)
00103 {
00104     return 0;
00105 }
00106 
00107 int
00108 EigenIntegrator::formK()
00109 {
00110     if (theAnalysisModel == 0 || theSOE == 0) {
00111  cerr << "WARNING EigenIntegrator::formK -";
00112  cerr << " no AnalysisModel or EigenSOE has been set\n";
00113  return -1;
00114     }
00115     
00116     // the loops to form and add the tangents are broken into two for 
00117     // efficiency when performing parallel computations
00118 
00119     // loop through the FE_Elements getting them to form the tangent
00120     // FE_EleIter &theEles1 = theAnalysisModel->getFEs();
00121     FE_Element *elePtr;
00122 
00123     flagK = 0;
00124 
00125     theSOE->zeroA();
00126 
00127     //while((elePtr = theEles1()) != 0) 
00128     //  elePtr->formTangent(this);
00129    
00130    // loop through the FE_Elements getting them to add the tangent    
00131     int result = 0;
00132     FE_EleIter &theEles2 = theAnalysisModel->getFEs();    
00133     while((elePtr = theEles2()) != 0) {
00134         if (theSOE->addA(elePtr->getTangent(this), elePtr->getID()) < 0) {
00135      cerr << "WARNING EigenIntegrator::formK -";
00136      cerr << " failed in addA for ID " << elePtr->getID();     
00137      result = -2;
00138  }
00139     }
00140 
00141     return result;    
00142 }
00143 
00144 
00145 int
00146 EigenIntegrator::formM()
00147 {
00148     if (theAnalysisModel == 0 || theSOE == 0) {
00149  cerr << "WARNING EigenIntegrator::formK -";
00150  cerr << " no AnalysisModel or EigenSOE has been set\n";
00151  return -1;
00152     }
00153     
00154     // the loops to form and add the tangents are broken into two for 
00155     // efficiency when performing parallel computations
00156 
00157     // loop through the FE_Elements getting them to form the tangent
00158     // FE_EleIter &theEles1 = theAnalysisModel->getFEs();
00159     FE_Element *elePtr;
00160 
00161     flagK = 1;
00162     theSOE->zeroM();
00163 
00164     // while((elePtr = theEles1()) != 0) 
00165     //     elePtr->formTangent(this);
00166    
00167    // loop through the FE_Elements getting them to add the tangent    
00168     int result = 0;
00169     FE_EleIter &theEles2 = theAnalysisModel->getFEs();    
00170     while((elePtr = theEles2()) != 0) {     
00171  if (theSOE->addM(elePtr->getTangent(this), elePtr->getID()) < 0) {
00172      cerr << "WARNING EigenIntegrator::formK -";
00173      cerr << " failed in addA for ID " << elePtr->getID();     
00174      result = -2;
00175  }
00176     }
00177 
00178     DOF_Group *dofPtr;
00179     DOF_GrpIter &theDofs = theAnalysisModel->getDOFs();    
00180     while((dofPtr = theDofs()) != 0) {
00181  //    dofPtr->formTangent(this);
00182  if (theSOE->addM(dofPtr->getTangent(this),dofPtr->getID()) < 0) {
00183      cerr << "WARNING EigenIntegrator::formM -";
00184      cerr << " failed in addM for ID " << dofPtr->getID();     
00185      result = -3;
00186  }
00187     }
00188 
00189     return result;    
00190 }
00191 
00192 int 
00193 EigenIntegrator::formEleTangK(FE_Element *theEle)
00194 {
00195   theEle->zeroTangent();
00196   theEle->addKtToTang(1.0);
00197   return 0;
00198 }
00199 
00200 int 
00201 EigenIntegrator::formEleTangM(FE_Element *theEle)
00202 {
00203   theEle->zeroTangent();
00204   theEle->addMtoTang(1.0);
00205   return 0;
00206 }
00207 
00208 int 
00209 EigenIntegrator::formNodTangM(DOF_Group *theDof)
00210 {
00211   theDof->zeroTangent();
00212   theDof->addMtoTang(1.0);
00213   return 0;
00214 }
00215 
00216 int 
00217 EigenIntegrator::update(const Vector &deltaU)
00218 {
00219     return 0;
00220 }
00221 
00222 EigenSOE *
00223 EigenIntegrator::getEigenSOEPtr() const
00224 {
00225     return theSOE;
00226 }
00227 
00228 AnalysisModel *
00229 EigenIntegrator::getAnalysisModelPtr() const
00230 {
00231     return theAnalysisModel;
00232 }
00233 
00234 int 
00235 EigenIntegrator::sendSelf(int commitTag, Channel &theChannel)
00236 {
00237     return 0;
00238 }
00239 
00240 int 
00241 EigenIntegrator::recvSelf(int commitTag, Channel &theChannel,
00242      FEM_ObjectBroker &theBroker)
00243 {
00244     return 0;
00245 }
00246 
00247 void 
00248 EigenIntegrator::Print(ostream &s, int flag)
00249 {
00250     s << "\t EigenIntegrator: \n";
00251 }
00252 
00253 
00254 
00255 
00256 
Copyright Contact Us