Advanced Multi-Physics (AMP)
On-Line Documentation
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes | List of all members
AMP::Solver::NonlinearKrylovAccelerator< T > Class Template Reference

#include <NonlinearKrylovAccelerator.h>

Inheritance diagram for AMP::Solver::NonlinearKrylovAccelerator< T >:
Inheritance graph
[legend]

Public Types

typedef std::shared_ptr< AMP::Solver::SolverStrategyshared_ptr
 
enum class  SolverStatus {
  ConvergedOnAbsTol , ConvergedOnRelTol , ConvergedUserCondition , MaxIterations ,
  DivergedLineSearch , DivergedStepSize , DivergedFunctionCount , DivergedOnNan ,
  DivergedNestedSolver , DivergedOther
}
 

Public Member Functions

void apply (std::shared_ptr< const AMP::LinearAlgebra::Vector > f, std::shared_ptr< AMP::LinearAlgebra::Vector > u) override
 
void correction (std::shared_ptr< AMP::LinearAlgebra::Vector > f)
 
AMP::Scalar getAbsoluteTolerance () const
 
bool getConverged (void) const
 
SolverStatus getConvergenceStatus (void) const
 
std::string getConvergenceStatusString (void) const
 
int getDebugPrintInfoLevel (void)
 
AMP::Utilities::ExecutionSpace getExecutionSpace () const
 
std::shared_ptr< AMP::LinearAlgebra::VectorgetFunctionScaling ()
 
virtual AMP::Scalar getInitialResidual (void) const
 
virtual const std::vector< int > & getIterationHistory (void)
 
virtual int getIterations (void) const
 
int getMaxFunctionEvaluations () const
 
int getMaxIterations (void) const
 
int getMaxNonlinearIterations () const
 
virtual std::shared_ptr< SolverStrategygetNestedSolver (void)
 
virtual std::shared_ptr< AMP::Operator::OperatorgetOperator (void)
 
AMP::Scalar getRelativeTolerance () const
 
virtual AMP::Scalar getResidualNorm (void) const
 
std::shared_ptr< AMP::LinearAlgebra::VectorgetSolutionScaling ()
 
int getTotalNumberOfIterations (void)
 
void initialize (std::shared_ptr< const AMP::Solver::SolverStrategyParameters > parameters) override
 
virtual void initialize (std::shared_ptr< const SolverStrategyParameters > parameters)
 
 NonlinearKrylovAccelerator (std::shared_ptr< AMP::Solver::SolverStrategyParameters > params)
 
virtual void print (std::ostream &)
 
virtual void printConvergenceStatus (SolverStrategy::SolverStatus, std::ostream &=AMP::pout) const
 
void printStatistics (std::ostream &os) override
 
void registerOperator (std::shared_ptr< AMP::Operator::Operator > op) override final
 
virtual void registerWriter (std::shared_ptr< AMP::IO::Writer > writer)
 Registers a writer with the solver.
 
void relax (void)
 
void reset (std::shared_ptr< AMP::Solver::SolverStrategyParameters > parameters) override
 
virtual void reset (std::shared_ptr< SolverStrategyParameters > parameters)
 
virtual void resetOperator (std::shared_ptr< const AMP::Operator::OperatorParameters > parameters)
 
virtual void residual (std::shared_ptr< const AMP::LinearAlgebra::Vector > f, std::shared_ptr< const AMP::LinearAlgebra::Vector > u, std::shared_ptr< AMP::LinearAlgebra::Vector > r)
 
void restart (void)
 
virtual void setAbsoluteTolerance (AMP::Scalar abs_tol)
 
void setComponentScalings (std::shared_ptr< AMP::LinearAlgebra::Vector > s, std::shared_ptr< AMP::LinearAlgebra::Vector > f)
 for multiphysics problems it may be necessary to scale the solution
 
virtual void setDebugPrintInfoLevel (int print_level)
 
void setExecutionSpace (AMP::Utilities::ExecutionSpace space)
 
virtual void setInitialGuess (std::shared_ptr< AMP::LinearAlgebra::Vector > initialGuess)
 
void setIsNestedSolver (bool is_nested)
 Tell a solver that it is nested inside some outer solver.
 
void setMaxFunctionEvaluations (int max_feval)
 
virtual void setMaxIterations (const int max_iterations)
 
void setMaxNonlinearIterations (int max_nli)
 
virtual void setNestedSolver (std::shared_ptr< SolverStrategy > solver)
 
virtual void setRelativeTolerance (AMP::Scalar rel_tol)
 
virtual void setZeroInitialGuess (bool use_zero_guess)
 
std::string type () const override
 Return the name of the solver.
 
 ~NonlinearKrylovAccelerator ()
 

