80 ASSERTL0(nDir == 0,
"nDir != 0 not tested");
83 int ntotal = nGlobal - nDir;
93 int NttlNonlinIte = 0;
94 for (; NttlNonlinIte <
m_maxiter; ++NttlNonlinIte)
108 int ntmpLinSysIts =
m_linsol->SolveSystem(
120 " # Nonlinear solver not converge in DoImplicitSolve");
121 cout << right << scientific << setw(nwidthcolm)
122 << setprecision(nwidthcolm - 6)
125 <<
" with " << setw(3) << NttlNonlinIte <<
" Non-Its)" << endl;
128 return NttlNonlinIte;
146 return resratio < restol * restol ||
m_SysResNorm < tol * tol;
#define ASSERTL0(condition, msg)
#define WARNINGL0(condition, msg)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
NekDouble m_NonlinIterTolRelativeL2
Array< OneD, NekDouble > m_Residual
NekDouble m_LinSysRelativeTolInNonlin
Array< OneD, NekDouble > m_DeltSltn
Array< OneD, NekDouble > m_SourceVec
NekLinSysIterSharedPtr m_linsol
Array< OneD, NekDouble > m_Solution
static NekNonlinSysSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vRowComm, const int nDimen, const NekSysKey &pKey)
NekDouble CalcInexactNewtonForcing(const int &k, const NekDouble &resnormOld, const NekDouble &resnorm)
NekNonlinSysNewton(const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vRowComm, const int nscale, const NekSysKey &pKey)
void v_InitObject() override
static std::string className
int v_SolveSystem(const int nGlobal, const Array< OneD, const NekDouble > &pInput, Array< OneD, NekDouble > &pOutput, const int nDir, const NekDouble tol, const NekDouble factor) override
bool m_InexactNewtonForcing
bool v_ConvergenceCheck(const int nIteration, const Array< OneD, const NekDouble > &Residual, const NekDouble tol) override
void v_SetSysOperators(const NekSysOperators &in) override
bool m_root
Root if parallel.
LibUtilities::CommSharedPtr m_rowComm
Communicate.
virtual void v_InitObject()
NekSysOperators m_operator
Operators.
int m_SysDimen
The dimension of the system.
virtual void v_SetSysOperators(const NekSysOperators &in)
bool m_converged
Whether the iteration has been converged.
int m_maxiter
Maximum iterations.
void DoNekSysResEval(InArrayType &inarray, OutArrayType &outarray, const bool &flag=false) const
NekNonlinSysFactory & GetNekNonlinSysFactory()
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
T Dot(int n, const T *w, const T *x)
dot product
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
scalarT< T > sqrt(scalarT< T > in)