Advanced Multi-Physics (AMP)
On-Line Documentation
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
AMP::Solver::HypreSolver Class Referenceabstract

#include <HypreSolver.h>

Inheritance diagram for AMP::Solver::HypreSolver:
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
 
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 ()
 
HYPRE_Solver getHYPRESolver ()
 
virtual AMP::Scalar getInitialResidual (void) const
 
virtual const std::vector< int > & getIterationHistory (void)
 
virtual int getIterations (void) const
 
int getMaxIterations (void) 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)
 
 HypreSolver ()
 
 HypreSolver (std::shared_ptr< HypreSolverParameters > parameters)
 
void initialize (std::shared_ptr< const SolverStrategyParameters > parameters) override
 
virtual void print (std::ostream &)
 
virtual void printConvergenceStatus (SolverStrategy::SolverStatus, std::ostream &=AMP::pout) const
 
virtual void printStatistics (std::ostream &os=AMP::pout)
 
void registerOperator (std::shared_ptr< AMP::Operator::Operator > op) override
 
virtual void registerWriter (std::shared_ptr< AMP::IO::Writer > writer)
 Registers a writer with the solver.
 
void reset (std::shared_ptr< SolverStrategyParameters > params) override
 
void resetOperator (std::shared_ptr< const AMP::Operator::OperatorParameters > params) override
 
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)
 
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 setExecutionPolicy (HYPRE_ExecutionPolicy policy)
 
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.
 
virtual void setMaxIterations (const int max_iterations)
 
void setMemoryLocation (HYPRE_MemoryLocation location)
 
virtual void setNestedSolver (std::shared_ptr< SolverStrategy > solver)
 
virtual void setRelativeTolerance (AMP::Scalar rel_tol)
 
virtual void setZeroInitialGuess (bool use_zero_guess)
 
virtual std::string type () const =0
 Return the name of the solver.
 
virtual ~HypreSolver ()
 

Static Public Member Functions

static std::string statusToString (SolverStatus status)
 

Protected Member Functions

virtual bool checkStoppingCriteria (AMP::Scalar res_norm, bool check_iters=true)
 
void copyFromHypre (HYPRE_IJVector hypre_v, std::shared_ptr< AMP::LinearAlgebra::Vector > amp_v)
 
void copyToHypre (std::shared_ptr< const AMP::LinearAlgebra::Vector > amp_v, HYPRE_IJVector hypre_v)
 
void createHYPREMatrix (std::shared_ptr< AMP::LinearAlgebra::Matrix > matrix)
 
void createHypreSolver ()
 
void createHYPREVectors ()
 
void destroyHypreSolver ()
 
void getBaseFromInput (std::shared_ptr< AMP::Database > db)
 
void hypreSolve ()
 
void postSolve (std::shared_ptr< const AMP::LinearAlgebra::Vector > f, std::shared_ptr< AMP::LinearAlgebra::Vector > u)
 
void preSolve (std::shared_ptr< const AMP::LinearAlgebra::Vector > f, std::shared_ptr< AMP::LinearAlgebra::Vector > u)
 
void setCommonParameters (std::shared_ptr< const AMP::Database > db)
 
void setParameters (void)
 
void setupHypreMatrixAndRhs ()
 set parameters based on internally set variables
 
void setupNestedSolver (std::shared_ptr< const SolverStrategyParameters > parameters)
 
void setupSolver ()
 

Protected Attributes

bool d_bComputeResidual = false
 
bool d_bDiagScalePC = false
 
bool d_bIsNestedSolver = false
 
bool d_bMatrixInitialized = false
 
bool d_bUsesPreconditioner = false
 
bool d_bUseZeroInitialGuess = true
 
std::shared_ptr< AMP::LinearAlgebra::Matrixd_castedMatrix
 
AMP_MPI d_comm
 use diagonal scaled preconditioner
 
std::shared_ptr< AMP::LinearAlgebra::Vectord_compat_amp_v
 
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
 
HYPRE_ExecutionPolicy d_hypre_exec_policy
 