Static Public Member Functions

static std::unique_ptr< AMP::Solver::SolverStrategycreateSolver (std::shared_ptr< AMP::Solver::SolverStrategyParameters > solverStrategyParameters)
 
static std::string statusToString (SolverStatus status)
 

Protected Member Functions

virtual bool checkStoppingCriteria (AMP::Scalar res_norm, bool check_iters=true)
 
void getBaseFromInput (std::shared_ptr< AMP::Database > db)
 

Protected Attributes

bool d_bComputeResidual = false
 
bool d_bIsNestedSolver = false
 
bool d_bUseZeroInitialGuess = true
 
SolverStatus d_ConvergenceStatus = SolverStatus::DivergedOther
 
AMP::Scalar d_dAbsoluteTolerance = 1.0e-14
 
std::shared_ptr< AMP::Databased_db = nullptr
 
AMP::Scalar d_dInitialResidual
 
AMP::Scalar d_dRelativeTolerance = 1.0e-09
 
AMP::Scalar d_dResidualNorm
 
AMP::Utilities::ExecutionSpace d_exec_space = AMP::Utilities::ExecutionSpace::unspecified
 execution space for the solver
 
std::shared_ptr< AMP::Databased_global_db = nullptr
 
int d_iDebugPrintInfoLevel = 0
 
int d_iMaxIterations = 0
 
int d_iNumberIterations = 0
 
int d_iObjectId
 
std::vector< intd_iterationHistory
 keeps track of iteration statistics over solver lifetime
 
AMP::Utilities::MemoryType d_memory_location = AMP::Utilities::MemoryType::none
 memory storage address space
 
std::shared_ptr< AMP::LinearAlgebra::Vectord_pFunctionScaling
 
std::shared_ptr< AMP::Solver::SolverStrategyd_pNestedSolver = nullptr
 nested solver used by this solver
 
std::shared_ptr< AMP::Operator::Operatord_pOperator = nullptr
 
std::shared_ptr< AMP::LinearAlgebra::Vectord_pSolutionScaling
 
std::string d_sName
 
std::shared_ptr< AMP::IO::Writerd_writer = nullptr
 

Static Protected Attributes

static int d_iInstanceId
 

Private Member Functions

std::shared_ptr< AMP::Operator::OperatorcreatePreconditionerOperator (std::shared_ptr< AMP::Operator::Operator > op)
 
void factorizeNormalMatrix (void)
 
std::vector< TforwardbackwardSolve (std::shared_ptr< AMP::LinearAlgebra::Vector > f)
 forward backward solve for Cholesky
 
void getFromInput (std::shared_ptr< AMP::Database > db)
 
void initialize (std::shared_ptr< AMP::LinearAlgebra::Vector > solution_vector)
 
 NonlinearKrylovAccelerator ()=delete
 
 NonlinearKrylovAccelerator (const NonlinearKrylovAccelerator &)=delete
 
 NonlinearKrylovAccelerator (NonlinearKrylovAccelerator &&)=delete
 
NonlinearKrylovAcceleratoroperator= (const NonlinearKrylovAccelerator &)=delete
 

Private Attributes

bool d_adaptive_damping = false
 whether to use damping
 
std::shared_ptr< AMP::LinearAlgebra::Vectord_correction_vector
 correction vectors
 
int d_current_correction = 0
 
T d_eta = 1.0
 keeps track of the number of function applications
 
int d_first = 0
 matrix of w vector inner products
 
int d_free = 0
 index of last subspace vector
 
bool d_freeze_pc = true
 whether the solver uses a preconditioner or not
 
int d_function_apply_count = 0
 keeps track of the number of preconditioner applications
 
T ** d_h
 function difference vectors
 
int d_last = 0
 index of first subspace vector
 
int d_maximum_function_evals = 0
 previous index link field in doubly-linked subspace v
 
int d_mvec = 0
 use qr factorization to solve the least squares problem
 
std::vector< intd_next
 index of the initial vector in free storage linked list
 
bool d_pending = false
 boolean: a nonempty subspace
 
int d_preconditioner_apply_count
 
std::vector< intd_prev
 next index link field
 
bool d_print_residuals = false
 flag determining whether the preconditioner is frozen or not
 
std::shared_ptr< AMP::LinearAlgebra::Vectord_residual_vector
 correction vectors
 
std::shared_ptr< AMP::LinearAlgebra::Vectord_solution_vector
 vector drop tolerance
 
bool d_solver_initialized = false
 whether to print the residuals
 
bool d_subspace = false
 
bool d_use_damping = false
 
bool d_use_qr = false
 contains pending vectors – boolean
 
bool d_uses_preconditioner = false
 damping factor
 
