StandardEigenAlgo.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.2 $
00022 // $Date: 2003/02/14 23:00:41 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/analysis/algorithm/eigenAlgo/StandardEigenAlgo.cpp,v $
00024                                                                         
00025 // Written: MHS
00026 // Created: Oct 2001
00027 //
00028 // Description: This file contains the class definition of StandardEigenAlgo.
00029 // StandardEigenAlgo is a class which performs a eigen solution algorithm
00030 // to solve standard eigenvalue equations. It is not expected that 
00031 // this class will have subclasses.
00032 
00033 #include <StandardEigenAlgo.h>
00034 #include <AnalysisModel.h>
00035 #include <EigenAnalysis.h>
00036 #include <EigenIntegrator.h>
00037 #include <EigenSOE.h>
00038 #include <Vector.h>
00039 #include <Channel.h>
00040 #include <FEM_ObjectBroker.h>
00041 #include <Timer.h>
00042 
00043 StandardEigenAlgo::StandardEigenAlgo()
00044   :EigenAlgorithm(EigenALGORITHM_TAGS_Standard)
00045 {
00046   // do nothing here.
00047 }
00048 
00049 StandardEigenAlgo::~StandardEigenAlgo()
00050 {
00051   // do nothing here.
00052 }
00053 
00054 int 
00055 StandardEigenAlgo::solveCurrentStep(int numModes)
00056 {
00057   AnalysisModel *theModel = this->getAnalysisModelPtr();
00058   EigenSOE *theSOE = this->getEigenSOEptr();
00059   EigenIntegrator *theIntegrator = this->getEigenIntegratorPtr();
00060   
00061   if ((theModel == 0) || (theIntegrator == 0) || (theSOE == 0)) {
00062 
00063     opserr << "StandardEigenAlgo::solverCurrentStep() -- setLinks() has not been called\n";
00064     return -1;
00065   }
00066   
00067   if (theIntegrator->formK() < 0) {
00068     opserr << "StandardEigenAlgo::solverCurrentStep() -- the Integrator failed in formK()\n";
00069     return -2;
00070   }
00071   
00072   if (theSOE->solve(numModes) < 0) {
00073     opserr << "StandardEigenAlgo::solverCurrentStep() -- the EigenSOE failed in solve()\n";
00074     return -4;
00075   }
00076   
00077   // now set the eigenvalues and eigenvectors in the model
00078   theModel->setNumEigenvectors(numModes);
00079   Vector theEigenvalues(numModes);
00080   for (int i = 1; i <= numModes; i++) {
00081     theEigenvalues[i-1] = theSOE->getEigenvalue(i);
00082     theModel->setEigenvector(i, theSOE->getEigenvector(i));
00083   }    
00084   theModel->setEigenvalues(theEigenvalues);
00085   
00086   return 0;
00087 }
00088 
00089 int 
00090 StandardEigenAlgo::sendSelf(int cTag, Channel &theChannel)
00091 {
00092   return 0;
00093 }
00094 
00095 int 
00096 StandardEigenAlgo::recvSelf(int cTag, Channel &theChannel,
00097                           FEM_ObjectBroker &theBroker)
00098 {
00099   return 0;
00100 }
00101 
00102 void 
00103 StandardEigenAlgo::Print(OPS_Stream &s, int flag)
00104 {
00105   s << "\tStandardEigenAlgo\n";
00106 }

Generated on Mon Oct 23 15:04:57 2006 for OpenSees by doxygen 1.5.0