HYPRE_MemoryLocation d_hypre_memory_location
 pointer to HYPRE solver
 
HYPRE_IJVector d_hypre_rhs = nullptr
 pointer to HYPRE matrix struct
 
HYPRE_IJVector d_hypre_sol = nullptr
 pointer to HYPRE representation of rhs
 
HYPRE_Int(* d_hypreCreateSolver )(MPI_Comm comm, HYPRE_Solver *solver) = nullptr
 
HYPRE_Int(* d_hypreDestroySolver )(HYPRE_Solver solver) = nullptr
 
HYPRE_Int(* d_hypreGetNumIterations )(HYPRE_Solver solver, HYPRE_Int *num_iterations) = nullptr
 
std::shared_ptr< AMP::LinearAlgebra::HypreMatrixAdaptord_HypreMatrixAdaptor
 
HYPRE_Int(* d_hypreSetAbsoluteTolerance )(HYPRE_Solver solver, HYPRE_Real tol) = nullptr
 
HYPRE_Int(* d_hypreSetLogging )(HYPRE_Solver solver, HYPRE_Int logging) = nullptr
 
HYPRE_Int(* d_hypreSetMaxIterations )(HYPRE_Solver solver, HYPRE_Int max_iter) = nullptr
 
HYPRE_Int(* d_hypreSetPreconditioner )(HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver) = nullptr
 
HYPRE_Int(* d_hypreSetPrintLevel )(HYPRE_Solver solver, HYPRE_Int level) = nullptr
 
HYPRE_Int(* d_hypreSetRelativeTolerance )(HYPRE_Solver solver, HYPRE_Real tol) = nullptr
 
HYPRE_PtrToSolverFcn d_hypreSolve = nullptr
 
HYPRE_Int(* d_hypreSolverSetup )(HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x) = nullptr
 
int d_iDebugPrintInfoLevel = 0
 
HYPRE_IJMatrix d_ijMatrix = nullptr
 
int d_iMaxIterations = 0
 
int d_iNumberIterations = 0
 
int d_iObjectId
 
std::vector< intd_iterationHistory
 keeps track of iteration statistics over solver lifetime
 
HYPRE_Int d_logging = 0
 
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::shared_ptr< AMP::LinearAlgebra::Vectord_r
 
std::string d_sName
 
HYPRE_Solver d_solver = nullptr
 pointer to HYPRE representation of solution
 
std::shared_ptr< AMP::IO::Writerd_writer = nullptr
 

Static Protected Attributes

static int d_iInstanceId
 

Detailed Description

The HypreSolver is a wrapper to the HYPRE PCG solver. The wrapper at present simply provides an adapter to enable AMP users to use the black box HyprePCG solver.

Definition at line 36 of file HypreSolver.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

◆ HypreSolver() [1/2]

AMP::Solver::HypreSolver::HypreSolver ( )

Default constructor

◆ HypreSolver() [2/2]

AMP::Solver::HypreSolver::HypreSolver ( std::shared_ptr< HypreSolverParameters parameters)
explicit

Main constructor.

Parameters
[in]parametersThe parameters object contains a database object which must contain the following fields in addition to the fields expected by the base class SolverStrategy class:

◆ ~HypreSolver()

virtual AMP::Solver::HypreSolver::~HypreSolver ( )
virtual

Default destructor

Member Function Documentation

◆ apply()

void AMP::Solver::HypreSolver::apply ( std::shared_ptr< const AMP::LinearAlgebra::Vector f,
std::shared_ptr< AMP::LinearAlgebra::Vector u 
)
overridevirtual

Solve the system \(Au = f\).

Parameters
[in]f: shared pointer to right hand side vector
[out]u: shared pointer to approximate computed solution

Implements AMP::Solver::SolverStrategy.

◆ checkStoppingCriteria()

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

◆ copyFromHypre()

void AMP::Solver::HypreSolver::copyFromHypre ( HYPRE_IJVector  hypre_v,
std::shared_ptr< AMP::LinearAlgebra::Vector amp_v 
)
protected