std::vector< std::shared_ptr< AMP::LinearAlgebra::Vector > > d_v
 correction vectors
 
T d_vtol = 0.0
 maximum number of subspace vectors
 
std::vector< std::shared_ptr< AMP::LinearAlgebra::Vector > > d_w
 correction vectors
 

Detailed Description

template<typename T = double>
class AMP::Solver::NonlinearKrylovAccelerator< T >

Definition at line 17 of file NonlinearKrylovAccelerator.h.

Member Typedef Documentation

◆ shared_ptr

Definition at line 30 of file SolverStrategy.h.

Member Enumeration Documentation

◆ SolverStatus

Enumerator
ConvergedOnAbsTol 
ConvergedOnRelTol 
ConvergedUserCondition 
MaxIterations 
DivergedLineSearch 
DivergedStepSize 
DivergedFunctionCount 
DivergedOnNan 
DivergedNestedSolver 
DivergedOther 

Definition at line 62 of file SolverStrategy.h.

Constructor & Destructor Documentation

◆ NonlinearKrylovAccelerator() [1/4]

template<typename T = double>
AMP::Solver::NonlinearKrylovAccelerator< T >::NonlinearKrylovAccelerator ( std::shared_ptr< AMP::Solver::SolverStrategyParameters params)
explicit

◆ ~NonlinearKrylovAccelerator()

◆ NonlinearKrylovAccelerator() [2/4]

template<typename T = double>
AMP::Solver::NonlinearKrylovAccelerator< T >::NonlinearKrylovAccelerator ( )
privatedelete

◆ NonlinearKrylovAccelerator() [3/4]

template<typename T = double>
AMP::Solver::NonlinearKrylovAccelerator< T >::NonlinearKrylovAccelerator ( const NonlinearKrylovAccelerator< T > &  )
privatedelete

◆ NonlinearKrylovAccelerator() [4/4]

template<typename T = double>
AMP::Solver::NonlinearKrylovAccelerator< T >::NonlinearKrylovAccelerator ( NonlinearKrylovAccelerator< T > &&  )
privatedelete

Member Function Documentation

◆ apply()

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::apply ( std::shared_ptr< const AMP::LinearAlgebra::Vector f,
std::shared_ptr< AMP::LinearAlgebra::Vector u 
)
overridevirtual

Solve the system \(A(u) = f\). The solution \(u\) and the right hand side \(f\) are specified via vectors on the patch hierarchy. This function returns zero if the solver converged within the specified tolerances and nonzero otherwise. Member functions getIterations() and getRelativeNorm() return the iterations and relative norm, respectively, from the solver.

Parameters
fvector for right hand side, can be nullptr
uvector for solution variables

Implements AMP::Solver::SolverStrategy.

◆ checkStoppingCriteria()

virtual bool AMP::Solver::SolverStrategy::checkStoppingCriteria ( AMP::Scalar  res_norm,
bool  check_iters = true 
)
protectedvirtualinherited

◆ correction()

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::correction ( std::shared_ptr< AMP::LinearAlgebra::Vector f)

◆ createPreconditionerOperator()

template<typename T = double>
std::shared_ptr< AMP::Operator::Operator > AMP::Solver::NonlinearKrylovAccelerator< T >::createPreconditionerOperator ( std::shared_ptr< AMP::Operator::Operator op)
private

◆ createSolver()

template<typename T = double>
static std::unique_ptr< AMP::Solver::SolverStrategy > AMP::Solver::NonlinearKrylovAccelerator< T >::createSolver ( std::shared_ptr< AMP::Solver::SolverStrategyParameters solverStrategyParameters)
inlinestatic

Definition at line 27 of file NonlinearKrylovAccelerator.h.

◆ factorizeNormalMatrix()

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::factorizeNormalMatrix ( void  )
private

◆ forwardbackwardSolve()

template<typename T = double>
std::vector< T > AMP::Solver::NonlinearKrylovAccelerator< T >::forwardbackwardSolve ( std::shared_ptr< AMP::LinearAlgebra::Vector f)
private

forward backward solve for Cholesky

◆ getAbsoluteTolerance()

AMP::Scalar AMP::Solver::SolverStrategy::getAbsoluteTolerance ( ) const
inlineinherited

◆ getBaseFromInput()

void AMP::Solver::SolverStrategy::getBaseFromInput ( std::shared_ptr< AMP::Database db)
protectedinherited

◆ getConverged()

bool AMP::Solver::SolverStrategy::getConverged ( void  ) const
inlineinherited

◆ getConvergenceStatus()

SolverStatus AMP::Solver::SolverStrategy::getConvergenceStatus ( void  ) const
inlineinherited

◆ getConvergenceStatusString()

