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;
115 int nq =
m_equ[0]->UpdateFields()[0]->GetNcoeffs();
124 Array<OneD, int> ritzSelect;
125 Array<OneD, NekDouble> dr;
126 Array<OneD, NekDouble> di;
127 Array<OneD, NekDouble> workev;
128 Array<OneD, NekDouble> z;
131 Array<OneD, NekDouble> resid(n);
132 Array<OneD, NekDouble> v(n*
m_kdim);
133 Array<OneD, NekDouble> workl(lworkl);
134 Array<OneD, NekDouble> workd(3*n, 0.0);
138 if(
m_session->DefinesFunction(
"InitialConditions"))
141 out <<
"\tInital vector : input file " << endl;
148 out <<
"\tInital vector : random " << endl;
176 std::string name =
m_session->GetFilename().substr(0,
m_session->GetFilename().find_last_of(
'.'))+
".evl";
177 ofstream pFile(name.c_str());
187 &v[0], n, iparam, ipntr, &workd[0],
188 &workl[0], lworkl, info);
191 out <<
"\rIteration " << cycle <<
", output: " << info <<
", ido=" << ido <<
" " << std::flush;
193 if(!((cycle-1)%m_kdim)&&(cycle> m_kdim))
195 pFile <<
"Krylov spectrum at iteration: " << cycle << endl;
199 pFile <<
"EV Magnitude Angle Growth Frequency Residual" << endl;
203 pFile <<
"EV Real Imaginary inverse real inverse imag Residual" << endl;
207 for(
int k=0; k<=m_kdim-1; ++k)
212 WriteEvs(out,k, workl[ipntr[5]-1+k],workl[ipntr[6]-1+k]);
215 WriteEvs(pFile,k, workl[ipntr[5]-1+k],workl[ipntr[6]-1+k]);
221 if (ido == 99)
break;
223 ASSERTL0(ido == 1,
"Unexpected reverse communication request.");
228 m_equ[0]->TransCoeffToPhys();
243 m_equ[1]->TransCoeffToPhys();
252 out<< endl <<
"Converged in " << iparam[8] <<
" iterations" << endl;
254 ASSERTL0(info >= 0,
" Error with Dnaupd");
256 ritzSelect = Array<OneD, int> (
m_kdim,0);
257 dr = Array<OneD, NekDouble> (
m_nvec+1,0.0);
258 di = Array<OneD, NekDouble> (m_nvec+1,0.0);
259 workev = Array<OneD, NekDouble> (3*
m_kdim);
260 z = Array<OneD, NekDouble> (n*(m_nvec+1));
266 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);
268 ASSERTL0(info == 0,
" Error with Dneupd");
270 Array<OneD, MultiRegions::ExpListSharedPtr> fields =
m_equ[0]->UpdateFields();
272 out <<
"Converged Eigenvalues: " << nconv << endl;
273 pFile <<
"Converged Eigenvalues:"<< nconv << endl;
277 pFile <<
"EV Magnitude Angle Growth Frequency" << endl;
281 pFile <<
"EV Real Imaginary inverse real inverse imag" << endl;
285 for(
int i= 0; i< nconv; ++i)
290 std::string file =
m_session->GetFilename().substr(0,
m_session->GetFilename().find_last_of(
'.')) +
"_eig_" + boost::lexical_cast<std::string>(i);
300 for(
int j = 0; j <
m_equ[0]->GetNvariables(); ++j)
304 if (
m_comm->GetRank() == 0)
306 out <<
"L 2 error (variable " <<
m_equ[0]->GetVariable(j) <<
") : " << vL2Error << endl;
307 out <<
"L inf error (variable " <<
m_equ[0]->GetVariable(j) <<
") : " << vLinfError << endl;