copy values from hypre vector to amp vector

◆ copyToHypre()

void AMP::Solver::HypreSolver::copyToHypre ( std::shared_ptr< const AMP::LinearAlgebra::Vector amp_v,
HYPRE_IJVector  hypre_v 
)
protected

copy values from amp vector to hypre vector

◆ createHYPREMatrix()

void AMP::Solver::HypreSolver::createHYPREMatrix ( std::shared_ptr< AMP::LinearAlgebra::Matrix matrix)
protected

create the internal HYPRE_IJMatrix based on the AMP matrix

◆ createHypreSolver()

void AMP::Solver::HypreSolver::createHypreSolver ( )
protected

Create Hypre solvers uniformly when possible

◆ createHYPREVectors()

void AMP::Solver::HypreSolver::createHYPREVectors ( )
protected

create and initialize the internal hypre vectors for rhs and solution

◆ destroyHypreSolver()

void AMP::Solver::HypreSolver::destroyHypreSolver ( )
protected

Destroy Hypre solvers uniformly

◆ 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.

◆ 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.

◆ getHYPRESolver()

HYPRE_Solver AMP::Solver::HypreSolver::getHYPRESolver ( )
inline

Definition at line 102 of file HypreSolver.h.

References d_solver.

◆ 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.

◆ getMaxIterations()

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

Definition at line 218 of file SolverStrategy.h.

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

◆ 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

◆ hypreSolve()

void AMP::Solver::HypreSolver::hypreSolve ( )
protected

◆ initialize()

void AMP::Solver::HypreSolver::initialize ( std::shared_ptr< const SolverStrategyParameters parameters)
overridevirtual

Initialize the solution vector and potentially create internal vectors needed for solution

Parameters
[in]parametersThe parameters object contains a database object. Refer to the documentation for the constructor to see what fields are required. This routine assumes that a non-NULL operator of type LinearOperator has been registered with the solver. The LinearOperator currently is assumed to contain a pointer to an EpetraMatrix object.

Reimplemented from AMP::Solver::SolverStrategy.

◆ postSolve()

void AMP::Solver::HypreSolver::postSolve ( std::shared_ptr< const AMP::LinearAlgebra::Vector f,
std::shared_ptr< AMP::LinearAlgebra::Vector u 
)
protected

◆ preSolve()

void AMP::Solver::HypreSolver::preSolve ( std::shared_ptr< const AMP::LinearAlgebra::Vector f,
std::shared_ptr< AMP::LinearAlgebra::Vector u 
)
protected

◆ 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()

virtual void AMP::Solver::SolverStrategy::printStatistics ( std::ostream &  os = AMP::pout)
inlinevirtualinherited

Reimplemented in AMP::Solver::NonlinearKrylovAccelerator< T >.

Definition at line 220 of file SolverStrategy.h.

◆ registerOperator()

void AMP::Solver::HypreSolver::registerOperator ( std::shared_ptr< AMP::Operator::Operator op)
overridevirtual

Register the operator that the solver will use during solves

Parameters
[in]opshared pointer to the linear 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.

◆ reset()

void AMP::Solver::HypreSolver::reset ( std::shared_ptr< SolverStrategyParameters params)
overridevirtual

Resets the solver internally with new parameters if necessary

Parameters
[in]paramsSolverStrategyParameters object that is NULL by default Currently every call to reset destroys the HyprePCG solver object and recreates it based on the parameters object. See constructor for fields required for parameter object.

Reimplemented from AMP::Solver::SolverStrategy.

◆ resetOperator()

void AMP::Solver::HypreSolver::resetOperator ( std::shared_ptr< const AMP::Operator::OperatorParameters params)
overridevirtual

Resets the associated operator internally with new parameters if necessary

Parameters
[in]paramsOperatorParameters object that is NULL by default

Reimplemented from AMP::Solver::SolverStrategy.

◆ 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

◆ setAbsoluteTolerance()

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

◆ setCommonParameters()