std::string AMP::Solver::SolverStrategy::getConvergenceStatusString ( void  ) const
inlineinherited

◆ getDebugPrintInfoLevel()

int AMP::Solver::SolverStrategy::getDebugPrintInfoLevel ( void  )
inlineinherited

Get level of diagnostic information printed during iterations.

Definition at line 137 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_iDebugPrintInfoLevel.

◆ getExecutionSpace()

AMP::Utilities::ExecutionSpace AMP::Solver::SolverStrategy::getExecutionSpace ( ) const
inlineinherited

Definition at line 269 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_exec_space.

◆ getFromInput()

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::getFromInput ( std::shared_ptr< AMP::Database db)
private

◆ getFunctionScaling()

std::shared_ptr< AMP::LinearAlgebra::Vector > AMP::Solver::SolverStrategy::getFunctionScaling ( )
inlineinherited

Definition at line 267 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_pFunctionScaling.

◆ getInitialResidual()

virtual AMP::Scalar AMP::Solver::SolverStrategy::getInitialResidual ( void  ) const
inlinevirtualinherited

Definition at line 241 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_dInitialResidual.

◆ getIterationHistory()

virtual const std::vector< int > & AMP::Solver::SolverStrategy::getIterationHistory ( void  )
inlinevirtualinherited

Definition at line 243 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_iterationHistory.

◆ getIterations()

virtual int AMP::Solver::SolverStrategy::getIterations ( void  ) const
inlinevirtualinherited

Return the number of iterations taken by the solver to converge.

Definition at line 142 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_iNumberIterations.

◆ getMaxFunctionEvaluations()

template<typename T = double>
int AMP::Solver::NonlinearKrylovAccelerator< T >::getMaxFunctionEvaluations ( ) const

Get maximum function evaluations by nonlinear solver.

◆ getMaxIterations()

int AMP::Solver::SolverStrategy::getMaxIterations ( void  ) const
inlineinherited

Definition at line 218 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_iMaxIterations.

◆ getMaxNonlinearIterations()

template<typename T = double>
int AMP::Solver::NonlinearKrylovAccelerator< T >::getMaxNonlinearIterations ( ) const

Get maximum iterations for nonlinear solver.

◆ getNestedSolver()

virtual std::shared_ptr< SolverStrategy > AMP::Solver::SolverStrategy::getNestedSolver ( void  )
inlinevirtualinherited

Return a nested solver (eg preconditioner) if it exists. By default return a nullptr

Reimplemented in AMP::Solver::PetscSNESSolver.

Definition at line 172 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_pNestedSolver.

◆ getOperator()

virtual std::shared_ptr< AMP::Operator::Operator > AMP::Solver::SolverStrategy::getOperator ( void  )
virtualinherited

Return a shared pointer to the operator registered with the solver.

◆ getRelativeTolerance()

AMP::Scalar AMP::Solver::SolverStrategy::getRelativeTolerance ( ) const
inlineinherited

◆ getResidualNorm()

virtual AMP::Scalar AMP::Solver::SolverStrategy::getResidualNorm ( void  ) const
inlinevirtualinherited

Definition at line 239 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_dResidualNorm.

◆ getSolutionScaling()

std::shared_ptr< AMP::LinearAlgebra::Vector > AMP::Solver::SolverStrategy::getSolutionScaling ( )
inlineinherited

Definition at line 266 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_pSolutionScaling.

◆ getTotalNumberOfIterations()

int AMP::Solver::SolverStrategy::getTotalNumberOfIterations ( void  )
inherited

◆ initialize() [1/3]

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::initialize ( std::shared_ptr< AMP::LinearAlgebra::Vector solution_vector)
private

◆ initialize() [2/3]

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::initialize ( std::shared_ptr< const AMP::Solver::SolverStrategyParameters parameters)
override

◆ initialize() [3/3]

virtual void AMP::Solver::SolverStrategy::initialize ( std::shared_ptr< const SolverStrategyParameters parameters)
virtualinherited

◆ operator=()

◆ print()

virtual void AMP::Solver::SolverStrategy::print ( std::ostream &  )
inlinevirtualinherited

Definition at line 237 of file SolverStrategy.h.

◆ printConvergenceStatus()

virtual void AMP::Solver::SolverStrategy::printConvergenceStatus ( SolverStrategy::SolverStatus  ,
std::ostream &  = AMP::pout 
) const
inlinevirtualinherited

Reimplemented in AMP::Solver::PetscSNESSolver.

Definition at line 251 of file SolverStrategy.h.

◆ printStatistics()

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::printStatistics ( std::ostream &  os)
overridevirtual

Reimplemented from AMP::Solver::SolverStrategy.

◆ registerOperator()

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::registerOperator ( std::shared_ptr< AMP::Operator::Operator op)
finaloverridevirtual

