43 namespace LibUtilities
50 string NekNonlinSysNewton::className =
52 "Newton", NekNonlinSysNewton::create,
"NekNonlinSysNewton solver.");
54 NekNonlinSysNewton::NekNonlinSysNewton(
83 boost::ignore_unused(factor);
92 int ntotal = nGlobal - nDir;
95 int NttlNonlinIte = 0;
107 LinSysRelativeIteTol);
123 " # Nonlinear solver not converge in DoImplicitSolve");
124 cout << right << scientific << setw(nwidthcolm)
125 << setprecision(nwidthcolm - 6)
128 <<
" with " << setw(3) << NttlNonlinIte <<
" Non-Its)" << endl;
132 return NttlNonlinIte;
139 bool converged =
false;
141 int ntotal = Residual.size();
174 resnormOld = resnorm;
201 forcing = max(forcing, 1.0E-6);
213 boost::ignore_unused(nGlobal, nDir);
215 ASSERTL0(0 == nDir,
"0 != nDir not tested");
#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
virtual bool v_ConvergenceCheck(const int nIteration, const Array< OneD, const NekDouble > &Residual, const NekDouble tol)
void CalcInexactNewtonForcing(const int &k, NekDouble &resnormOld, const NekDouble &resnorm, NekDouble &forcing)
virtual 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)
int m_InexactNewtonForcing
virtual void v_InitObject()
virtual void v_SetupNekNonlinSystem(const int nGlobal, const Array< OneD, const NekDouble > &pInput, const Array< OneD, const NekDouble > &pSource, const int nDir)
bool m_root
Root if parallel.
virtual void v_InitObject()
NekSysOperators m_operator
Operators.
int m_SysDimen
The dimension of the system.
LibUtilities::CommSharedPtr m_Comm
Communicate.
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.
The above copyright notice and this permission notice shall be included.
T Dot(int n, const T *w, const T *x)
vvtvp (vector times vector times vector): z = w*x*y
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)