void AMP::Solver::HypreSolver::setCommonParameters ( std::shared_ptr< const AMP::Database db)
protected

get inputs common to all/most Hypre solvers

◆ 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.

◆ setExecutionPolicy()

void AMP::Solver::HypreSolver::setExecutionPolicy ( HYPRE_ExecutionPolicy  policy)
inline

Set the desired HYPRE execution policy for the solver

Definition at line 100 of file HypreSolver.h.

References d_hypre_exec_policy.

◆ 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.

◆ 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.

◆ setMemoryLocation()

void AMP::Solver::HypreSolver::setMemoryLocation ( HYPRE_MemoryLocation  location)
inline

Set the desired HYPRE memory location for HYPRE objects

Definition at line 95 of file HypreSolver.h.

References d_hypre_memory_location.

◆ 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.

◆ setParameters()

void AMP::Solver::HypreSolver::setParameters ( void  )
protected

◆ setRelativeTolerance()

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

◆ setupHypreMatrixAndRhs()

void AMP::Solver::HypreSolver::setupHypreMatrixAndRhs ( )
protected

set parameters based on internally set variables

◆ setupNestedSolver()

void AMP::Solver::HypreSolver::setupNestedSolver ( std::shared_ptr< const SolverStrategyParameters parameters)
protected

◆ setupSolver()

void AMP::Solver::HypreSolver::setupSolver ( )
protected

◆ 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()

virtual std::string AMP::Solver::SolverStrategy::type ( ) const
pure virtualinherited

Member Data Documentation

◆ d_bComputeResidual

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

Definition at line 295 of file SolverStrategy.h.

◆ d_bDiagScalePC

bool AMP::Solver::HypreSolver::d_bDiagScalePC = false
protected

Definition at line 168 of file HypreSolver.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_bMatrixInitialized

bool AMP::Solver::HypreSolver::d_bMatrixInitialized = false
protected

Definition at line 165 of file HypreSolver.h.

◆ d_bUsesPreconditioner

bool AMP::Solver::HypreSolver::d_bUsesPreconditioner = false
protected

Definition at line 167 of file HypreSolver.h.

◆ d_bUseZeroInitialGuess

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

◆ d_castedMatrix

std::shared_ptr<AMP::LinearAlgebra::Matrix> AMP::Solver::HypreSolver::d_castedMatrix
protected

Definition at line 173 of file HypreSolver.h.

◆ d_comm

AMP_MPI AMP::Solver::HypreSolver::d_comm
protected

use diagonal scaled preconditioner

Definition at line 171 of file HypreSolver.h.

◆ d_compat_amp_v

std::shared_ptr<AMP::LinearAlgebra::Vector> AMP::Solver::HypreSolver::d_compat_amp_v
protected

Definition at line 174 of file HypreSolver.h.

◆ d_ConvergenceStatus

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

◆ 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_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_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_hypre_exec_policy

HYPRE_ExecutionPolicy AMP::Solver::HypreSolver::d_hypre_exec_policy
protected

Definition at line 185 of file HypreSolver.h.

Referenced by setExecutionPolicy().

◆ d_hypre_memory_location

HYPRE_MemoryLocation AMP::Solver::HypreSolver::d_hypre_memory_location
protected

pointer to HYPRE solver

Definition at line 184 of file HypreSolver.h.

Referenced by setMemoryLocation().

◆ d_hypre_rhs

HYPRE_IJVector AMP::Solver::HypreSolver::d_hypre_rhs = nullptr
protected

pointer to HYPRE matrix struct

Definition at line 180 of file HypreSolver.h.

◆ d_hypre_sol

HYPRE_IJVector AMP::Solver::HypreSolver::d_hypre_sol = nullptr
protected

pointer to HYPRE representation of rhs

Definition at line 181 of file HypreSolver.h.

◆ d_hypreCreateSolver

HYPRE_Int(* AMP::Solver::HypreSolver::d_hypreCreateSolver) (MPI_Comm comm, HYPRE_Solver *solver) = nullptr
protected