Register the operator that the solver will use during solves

Parameters
[in]opshared pointer to operator \(A()\) for equation \(A(u) = f\)

Reimplemented from AMP::Solver::SolverStrategy.

◆ registerWriter()

virtual void AMP::Solver::SolverStrategy::registerWriter ( std::shared_ptr< AMP::IO::Writer writer)
inlinevirtualinherited

Registers a writer with the solver.

This function will register a writer with the solver. The solver may then register any vector components it "owns" with the writer.

Parameters
writerThe writer to register

Definition at line 186 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_writer.

◆ relax()

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::relax ( void  )

◆ reset() [1/2]

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::reset ( std::shared_ptr< AMP::Solver::SolverStrategyParameters parameters)
override

Resets the solver internally with new parameters if necessary

Parameters
parametersSolverStrategyParameters object that is NULL by default

◆ reset() [2/2]

virtual void AMP::Solver::SolverStrategy::reset ( std::shared_ptr< SolverStrategyParameters parameters)
virtualinherited

◆ resetOperator()

virtual void AMP::Solver::SolverStrategy::resetOperator ( std::shared_ptr< const AMP::Operator::OperatorParameters parameters)
virtualinherited

Resets the operator registered with the solver with new parameters if necessary

Parameters
parametersOperatorParameters object that is NULL by default

Reimplemented in AMP::Solver::PetscKrylovSolver, AMP::Solver::BandedSolver, AMP::Solver::ColumnSolver, AMP::Solver::HypreSolver, AMP::Solver::CoupledFlow1DSolver, AMP::Solver::Flow1DSolver, AMP::Solver::PelletStackMechanicsSolver, AMP::Solver::TrilinosMLSolver, and AMP::Solver::TrilinosMueLuSolver.

◆ residual()

virtual void AMP::Solver::SolverStrategy::residual ( std::shared_ptr< const AMP::LinearAlgebra::Vector f,
std::shared_ptr< const AMP::LinearAlgebra::Vector u,
std::shared_ptr< AMP::LinearAlgebra::Vector r 
)
virtualinherited

◆ restart()

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::restart ( void  )

◆ setAbsoluteTolerance()

virtual void AMP::Solver::SolverStrategy::setAbsoluteTolerance ( AMP::Scalar  abs_tol)
inlinevirtualinherited

◆ setComponentScalings()

void AMP::Solver::SolverStrategy::setComponentScalings ( std::shared_ptr< AMP::LinearAlgebra::Vector s,
std::shared_ptr< AMP::LinearAlgebra::Vector f 
)
inlineinherited

for multiphysics problems it may be necessary to scale the solution

Definition at line 259 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_pFunctionScaling, and AMP::Solver::SolverStrategy::d_pSolutionScaling.

◆ setDebugPrintInfoLevel()

virtual void AMP::Solver::SolverStrategy::setDebugPrintInfoLevel ( int  print_level)
inlinevirtualinherited

Specify level of diagnostic information printed during iterations.

Parameters
[in]print_levelinteger level value with permissible values 0 and higher. Setting to zero should provide minimial debugging information with higher values resulting in increasingly verbose information being printed out.

Definition at line 132 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_iDebugPrintInfoLevel.

◆ setExecutionSpace()

void AMP::Solver::SolverStrategy::setExecutionSpace ( AMP::Utilities::ExecutionSpace  space)
inlineinherited

Definition at line 270 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_exec_space.

◆ setInitialGuess()

virtual void AMP::Solver::SolverStrategy::setInitialGuess ( std::shared_ptr< AMP::LinearAlgebra::Vector initialGuess)
virtualinherited

Provide the initial guess for the solver. This is a pure virtual function that the derived classes need to provide an implementation of.

Parameters
[in]initialGuessshared pointer to the initial guess vector.

Reimplemented in AMP::Solver::ColumnSolver, AMP::Solver::CoupledFlow1DSolver, AMP::Solver::Flow1DSolver, AMP::Solver::PetscSNESSolver, and AMP::Solver::TrilinosNOXSolver.

◆ setIsNestedSolver()

void AMP::Solver::SolverStrategy::setIsNestedSolver ( bool  is_nested)
inlineinherited

Tell a solver that it is nested inside some outer solver.

Definition at line 166 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_bIsNestedSolver.

◆ setMaxFunctionEvaluations()

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::setMaxFunctionEvaluations ( int  max_feval)

Set maximum function evaluations in nonlinear solver.

◆ setMaxIterations()

virtual void AMP::Solver::SolverStrategy::setMaxIterations ( const int  max_iterations)
inlinevirtualinherited

Definition at line 216 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_iMaxIterations.

