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);
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 cerr << "EigenAnalysis::analyze() - domainChanged failed\n";
00114 return -1;
00115 }
00116 }
00117
00118 result = theIntegrator->newStep();
00119 if (result < 0) {
00120 cerr << "EigenAnalysis::analyze() - integrator failed\n";
00121 return -2;
00122 }
00123
00124 result = theAlgorithm->solveCurrentStep(numModes);
00125 if (result < 0) {
00126 cerr << "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
00142 Graph &theGraph = theAnalysisModel->getDOFGraph();
00143 theSOE->setSize(theGraph);
00144
00145 theIntegrator->domainChanged();
00146 theAlgorithm->domainChanged();
00147
00148 return 0;
00149 }
00150
00151 int
00152 EigenAnalysis::setAlgorithm(EigenAlgorithm &theAlgo)
00153 {
00154 cerr << "EigenAnalysis::setAlgorithm() - does nothing yet\n";
00155 return 0;
00156 }
00157
00158 int
00159 EigenAnalysis::setIntegrator(EigenIntegrator &theIntegrator)
00160 {
00161 cerr << "EigenAnalysis::setIntegrator() - does nothing yet\n";
00162 return 0;
00163 }
00164
00165 int
00166 EigenAnalysis::setEigenSOE(EigenSOE &theSOE)
00167 {
00168 cerr << "EigenAnalysis::setEigenSOE() - does nothing yet\n";
00169 return 0;
00170 }
00171
00172 ConstraintHandler *
00173 EigenAnalysis::getConstraintHandlerPtr() const
00174 {
00175 return theConstraintHandler;
00176 }
00177
00178 DOF_Numberer *
00179 EigenAnalysis::getDOF_NumbererPtr() const
00180 {
00181 return theDOF_Numberer;
00182 }
00183
00184 AnalysisModel *
00185 EigenAnalysis::getAnalysisModelPtr() const
00186 {
00187 return theAnalysisModel;
00188 }
00189
00190 EigenAlgorithm *
00191 EigenAnalysis::getEigenAlgorithm() const
00192 {
00193 return theAlgorithm;
00194 }
00195
00196 EigenSOE *
00197 EigenAnalysis::getEigenSOE() const
00198 {
00199 return theSOE;
00200 }
00201
00202 EigenIntegrator *
00203 EigenAnalysis::getEigenIntegrator() const
00204 {
00205 return theIntegrator;
00206 }