#include <TrilinosMueLuSolver.h>

Public Types | |
| typedef std::shared_ptr< AMP::Solver::SolverStrategy > | shared_ptr |
| enum class | SolverStatus { ConvergedOnAbsTol , ConvergedOnRelTol , ConvergedUserCondition , MaxIterations , DivergedLineSearch , DivergedStepSize , DivergedFunctionCount , DivergedOnNan , DivergedNestedSolver , DivergedOther } |
Static Public Member Functions | |
| static std::unique_ptr< SolverStrategy > | createSolver (std::shared_ptr< SolverStrategyParameters > solverStrategyParameters) |
| static create routine that is used by SolverFactory | |
| static std::string | statusToString (SolverStatus status) |
Static Protected Attributes | |
| static int | d_iInstanceId |
Private Attributes | |
| bool | d_bCreationPhase = false |
| build the hierarchy using the defaults constructed by MueLu | |
| bool | d_bRobustMode = false |
| set to true if the solver is yet to be initialized | |
| bool | d_build_hierarchy = false |
| whether we are using Epetra | |
| bool | d_build_hierarchy_from_defaults |
| whether to explicitly build the hierarchy | |
| bool | d_bUseEpetra = true |
| AMP_MPI | d_comm |
| use a direct solver if the MG solve fails to converge | |
| MueLu::FactoryManager< SC, LO, GO, NO > | d_factoryManager |
| factory manager for MueLu components | |
| std::vector< Teuchos::RCP< MueLu::FactoryManager< SC, LO, GO, NO > > > | d_levelFactoryManager |
| factory manager for MueLu components by level | |
| std::shared_ptr< AMP::LinearAlgebra::ManagedEpetraMatrix > | d_matrix |
| size_t | d_maxLevels |
| Teuchos::RCP< MueLu::Hierarchy< SC, LO, GO, NO > > | d_mueluHierarchy |
| AMG hierarchy. | |
| Teuchos::RCP< MueLu::HierarchyManager< SC, LO, GO, NO > > | d_mueluHierarchyManager |
| manager that creates hierarchy | |
| Teuchos::ParameterList | d_MueLuParameterList |
| std::shared_ptr< MueLu::EpetraOperator > | d_mueluSolver |
| key for creating different smoothers | |
| std::string | d_smoother_type |
| maximum number of levels | |
The TrilinosMueLuSolver is a wrapper to the Trilinos ML solver. ML provides implementations of various algebraic multigrid methods. The wrapper at present simply provides an adaptor to enable AMP users to use the black box ML preconditioner.
Definition at line 64 of file TrilinosMueLuSolver.h.
|
inherited |
Definition at line 30 of file SolverStrategy.h.
|
stronginherited |
| Enumerator | |
|---|---|
| ConvergedOnAbsTol | |
| ConvergedOnRelTol | |
| ConvergedUserCondition | |
| MaxIterations | |
| DivergedLineSearch | |
| DivergedStepSize | |
| DivergedFunctionCount | |
| DivergedOnNan | |
| DivergedNestedSolver | |
| DivergedOther | |
Definition at line 62 of file SolverStrategy.h.
| AMP::Solver::TrilinosMueLuSolver::TrilinosMueLuSolver | ( | ) |
Default constructor
|
explicit |
Main constructor.
| [in] | parameters | The parameters object contains a database object which must contain the following fields in addition to the fields expected by the base class SolverStrategy class: |
|
virtual |
Default destructor
|
overridevirtual |
Solve the system \(Au = f\).
| [in] | f | : shared pointer to right hand side vector |
| [out] | u | : shared pointer to approximate computed solution |
Implements AMP::Solver::SolverStrategy.
build the hierarchy level by level, potentially customizing each level
build the hierarchy using the defaults constructed by MueLu
|
protectedvirtualinherited |
|
inlinestatic |
static create routine that is used by SolverFactory
Definition at line 90 of file TrilinosMueLuSolver.h.
|
inlineinherited |
Definition at line 208 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_dAbsoluteTolerance.
|
protectedinherited |
|
protected |
Definition at line 225 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::ConvergedUserCondition, and AMP::Solver::SolverStrategy::d_ConvergenceStatus.
|
inlineinherited |
Definition at line 230 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_ConvergenceStatus.
|
inlineinherited |
Definition at line 232 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_ConvergenceStatus, and AMP::Solver::SolverStrategy::statusToString().
Get level of diagnostic information printed during iterations.
Definition at line 137 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_iDebugPrintInfoLevel.
|
inlineinherited |
Definition at line 269 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_exec_space.
|
protected |
|
inlineinherited |
Definition at line 267 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_pFunctionScaling.
|
inlinevirtualinherited |
Definition at line 241 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_dInitialResidual.
|
inlinevirtualinherited |
Definition at line 243 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_iterationHistory.
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.
Definition at line 218 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_iMaxIterations.
|
inline |
Return a shared pointer to the ML_Epetra::MultiLevelPreconditioner object
Definition at line 114 of file TrilinosMueLuSolver.h.
References d_mueluSolver.
|
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.
|
virtualinherited |
Return a shared pointer to the operator registered with the solver.
|
inlineinherited |
Definition at line 212 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_dRelativeTolerance.
|
inlinevirtualinherited |
Definition at line 239 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_dResidualNorm.
|
protected |
|
protected |
|
protected |
|
protected |
|
inlineinherited |
Definition at line 266 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_pSolutionScaling.
|
protected |
|
protected |
|
protected |
utility function to extract Xpetra Matrix from AMP LinearOperator
|
overridevirtual |
Initialize the solution vector and potentially create internal vectors needed for solution
| [in] | parameters | The 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.
Definition at line 237 of file SolverStrategy.h.
|
inlinevirtualinherited |
Reimplemented in AMP::Solver::PetscSNESSolver.
Definition at line 251 of file SolverStrategy.h.
|
inlinevirtualinherited |
Reimplemented in AMP::Solver::NonlinearKrylovAccelerator< T >.
Definition at line 220 of file SolverStrategy.h.
|
overridevirtual |
Register the operator that the solver will use during solves
| [in] | op | shared pointer to the linear operator $A$ for equation \(A u = f\) |
Reimplemented from AMP::Solver::SolverStrategy.
|
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.
| writer | The writer to register |
Definition at line 186 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_writer.
|
overridevirtual |
Resets the solver internally with new parameters if necessary
| [in] | params | SolverStrategyParameters object that is NULL by default Currently every call to reset destroys the ML preconditioner object and recreates it based on the parameters object. See constructor for fields required for parameter object. |
Reimplemented from AMP::Solver::SolverStrategy.
|
overridevirtual |
Resets the associated operator internally with new parameters if necessary
| [in] | params | OperatorParameters object that is NULL by default |
Reimplemented from AMP::Solver::SolverStrategy.
|
virtualinherited |
|
protected |
|
inlinevirtualinherited |
Definition at line 210 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_dAbsoluteTolerance.
|
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.
|
inlinevirtualinherited |
Specify level of diagnostic information printed during iterations.
| [in] | print_level | integer 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.
|
inlineinherited |
Definition at line 270 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_exec_space.
|
virtualinherited |
Provide the initial guess for the solver. This is a pure virtual function that the derived classes need to provide an implementation of.
| [in] | initialGuess | shared pointer to the initial guess vector. |
Reimplemented in AMP::Solver::ColumnSolver, AMP::Solver::CoupledFlow1DSolver, AMP::Solver::Flow1DSolver, AMP::Solver::PetscSNESSolver, and AMP::Solver::TrilinosNOXSolver.
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.
|
inlinevirtualinherited |
Definition at line 216 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_iMaxIterations.
|
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.
|
inlinevirtualinherited |
Definition at line 214 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::d_dRelativeTolerance.
|
inlinevirtualinherited |
Tells the solver to use an initial guess of zero and not try to copy an initial guess into the solution vector
| [in] | use_zero_guess | boolean 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.
| void AMP::Solver::TrilinosMueLuSolver::solveWithHierarchy | ( | std::shared_ptr< const AMP::LinearAlgebra::Vector > | f, |
| std::shared_ptr< AMP::LinearAlgebra::Vector > | u | ||
| ) |
Solve the system \(Au = f\).
| [in] | f | : shared pointer to right hand side vector |
| [out] | u | : shared pointer to approximate computed solution |
|
inlinestaticinherited |
Definition at line 75 of file SolverStrategy.h.
References AMP::Solver::SolverStrategy::ConvergedOnAbsTol, AMP::Solver::SolverStrategy::ConvergedOnRelTol, AMP::Solver::SolverStrategy::ConvergedUserCondition, AMP::Solver::SolverStrategy::DivergedFunctionCount, AMP::Solver::SolverStrategy::DivergedLineSearch, AMP::Solver::SolverStrategy::DivergedNestedSolver, AMP::Solver::SolverStrategy::DivergedOnNan, AMP::Solver::SolverStrategy::DivergedStepSize, and AMP::Solver::SolverStrategy::MaxIterations.
Referenced by AMP::Solver::SolverStrategy::getConvergenceStatusString().
|
inlineoverridevirtual |
Return the name of the solver.
Implements AMP::Solver::SolverStrategy.
Definition at line 86 of file TrilinosMueLuSolver.h.
Definition at line 295 of file SolverStrategy.h.
build the hierarchy using the defaults constructed by MueLu
Definition at line 183 of file TrilinosMueLuSolver.h.
Definition at line 294 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::setIsNestedSolver().
set to true if the solver is yet to be initialized
Definition at line 184 of file TrilinosMueLuSolver.h.
whether we are using Epetra
Definition at line 176 of file TrilinosMueLuSolver.h.
|
private |
whether to explicitly build the hierarchy
Definition at line 177 of file TrilinosMueLuSolver.h.
Definition at line 175 of file TrilinosMueLuSolver.h.
Definition at line 292 of file SolverStrategy.h.
Referenced by AMP::Solver::OnePointSolver::apply(), and AMP::Solver::SolverStrategy::setZeroInitialGuess().
|
private |
use a direct solver if the MG solve fails to converge
Definition at line 186 of file TrilinosMueLuSolver.h.
|
protectedinherited |
Definition at line 276 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getConverged(), AMP::Solver::SolverStrategy::getConvergenceStatus(), and AMP::Solver::SolverStrategy::getConvergenceStatusString().
|
protectedinherited |
Definition at line 287 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getAbsoluteTolerance(), and AMP::Solver::SolverStrategy::setAbsoluteTolerance().
|
protectedinherited |
Definition at line 304 of file SolverStrategy.h.
|
protectedinherited |
Definition at line 285 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getInitialResidual().
|
protectedinherited |
Definition at line 288 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getRelativeTolerance(), and AMP::Solver::SolverStrategy::setRelativeTolerance().
|
protectedinherited |
Definition at line 284 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getResidualNorm().
|
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().
factory manager for MueLu components
Definition at line 204 of file TrilinosMueLuSolver.h.
|
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.
|
protectedinherited |
Definition at line 290 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getDebugPrintInfoLevel(), and AMP::Solver::SolverStrategy::setDebugPrintInfoLevel().
|
staticprotectedinherited |
Definition at line 299 of file SolverStrategy.h.
|
protectedinherited |
Definition at line 282 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getMaxIterations(), and AMP::Solver::SolverStrategy::setMaxIterations().
|
protectedinherited |
Definition at line 280 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getIterations().
|
protectedinherited |
Definition at line 297 of file SolverStrategy.h.
|
protectedinherited |
keeps track of iteration statistics over solver lifetime
Definition at line 302 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getIterationHistory().
|
private |
factory manager for MueLu components by level
Definition at line 206 of file TrilinosMueLuSolver.h.
|
private |
Definition at line 194 of file TrilinosMueLuSolver.h.
|
private |
Definition at line 188 of file TrilinosMueLuSolver.h.
|
protectedinherited |
memory storage address space
Definition at line 327 of file SolverStrategy.h.
|
private |
AMG hierarchy.
Definition at line 201 of file TrilinosMueLuSolver.h.
|
private |
manager that creates hierarchy
Definition at line 198 of file TrilinosMueLuSolver.h.
|
private |
Definition at line 195 of file TrilinosMueLuSolver.h.
|
private |
key for creating different smoothers
Definition at line 192 of file TrilinosMueLuSolver.h.
Referenced by getMLSolver().
|
protectedinherited |
Definition at line 314 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getFunctionScaling(), and AMP::Solver::SolverStrategy::setComponentScalings().
|
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().
|
protectedinherited |
Definition at line 316 of file SolverStrategy.h.
|
protectedinherited |
Definition at line 313 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::getSolutionScaling(), and AMP::Solver::SolverStrategy::setComponentScalings().
|
private |
maximum number of levels
Definition at line 190 of file TrilinosMueLuSolver.h.
|
protectedinherited |
Definition at line 278 of file SolverStrategy.h.
|
protectedinherited |
Definition at line 321 of file SolverStrategy.h.
Referenced by AMP::Solver::SolverStrategy::registerWriter().
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:45. Comments on this page |