◆ setMaxNonlinearIterations()

template<typename T = double>
void AMP::Solver::NonlinearKrylovAccelerator< T >::setMaxNonlinearIterations ( int  max_nli)

Set maximum iterations for nonlinear solver.

◆ setNestedSolver()

virtual void AMP::Solver::SolverStrategy::setNestedSolver ( std::shared_ptr< SolverStrategy solver)
inlinevirtualinherited

Set a nested solver, eg, Krylov for Newton, preconditioner for Krylov etc. Null op in base class

Definition at line 159 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_pNestedSolver.

◆ setRelativeTolerance()

virtual void AMP::Solver::SolverStrategy::setRelativeTolerance ( AMP::Scalar  rel_tol)
inlinevirtualinherited

◆ setZeroInitialGuess()

virtual void AMP::Solver::SolverStrategy::setZeroInitialGuess ( bool  use_zero_guess)
inlinevirtualinherited

Tells the solver to use an initial guess of zero and not try to copy an initial guess into the solution vector

Parameters
[in]use_zero_guessboolean to specify whether zero initial guess should be used or not.

Reimplemented in AMP::Solver::PetscKrylovSolver.

Definition at line 150 of file SolverStrategy.h.

References AMP::Solver::SolverStrategy::d_bUseZeroInitialGuess.

◆ statusToString()

static std::string AMP::Solver::SolverStrategy::statusToString ( SolverStatus  status)
inlinestaticinherited

◆ type()

template<typename T = double>
std::string AMP::Solver::NonlinearKrylovAccelerator< T >::type ( ) const
inlineoverridevirtual

Return the name of the solver.

Implements AMP::Solver::SolverStrategy.

Definition at line 32 of file NonlinearKrylovAccelerator.h.

Member Data Documentation

◆ d_adaptive_damping

template<typename T = double>
bool AMP::Solver::NonlinearKrylovAccelerator< T >::d_adaptive_damping = false
private

whether to use damping

Definition at line 144 of file NonlinearKrylovAccelerator.h.

◆ d_bComputeResidual

bool AMP::Solver::SolverStrategy::d_bComputeResidual = false
protectedinherited

Definition at line 295 of file SolverStrategy.h.

◆ d_bIsNestedSolver

bool AMP::Solver::SolverStrategy::d_bIsNestedSolver = false
protectedinherited

Definition at line 294 of file SolverStrategy.h.

Referenced by AMP::Solver::SolverStrategy::setIsNestedSolver().

◆ d_bUseZeroInitialGuess

bool AMP::Solver::SolverStrategy::d_bUseZeroInitialGuess = true
protectedinherited

◆ d_ConvergenceStatus

SolverStatus AMP::Solver::SolverStrategy::d_ConvergenceStatus = SolverStatus::DivergedOther
protectedinherited

◆ d_correction_vector

template<typename T = double>
std::shared_ptr<AMP::LinearAlgebra::Vector> AMP::Solver::NonlinearKrylovAccelerator< T >::d_correction_vector
private

correction vectors

Definition at line 117 of file NonlinearKrylovAccelerator.h.

◆ d_current_correction

template<typename T = double>
int AMP::Solver::NonlinearKrylovAccelerator< T >::d_current_correction = 0
private

Definition at line 131 of file NonlinearKrylovAccelerator.h.

◆ d_dAbsoluteTolerance

AMP::Scalar AMP::Solver::SolverStrategy::d_dAbsoluteTolerance = 1.0e-14
protectedinherited

◆ d_db

std::shared_ptr<AMP::Database> AMP::Solver::SolverStrategy::d_db = nullptr
protectedinherited

Definition at line 304 of file SolverStrategy.h.

◆ d_dInitialResidual

AMP::Scalar AMP::Solver::SolverStrategy::d_dInitialResidual
protectedinherited

Definition at line 285 of file SolverStrategy.h.

Referenced by AMP::Solver::SolverStrategy::getInitialResidual().

◆ d_dRelativeTolerance

AMP::Scalar AMP::Solver::SolverStrategy::d_dRelativeTolerance = 1.0e-09
protectedinherited

◆ d_dResidualNorm

AMP::Scalar AMP::Solver::SolverStrategy::d_dResidualNorm
protectedinherited

Definition at line 284 of file SolverStrategy.h.

Referenced by AMP::Solver::SolverStrategy::getResidualNorm().

◆ d_eta

template<typename T = double>
T AMP::Solver::NonlinearKrylovAccelerator< T >::d_eta = 1.0
private

keeps track of the number of function applications

Definition at line 137 of file NonlinearKrylovAccelerator.h.

◆ d_exec_space

AMP::Utilities::ExecutionSpace AMP::Solver::SolverStrategy::d_exec_space = AMP::Utilities::ExecutionSpace::unspecified
protectedinherited

