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 "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
00117
00118
00119
00120
00121 FE_Element *elePtr;
00122
00123 flagK = 0;
00124
00125 theSOE->zeroA();
00126
00127
00128
00129
00130
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
00155
00156
00157
00158
00159 FE_Element *elePtr;
00160
00161 flagK = 1;
00162 theSOE->zeroM();
00163
00164
00165
00166
00167
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
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