Definition at line 189 of file HypreSolver.h.

◆ d_hypreDestroySolver

HYPRE_Int(* AMP::Solver::HypreSolver::d_hypreDestroySolver) (HYPRE_Solver solver) = nullptr
protected

Definition at line 190 of file HypreSolver.h.

◆ d_hypreGetNumIterations

HYPRE_Int(* AMP::Solver::HypreSolver::d_hypreGetNumIterations) (HYPRE_Solver solver, HYPRE_Int *num_iterations) = nullptr
protected

Definition at line 193 of file HypreSolver.h.

◆ d_HypreMatrixAdaptor

std::shared_ptr<AMP::LinearAlgebra::HypreMatrixAdaptor> AMP::Solver::HypreSolver::d_HypreMatrixAdaptor
protected

Definition at line 175 of file HypreSolver.h.

◆ d_hypreSetAbsoluteTolerance

HYPRE_Int(* AMP::Solver::HypreSolver::d_hypreSetAbsoluteTolerance) (HYPRE_Solver solver, HYPRE_Real tol) = nullptr
protected

Definition at line 205 of file HypreSolver.h.

◆ d_hypreSetLogging

HYPRE_Int(* AMP::Solver::HypreSolver::d_hypreSetLogging) (HYPRE_Solver solver, HYPRE_Int logging) = nullptr
protected

Definition at line 208 of file HypreSolver.h.

◆ d_hypreSetMaxIterations

HYPRE_Int(* AMP::Solver::HypreSolver::d_hypreSetMaxIterations) (HYPRE_Solver solver, HYPRE_Int max_iter) = nullptr
protected

Definition at line 206 of file HypreSolver.h.

◆ d_hypreSetPreconditioner

HYPRE_Int(* AMP::Solver::HypreSolver::d_hypreSetPreconditioner) (HYPRE_Solver solver, HYPRE_PtrToSolverFcn precond, HYPRE_PtrToSolverFcn precond_setup, HYPRE_Solver precond_solver) = nullptr
protected

Definition at line 195 of file HypreSolver.h.

◆ d_hypreSetPrintLevel

HYPRE_Int(* AMP::Solver::HypreSolver::d_hypreSetPrintLevel) (HYPRE_Solver solver, HYPRE_Int level) = nullptr
protected

Definition at line 207 of file HypreSolver.h.

◆ d_hypreSetRelativeTolerance

HYPRE_Int(* AMP::Solver::HypreSolver::d_hypreSetRelativeTolerance) (HYPRE_Solver solver, HYPRE_Real tol) = nullptr
protected

Definition at line 204 of file HypreSolver.h.

◆ d_hypreSolve

HYPRE_PtrToSolverFcn AMP::Solver::HypreSolver::d_hypreSolve = nullptr
protected

Definition at line 192 of file HypreSolver.h.

◆ d_hypreSolverSetup

HYPRE_Int(* AMP::Solver::HypreSolver::d_hypreSolverSetup) (HYPRE_Solver solver, HYPRE_Matrix A, HYPRE_Vector b, HYPRE_Vector x) = nullptr
protected

Definition at line 199 of file HypreSolver.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_ijMatrix

HYPRE_IJMatrix AMP::Solver::HypreSolver::d_ijMatrix = nullptr
protected

Definition at line 179 of file HypreSolver.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_logging

HYPRE_Int AMP::Solver::HypreSolver::d_logging = 0
protected

Definition at line 187 of file HypreSolver.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_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_pSolutionScaling

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

◆ d_r

std::shared_ptr<AMP::LinearAlgebra::Vector> AMP::Solver::HypreSolver::d_r
protected

Definition at line 177 of file HypreSolver.h.

◆ d_sName

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

Definition at line 278 of file SolverStrategy.h.

◆ d_solver

HYPRE_Solver AMP::Solver::HypreSolver::d_solver = nullptr
protected

pointer to HYPRE representation of solution

Definition at line 182 of file HypreSolver.h.

Referenced by getHYPRESolver().

◆ 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