execution space for the solver

Definition at line 324 of file SolverStrategy.h.

Referenced by AMP::Solver::SolverStrategy::getExecutionSpace(), and AMP::Solver::SolverStrategy::setExecutionSpace().

◆ d_first

template<typename T = double>
int AMP::Solver::NonlinearKrylovAccelerator< T >::d_first = 0
private

matrix of w vector inner products

Definition at line 124 of file NonlinearKrylovAccelerator.h.

◆ d_free

template<typename T = double>
int AMP::Solver::NonlinearKrylovAccelerator< T >::d_free = 0
private

index of last subspace vector

Definition at line 126 of file NonlinearKrylovAccelerator.h.

◆ d_freeze_pc

template<typename T = double>
bool AMP::Solver::NonlinearKrylovAccelerator< T >::d_freeze_pc = true
private

whether the solver uses a preconditioner or not

Definition at line 140 of file NonlinearKrylovAccelerator.h.

◆ d_function_apply_count

template<typename T = double>
int AMP::Solver::NonlinearKrylovAccelerator< T >::d_function_apply_count = 0
private

keeps track of the number of preconditioner applications

Definition at line 135 of file NonlinearKrylovAccelerator.h.

◆ d_global_db

std::shared_ptr<AMP::Database> AMP::Solver::SolverStrategy::d_global_db = nullptr
protectedinherited

Pointer to global database This is temporary fix and eventually either d_global_db or d_db should go away This is introduced to allow for solver factories to access databases in the global database for the construction of nested solvers

Definition at line 311 of file SolverStrategy.h.

◆ d_h

template<typename T = double>
T** AMP::Solver::NonlinearKrylovAccelerator< T >::d_h
private

function difference vectors

Definition at line 121 of file NonlinearKrylovAccelerator.h.

◆ d_iDebugPrintInfoLevel

int AMP::Solver::SolverStrategy::d_iDebugPrintInfoLevel = 0
protectedinherited

◆ d_iInstanceId

int AMP::Solver::SolverStrategy::d_iInstanceId
staticprotectedinherited

Definition at line 299 of file SolverStrategy.h.

◆ d_iMaxIterations

int AMP::Solver::SolverStrategy::d_iMaxIterations = 0
protectedinherited

◆ d_iNumberIterations

int AMP::Solver::SolverStrategy::d_iNumberIterations = 0
protectedinherited

Definition at line 280 of file SolverStrategy.h.

Referenced by AMP::Solver::SolverStrategy::getIterations().

◆ d_iObjectId

int AMP::Solver::SolverStrategy::d_iObjectId
protectedinherited

Definition at line 297 of file SolverStrategy.h.

◆ d_iterationHistory

std::vector<int> AMP::Solver::SolverStrategy::d_iterationHistory
protectedinherited

keeps track of iteration statistics over solver lifetime

Definition at line 302 of file SolverStrategy.h.

Referenced by AMP::Solver::SolverStrategy::getIterationHistory().

◆ d_last

template<typename T = double>
int AMP::Solver::NonlinearKrylovAccelerator< T >::d_last = 0
private

index of first subspace vector

Definition at line 125 of file NonlinearKrylovAccelerator.h.

◆ d_maximum_function_evals

template<typename T = double>
int AMP::Solver::NonlinearKrylovAccelerator< T >::d_maximum_function_evals = 0
private

previous index link field in doubly-linked subspace v

Definition at line 130 of file NonlinearKrylovAccelerator.h.

◆ d_memory_location

AMP::Utilities::MemoryType AMP::Solver::SolverStrategy::d_memory_location = AMP::Utilities::MemoryType::none
protectedinherited

memory storage address space

Definition at line 327 of file SolverStrategy.h.

◆ d_mvec

template<typename T = double>
int AMP::Solver::NonlinearKrylovAccelerator< T >::d_mvec = 0
private

use qr factorization to solve the least squares problem

Definition at line 112 of file NonlinearKrylovAccelerator.h.

◆ d_next

template<typename T = double>
std::vector<int> AMP::Solver::NonlinearKrylovAccelerator< T >::d_next
private

index of the initial vector in free storage linked list

Definition at line 127 of file NonlinearKrylovAccelerator.h.

◆ d_pending

template<typename T = double>
bool AMP::Solver::NonlinearKrylovAccelerator< T >::d_pending = false
private

boolean: a nonempty subspace

Definition at line 109 of file NonlinearKrylovAccelerator.h.

◆ d_pFunctionScaling

std::shared_ptr<AMP::LinearAlgebra::Vector> AMP::Solver::SolverStrategy::d_pFunctionScaling
protectedinherited

