Virtual function for solve implementation.
114 int nq =
m_equ[0]->UpdateFields()[0]->GetNcoeffs();
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;
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");
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");
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;
Array< OneD, NekDouble > m_imag_evl
static void Dneupd(const int &rvec, const char *howmny, const int *select, double *dr, double *di, double *z, const int &ldz, const double &sigmar, const double &sigmai, double *workev, const char *bmat, const int &n, const char *which, const int &nev, const double &tol, double *resid, const int &ncv, double *v, const int &ldv, int *iparam, int *ipntr, double *workd, double *workl, const int &lworkl, int &info)
Post-processing routine to computed eigenvector of computed eigenvalues in Dnaupd.
#define ASSERTL0(condition, msg)
void CopyFwdToAdj()
Copy the forward field to the adjoint system in transient growth calculations.
NekDouble m_evtol
Maxmum number of iterations.
void CopyArnoldiArrayToField(Array< OneD, NekDouble > &array)
Copy Arnoldi storage to fields.
void CopyFieldToArnoldiArray(Array< OneD, NekDouble > &array)
Copy fields to Arnoldi storage.
void WriteFld(std::string file, std::vector< Array< OneD, NekDouble > > coeffs)
void WriteEvs(ostream &evlout, const int k, const NekDouble real, const NekDouble imag, NekDouble resid=NekConstants::kNekUnsetDouble)
static const NekDouble kNekZeroTol
int m_nvec
Dimension of Krylov subspace.
Array< OneD, NekDouble > m_real_evl
static void Dnaupd(int &ido, const char *bmat, const int &n, const char *which, const int &nev, const double &tol, double *resid, const int &ncv, double *v, const int &ldv, int *iparam, int *ipntr, double *workd, double *workl, const int &lworkl, int &info)
Top level reverse communication interface to solve real double-precision non-symmetric problems...
enum EvolutionOperatorType m_EvolutionOperator
Evolution Operator.
int m_nfields
interval to dump information if required.
bool m_timeSteppingAlgorithm
Period of time stepping algorithm.
static std::string ArpackProblemTypeTrans[]
Array< OneD, EquationSystemSharedPtr > m_equ
Equation system to solve.
int m_infosteps
underlying operator is time stepping
LibUtilities::CommSharedPtr m_comm
Communication object.
LibUtilities::SessionReaderSharedPtr m_session
Session reader object.
int m_nits
Number of vectors to test.