1#ifndef included_AMP_TrilinosMueLuSolver
2#define included_AMP_TrilinosMueLuSolver
4#include "AMP/matrices/trilinos/ManagedEpetraMatrix.h"
5#include "AMP/solvers/SolverStrategy.h"
6#include "AMP/solvers/SolverStrategyParameters.h"
7#include "AMP/solvers/trilinos/ml/MLoptions.h"
11#include "MueLu_FactoryManager.hpp"
12#include "MueLu_HierarchyManager_fwd.hpp"
13#include "Teuchos_ParameterList.hpp"
14#include "Xpetra_Matrix.hpp"
15#include "Xpetra_Operator_fwd.hpp"
16#include "Xpetra_Parameters.hpp"
24template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
26template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
28template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
30template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
32template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
34template<
typename Scalar,
typename LocalOrdinal,
typename GlobalOrdinal,
typename Node>
40using Node = Xpetra::EpetraNode;
86 std::string
type()
const override {
return "TrilinosMueLuSolver"; }
89 static std::unique_ptr<SolverStrategy>
100 void apply( std::shared_ptr<const AMP::LinearAlgebra::Vector> f,
101 std::shared_ptr<AMP::LinearAlgebra::Vector>
u )
override;
109 std::shared_ptr<AMP::LinearAlgebra::Vector>
u );
125 void initialize( std::shared_ptr<const SolverStrategyParameters> parameters )
override;
138 void resetOperator( std::shared_ptr<const AMP::Operator::OperatorParameters> params )
override;
148 void reset( std::shared_ptr<SolverStrategyParameters> params )
override;
152 std::shared_ptr<AMP::LinearAlgebra::Vector>
u );
194 std::shared_ptr<AMP::LinearAlgebra::ManagedEpetraMatrix>
d_matrix;
Provides C++ wrapper around MPI routines.
std::shared_ptr< AMP::Solver::SolverStrategy > shared_ptr
Teuchos::ParameterList d_MueLuParameterList
Teuchos::RCP< MueLu::Hierarchy< SC, LO, GO, NO > > d_mueluHierarchy
AMG hierarchy.
std::shared_ptr< AMP::LinearAlgebra::ManagedEpetraMatrix > d_matrix
Teuchos::RCP< MueLu::SaPFactory< SC, LO, GO, NO > > getSaPFactory(void)
bool d_build_hierarchy_from_defaults
whether to explicitly build the hierarchy
TrilinosMueLuSolver(std::shared_ptr< TrilinosMueLuSolverParameters > parameters)
bool d_build_hierarchy
whether we are using Epetra
void buildHierarchyByLevel(void)
build the hierarchy level by level, potentially customizing each level
Teuchos::RCP< MueLu::SmootherFactory< SC, LO, GO, NO > > getSmootherFactory(const int level)
bool d_bCreationPhase
build the hierarchy using the defaults constructed by MueLu
void resetOperator(std::shared_ptr< const AMP::Operator::OperatorParameters > params) override
MueLu::MsgType getVerbosityLevel()
void registerOperator(std::shared_ptr< AMP::Operator::Operator > op) override
std::string d_smoother_type
maximum number of levels
void solveWithHierarchy(std::shared_ptr< const AMP::LinearAlgebra::Vector > f, std::shared_ptr< AMP::LinearAlgebra::Vector > u)
AMP_MPI d_comm
use a direct solver if the MG solve fails to converge
Teuchos::RCP< MueLu::HierarchyManager< SC, LO, GO, NO > > d_mueluHierarchyManager
manager that creates hierarchy
Teuchos::RCP< Xpetra::Matrix< SC, LO, GO, NO > > getXpetraMatrix()
utility function to extract Xpetra Matrix from AMP LinearOperator
std::shared_ptr< MueLu::EpetraOperator > d_mueluSolver
key for creating different smoothers
Teuchos::RCP< MueLu::SmootherFactory< SC, LO, GO, NO > > getCoarseSolverFactory(void)
std::vector< Teuchos::RCP< MueLu::FactoryManager< SC, LO, GO, NO > > > d_levelFactoryManager
factory manager for MueLu components by level
Teuchos::ParameterList & getSmootherParameters(const int level)
static std::unique_ptr< SolverStrategy > createSolver(std::shared_ptr< SolverStrategyParameters > solverStrategyParameters)
static create routine that is used by SolverFactory
void reset(std::shared_ptr< SolverStrategyParameters > params) override
void reSolveWithLU(std::shared_ptr< const AMP::LinearAlgebra::Vector > f, std::shared_ptr< AMP::LinearAlgebra::Vector > u)
void buildHierarchyFromDefaults(void)
build the hierarchy using the defaults constructed by MueLu
void initialize(std::shared_ptr< const SolverStrategyParameters > parameters) override
MueLu::FactoryManager< SC, LO, GO, NO > d_factoryManager
factory manager for MueLu components
Teuchos::RCP< MueLu::TransPFactory< SC, LO, GO, NO > > getRFactory(void)
Teuchos::RCP< MueLu::TentativePFactory< SC, LO, GO, NO > > getTentativePFactory(void)
std::string type() const override
Return the name of the solver.
void getFromInput(std::shared_ptr< const AMP::Database > db)
std::shared_ptr< MueLu::EpetraOperator > getMLSolver(void)
virtual ~TrilinosMueLuSolver()
bool d_bRobustMode
set to true if the solver is yet to be initialized
void apply(std::shared_ptr< const AMP::LinearAlgebra::Vector > f, std::shared_ptr< AMP::LinearAlgebra::Vector > u) override
#define DISABLE_WARNINGS
Re-enable warnings.
#define ENABLE_WARNINGS
Suppress all warnings.