00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #include <EigenAnalysis.h>
00041 #include <EigenAlgorithm.h>
00042 #include <AnalysisModel.h>
00043 #include <EigenSOE.h>
00044 #include <DOF_Numberer.h>
00045 #include <ConstraintHandler.h>
00046 #include <EigenIntegrator.h>
00047 #include <Domain.h>
00048 #include <Timer.h>
00049 #include <FE_Element.h>
00050 #include <DOF_Group.h>
00051 #include <FE_EleIter.h>
00052 #include <DOF_GrpIter.h>
00053 #include <Matrix.h>
00054 #include <ID.h>
00055 #include <Graph.h>
00056
00057
00058 EigenAnalysis::EigenAnalysis(Domain &the_Domain,
00059 ConstraintHandler &theHandler,
00060 DOF_Numberer &theNumberer,
00061 AnalysisModel &theModel,
00062 EigenAlgorithm &theAlgo,
00063 EigenSOE &theEigenSOE,
00064 EigenIntegrator &theEigenIntegrator)
00065 :Analysis(the_Domain), theConstraintHandler(&theHandler),
00066 theDOF_Numberer(&theNumberer), theAnalysisModel(&theModel),
00067 theAlgorithm(&theAlgo), theSOE(&theEigenSOE),
00068 theIntegrator(&theEigenIntegrator), domainStamp(0)
00069 {
00070
00071 theAnalysisModel->setLinks(the_Domain, *theConstraintHandler);
00072 theConstraintHandler->setLinks(the_Domain, theModel, theEigenIntegrator);
00073 theDOF_Numberer->setLinks(theModel);
00074 theIntegrator->setLinks(theModel, theEigenSOE);
00075 theAlgorithm->setLinks(theModel, theEigenIntegrator, theEigenSOE);
00076 }
00077
00078
00079 EigenAnalysis::~EigenAnalysis()
00080 {
00081
00082 this->clearAll();
00083 }
00084
00085 void
00086 EigenAnalysis::clearAll(void)
00087 {
00088
00089 delete theAnalysisModel;
00090 delete theConstraintHandler;
00091 delete theDOF_Numberer;
00092 delete theIntegrator;
00093 delete theAlgorithm;
00094 delete theSOE;
00095 }
00096
00097
00098
00099 int
00100 EigenAnalysis::analyze(int numModes)
00101 {
00102 int result = 0;
00103 Domain *the_Domain = this->getDomainPtr();
00104
00105
00106
00107
00108 int stamp = the_Domain->hasDomainChanged();
00109 if (stamp != domainStamp) {
00110 domainStamp = stamp;
00111 result = this->domainChanged();
00112 if (result < 0) {
00113 opserr << "EigenAnalysis::analyze() - domainChanged failed\n";
00114 return -1;
00115 }
00116 }
00117
00118 result = theIntegrator->newStep();
00119 if (result < 0) {
00120 opserr << "EigenAnalysis::analyze() - integrator failed\n";
00121 return -2;
00122 }
00123
00124 result = theAlgorithm->solveCurrentStep(numModes);
00125 if (result < 0) {
00126 opserr << "EigenAnalysis::analyze() - algorithm failed\n";
00127 return -3;
00128 }
00129
00130 return 0;
00131 }
00132
00133 int
00134 EigenAnalysis::domainChanged()
00135 {
00136 theAnalysisModel->clearAll();
00137 theConstraintHandler->clearAll();
00138 theConstraintHandler->handle();
00139
00140 theDOF_Numberer->numberDOF();
00141 theConstraintHandler->doneNumberingDOF();
00142
00143 Graph &theGraph = theAnalysisModel->getDOFGraph();
00144 theSOE->setSize(theGraph);
00145
00146 theIntegrator->domainChanged();
00147 theAlgorithm->domainChanged();
00148
00149 return 0;
00150 }
00151
00152 int
00153 EigenAnalysis::setAlgorithm(EigenAlgorithm &theAlgo)
00154 {
00155 opserr << "EigenAnalysis::setAlgorithm() - does nothing yet\n";
00156 return 0;
00157 }
00158
00159 int
00160 EigenAnalysis::setIntegrator(EigenIntegrator &theIntegrator)
00161 {
00162 opserr << "EigenAnalysis::setIntegrator() - does nothing yet\n";
00163 return 0;
00164 }
00165
00166 int
00167 EigenAnalysis::setEigenSOE(EigenSOE &theSOE)
00168 {
00169 opserr << "EigenAnalysis::setEigenSOE() - does nothing yet\n";
00170 return 0;
00171 }
00172
00173 ConstraintHandler *
00174 EigenAnalysis::getConstraintHandlerPtr() const
00175 {
00176 return theConstraintHandler;
00177 }
00178
00179 DOF_Numberer *
00180 EigenAnalysis::getDOF_NumbererPtr() const
00181 {
00182 return theDOF_Numberer;
00183 }
00184
00185 AnalysisModel *
00186 EigenAnalysis::getAnalysisModelPtr() const
00187 {
00188 return theAnalysisModel;
00189 }
00190
00191 EigenAlgorithm *
00192 EigenAnalysis::getEigenAlgorithm() const
00193 {
00194 return theAlgorithm;
00195 }
00196
00197 EigenSOE *
00198 EigenAnalysis::getEigenSOE() const
00199 {
00200 return theSOE;
00201 }
00202
00203 EigenIntegrator *
00204 EigenAnalysis::getEigenIntegrator() const
00205 {
00206 return theIntegrator;
00207 }