63 "Newton solver with residual-based backtracking.");
94 const int ntotal,
const NekDouble oldResNorm)
101 cout <<
" Attempting to apply Newton update with NewtonBacktrack"
121 cout <<
"Bactracking trial " << bt + 1 <<
" of "
123 <<
"\n new residual = " << newResNorm
124 <<
"\n old residual = " << oldResNorm
125 <<
"\n newResNorm / oldResNorm=" << newResNorm / oldResNorm
131 cout <<
"newResNorm <= (1.0 - m_acceptReductionEta * alpha) * "
134 cout <<
"newResNorm = " << newResNorm
136 <<
" alpha = " << alpha << endl;
143 cout <<
"Good on the first try, grow alpha" << endl;
149 cout <<
"Good step, conserve alpha" << endl;
153 cout <<
" Accepted Newton scale = " << alpha
165 cout <<
"Fallback: take minimum allowed step and continue." << endl;
179 cout <<
" No acceptable backtracking step found."
180 <<
" Taking fallback Newton scale = " << alphaFallback
181 <<
"\n new residual = " << fallbackResNorm
182 <<
"\n old residual = " << oldResNorm << endl;
183 cout <<
"newResNorm / oldResNorm=" << fallbackResNorm / oldResNorm << endl;
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Array< OneD, NekDouble > m_Residual
Array< OneD, NekDouble > m_Solution
Array< OneD, NekDouble > m_DeltSltn
NekNonlinSysIterNewtonBacktrack(const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vComm, const int nDimen, const NekSysKey &pKey)
static std::string className
NekDouble m_newtonScaleMax
Array< OneD, NekDouble > m_solutionTrial
NekDouble m_newtonScaleMin
NekDouble m_newtonScaleGrowFactor
bool v_ApplyNewtonUpdate(const int ntotal, const NekDouble oldResNorm) override
NekDouble m_newtonScaleInit
NekDouble m_backtrackFactor
NekDouble m_acceptReductionEta
static NekNonlinSysIterSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const LibUtilities::CommSharedPtr &vComm, const int nDimen, const NekSysKey &pKey)
void v_InitObject() override
Array< OneD, NekDouble > m_residualTrial
void v_InitObject() override
bool m_haveUpdatedResidual
LibUtilities::CommSharedPtr m_rowComm
NekSysOperators m_operator
void DoNekSysResEval(InArrayType &inarray, OutArrayType &outarray, const bool &flag=false) const
NekNonlinSysIterFactory & GetNekNonlinSysIterFactory()
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Svtvp (scalar times vector plus vector): z = alpha*x + y.
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)
scalarT< T > sqrt(scalarT< T > in)