56 {
"LR",
"SR",
"LI",
"SI",
"LM",
"SM" };
92 m_equ[0]->PrintSummary(out);
95 out <<
"\tArnoldi solver type : Arpack" << endl;
97 out <<
"\tArpack problem type : ";
112 Array<OneD, NekDouble> tmpworkd;
114 int nq =
m_equ[0]->UpdateFields()[0]->GetNcoeffs();
123 Array<OneD, int> ritzSelect;
124 Array<OneD, NekDouble> dr;
125 Array<OneD, NekDouble> di;
126 Array<OneD, NekDouble> workev;
127 Array<OneD, NekDouble> z;
130 Array<OneD, NekDouble> resid(n);
131 Array<OneD, NekDouble> v(n*
m_kdim);
132 Array<OneD, NekDouble> workl(lworkl);
133 Array<OneD, NekDouble> workd(3*n, 0.0);
137 if(
m_session->DefinesFunction(
"InitialConditions"))
140 out <<
"\tInital vector : input file " << endl;
147 out <<
"\tInital vector : random " << endl;
175 std::string name =
m_session->GetSessionName() +
".evl";
176 ofstream pFile(name.c_str());
186 &v[0], n, iparam, ipntr, &workd[0],
187 &workl[0], lworkl, info);
190 out <<
"\rIteration " << cycle <<
", output: " << info <<
", ido=" << ido <<
" " << std::flush;
192 if(!((cycle-1)%m_kdim)&&(cycle> m_kdim))
194 pFile <<
"Krylov spectrum at iteration: " << cycle << endl;
198 pFile <<
"EV Magnitude Angle Growth Frequency Residual" << endl;
202 pFile <<
"EV Real Imaginary inverse real inverse imag Residual" << endl;
206 for(
int k=0; k<=m_kdim-1; ++k)
211 WriteEvs(out,k, workl[ipntr[5]-1+k],workl[ipntr[6]-1+k]);
214 WriteEvs(pFile,k, workl[ipntr[5]-1+k],workl[ipntr[6]-1+k]);
220 if (ido == 99)
break;
222 ASSERTL0(ido == 1,
"Unexpected reverse communication request.");
227 m_equ[0]->TransCoeffToPhys();
242 m_equ[1]->TransCoeffToPhys();
251 out<< endl <<
"Converged in " << iparam[8] <<
" iterations" << endl;
253 ASSERTL0(info >= 0,
" Error with Dnaupd");
255 ritzSelect = Array<OneD, int> (
m_kdim,0);
256 dr = Array<OneD, NekDouble> (
m_nvec+1,0.0);
257 di = Array<OneD, NekDouble> (m_nvec+1,0.0);
258 workev = Array<OneD, NekDouble> (3*
m_kdim);
259 z = Array<OneD, NekDouble> (n*(m_nvec+1));
265 Arpack::Dneupd(1,
"A", ritzSelect.get(), dr.get(), di.get(), z.get(), n, sigmar, sigmai, workev.get(),
"I", n, problem,
m_nvec,
m_evtol, resid.get(),
m_kdim, v.get(), n, iparam, ipntr, workd.get(), workl.get(),lworkl,info);
267 ASSERTL0(info == 0,
" Error with Dneupd");
269 Array<OneD, MultiRegions::ExpListSharedPtr> fields =
m_equ[0]->UpdateFields();
271 out <<
"Converged Eigenvalues: " << nconv << endl;
272 pFile <<
"Converged Eigenvalues:"<< nconv << endl;
276 pFile <<
"EV Magnitude Angle Growth Frequency" << endl;
280 pFile <<
"EV Real Imaginary inverse real inverse imag" << endl;
284 for(
int i= 0; i< nconv; ++i)
289 std::string file =
m_session->GetSessionName() +
"_eig_"
290 + boost::lexical_cast<std::string>(i);
299 for(
int j = 0; j <
m_equ[0]->GetNvariables(); ++j)
303 if (
m_comm->GetRank() == 0)
305 out <<
"L 2 error (variable " <<
m_equ[0]->GetVariable(j) <<
") : " << vL2Error << endl;
306 out <<
"L inf error (variable " <<
m_equ[0]->GetVariable(j) <<
") : " << vLinfError << endl;