36#ifndef NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_NEK_LINSYS_ITERAT_GMRES_H
37#define NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_NEK_LINSYS_ITERAT_GMRES_H
60 pSession, vRowComm, nDimen, pKey);
194 void DoArnoldi(
const int starttem,
const int endtem,
const int nGlobal,
#define LIB_UTILITIES_EXPORT
int v_SolveSystem(const int nGlobal, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const int nDir) override
void DoGivensRotation(const int starttem, const int endtem, Array< OneD, NekDouble > &c, Array< OneD, NekDouble > &s, Array< OneD, NekDouble > &h, Array< OneD, NekDouble > &eta)
Array< OneD, Array< OneD, NekDouble > > m_Z_total
int DoGMRES(const int pNumRows, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const int pNumDir)
Actual iterative solve-GMRES.
NekDouble DoGmresRestart(const unsigned int nrestart, const bool truncted, const int nGlobal, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const int nDir)
Actual iterative gmres solver for one restart.
void DoBackward(const int number, Array< OneD, Array< OneD, NekDouble > > &A, const Array< OneD, const NekDouble > &b, Array< OneD, NekDouble > &y)
Array< OneD, Array< OneD, NekDouble > > m_V_total
Array< OneD, Array< OneD, NekDouble > > m_Upper
void EnableHookStepExport(bool flag)
Enable or disable export of GMRES Arnoldi data for the hook-step nonlinear solver.
static std::string className
int m_KrylovMaxHessMatBand
Array< OneD, Array< OneD, NekDouble > > m_hes
static std::string lookupIds[]
void ApplyRightPrecon(const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out)
~NekLinSysIterGMRES() override=default
const GMRESHookData & GetHookData() const
Get the Hook Data object. Check if GMRESHookData::valid before using the data.
void v_InitObject() override
bool UsingLeftPrecon() const
bool m_NekLinSysRightPrecon
void DoArnoldi(const int starttem, const int endtem, const int nGlobal, const int nDir, Array< OneD, NekDouble > &w, Array< OneD, NekDouble > &V1, Array< OneD, NekDouble > &V2, Array< OneD, NekDouble > &h)
bool m_GMRESCentralDifference
bool UsingRightPrecon() const
bool m_NekLinSysLeftPrecon
static NekLinSysIterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vRowComm, const int nDimen, const NekSysKey &pKey)
unsigned int m_GMRESDeltaDirection
void v_DoIterate(const int nGlobal, const Array< OneD, NekDouble > &rhs, Array< OneD, NekDouble > &x, const int nDir, NekDouble &err, int &iter) override
std::deque< Array< OneD, NekDouble > > m_delta
NekSysOperators m_operator
void DoNekSysPrecon(InArrayType &inarray, OutArrayType &outarray, const bool &flag=false) const
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< NekLinSysIter > NekLinSysIterSharedPtr
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Data exported from GMRES for use by the Newton hook-step solver. The data stored here correspond to t...
NekDouble beta
Initial residual norm beta used in || beta e_1 - H y ||_2.
Array< OneD, Array< OneD, NekDouble > > V
Arnoldi basis vectors V_0,...,V_m; contains nswp + 1 vectors of length nGlobal.
bool valid
True if hook step data is usable.
Array< OneD, Array< OneD, NekDouble > > H
Arnoldi Hessenberg matrix stored by columns: H[col][row]. H size is (nswp + 1) x nswp.
Array< OneD, NekDouble > yNewton
Unconstrained reduced GMRES solution y of size nswp.
int nGlobal
Dimension of the system; length of each Krylov vector.
int nDir
Offset to the non-Dirichlet part of the vector; active size is nGlobal - nDir.
int nswp
Current Krylov subspace dimension, number of done Arnoldi sweeps.