◆ d_pNestedSolver

std::shared_ptr<AMP::Solver::SolverStrategy> AMP::Solver::SolverStrategy::d_pNestedSolver = nullptr
protectedinherited

nested solver used by this solver

Definition at line 319 of file SolverStrategy.h.

Referenced by AMP::Solver::SolverStrategy::getNestedSolver(), and AMP::Solver::SolverStrategy::setNestedSolver().

◆ d_pOperator

std::shared_ptr<AMP::Operator::Operator> AMP::Solver::SolverStrategy::d_pOperator = nullptr
protectedinherited

Definition at line 316 of file SolverStrategy.h.

◆ d_preconditioner_apply_count

template<typename T = double>
int AMP::Solver::NonlinearKrylovAccelerator< T >::d_preconditioner_apply_count
private
Initial value:
=
0

current number of corrections, updated each time correction is called

Definition at line 133 of file NonlinearKrylovAccelerator.h.

◆ d_prev

template<typename T = double>
std::vector<int> AMP::Solver::NonlinearKrylovAccelerator< T >::d_prev
private

next index link field

Definition at line 128 of file NonlinearKrylovAccelerator.h.

◆ d_print_residuals

template<typename T = double>
bool AMP::Solver::NonlinearKrylovAccelerator< T >::d_print_residuals = false
private

flag determining whether the preconditioner is frozen or not

Definition at line 141 of file NonlinearKrylovAccelerator.h.

◆ d_pSolutionScaling

std::shared_ptr<AMP::LinearAlgebra::Vector> AMP::Solver::SolverStrategy::d_pSolutionScaling
protectedinherited

◆ d_residual_vector

template<typename T = double>
std::shared_ptr<AMP::LinearAlgebra::Vector> AMP::Solver::NonlinearKrylovAccelerator< T >::d_residual_vector
private

correction vectors

Definition at line 116 of file NonlinearKrylovAccelerator.h.

◆ d_sName

std::string AMP::Solver::SolverStrategy::d_sName
protectedinherited

Definition at line 278 of file SolverStrategy.h.

◆ d_solution_vector

template<typename T = double>
std::shared_ptr<AMP::LinearAlgebra::Vector> AMP::Solver::NonlinearKrylovAccelerator< T >::d_solution_vector
private

vector drop tolerance

Definition at line 115 of file NonlinearKrylovAccelerator.h.

◆ d_solver_initialized

template<typename T = double>
bool AMP::Solver::NonlinearKrylovAccelerator< T >::d_solver_initialized = false
private

whether to print the residuals

Definition at line 142 of file NonlinearKrylovAccelerator.h.

◆ d_subspace

template<typename T = double>
bool AMP::Solver::NonlinearKrylovAccelerator< T >::d_subspace = false
private

Definition at line 108 of file NonlinearKrylovAccelerator.h.

◆ d_use_damping

template<typename T = double>
bool AMP::Solver::NonlinearKrylovAccelerator< T >::d_use_damping = false
private

Definition at line 143 of file NonlinearKrylovAccelerator.h.

◆ d_use_qr

template<typename T = double>
bool AMP::Solver::NonlinearKrylovAccelerator< T >::d_use_qr = false
private

contains pending vectors – boolean

Definition at line 110 of file NonlinearKrylovAccelerator.h.

◆ d_uses_preconditioner

template<typename T = double>
bool AMP::Solver::NonlinearKrylovAccelerator< T >::d_uses_preconditioner = false
private

damping factor

Definition at line 139 of file NonlinearKrylovAccelerator.h.

◆ d_v

template<typename T = double>
std::vector<std::shared_ptr<AMP::LinearAlgebra::Vector> > AMP::Solver::NonlinearKrylovAccelerator< T >::d_v
private

correction vectors

Definition at line 119 of file NonlinearKrylovAccelerator.h.

◆ d_vtol

template<typename T = double>
T AMP::Solver::NonlinearKrylovAccelerator< T >::d_vtol = 0.0
private

maximum number of subspace vectors

Definition at line 113 of file NonlinearKrylovAccelerator.h.

◆ d_w

template<typename T = double>
std::vector<std::shared_ptr<AMP::LinearAlgebra::Vector> > AMP::Solver::NonlinearKrylovAccelerator< T >::d_w
private

correction vectors

Definition at line 120 of file NonlinearKrylovAccelerator.h.

◆ d_writer

std::shared_ptr<AMP::IO::Writer> AMP::Solver::SolverStrategy::d_writer = nullptr
protectedinherited

Definition at line 321 of file SolverStrategy.h.

Referenced by AMP::Solver::SolverStrategy::registerWriter().


The documentation for this class was generated from the following file:



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:45.
Comments on this page