50 #if defined(HAVE_MUELU_EPETRA) && defined(HAVE_MUELU_AMESOS) 52 #include <Epetra_LinearProblem.h> 54 #include <Amesos_config.h> 61 #include "MueLu_Utilities.hpp" 73 std::transform(
type_.begin(), ++
type_.begin(),
type_.begin(), ::toupper);
77 if (
type_ ==
"Amesos_umfpack")
type_ =
"Umfpack";
78 if (
type_ ==
"Superlu_dist")
type_ =
"Superludist";
84 std::string oldtype =
type_;
86 #if defined(HAVE_AMESOS_SUPERLU) 88 #elif defined(HAVE_AMESOS_KLU) 90 #elif defined(HAVE_AMESOS_SUPERLUDIST) 91 type_ =
"Superludist";
92 #elif defined(HAVE_AMESOS_UMFPACK) 95 throw Exceptions::RuntimeError(
"Amesos has been compiled without SuperLU_DIST, SuperLU, Umfpack or Klu. By default, MueLu tries" 96 "to use one of these libraries. Amesos must be compiled with one of these solvers, " 97 "or a valid Amesos solver has to be specified explicitly.");
100 this->
GetOStream(
Warnings0) <<
"MueLu::AmesosSmoother: \"" << oldtype <<
"\" is not available. Using \"" <<
type_ <<
"\" instead" << std::endl;
109 Input(currentLevel,
"A");
116 GetOStream(
Warnings0) <<
"MueLu::AmesosSmoother::Setup(): Setup() has already been called" << std::endl;
118 A_ = Get< RCP<Matrix> >(currentLevel,
"A");
130 if (
A_->getRowMap()->isDistributed() ==
true &&
A_->getRowMap()->isContiguous() ==
false)
136 prec_->SetParameters(*precList);
138 const_cast<ParameterList&
>(paramList).setParameters(*precList);
140 int r =
prec_->NumericFactorization();
141 TEUCHOS_TEST_FOR_EXCEPTION(r != 0,
Exceptions::RuntimeError,
"MueLu::AmesosSmoother::Setup(): Amesos solver returns value of " +
154 Epetra_MultiVector &nonconstB =
const_cast<Epetra_MultiVector&
>(epB);
171 std::ostringstream out;
173 out <<
"{type = " <<
type_ <<
"}";
182 out0 <<
"Prec. type: " <<
type_ << std::endl;
185 out0 <<
"Parameter list: " << std::endl;
186 Teuchos::OSTab tab2(out);
191 if (
prec_ != Teuchos::null) {
192 prec_->PrintStatus();
193 prec_->PrintTiming();
196 if (verbLevel &
Debug) {
199 <<
"RCP<A_>: " <<
A_ << std::endl
201 <<
"RCP<prec_>: " <<
prec_ << std::endl;
207 #endif // HAVE_MUELU_EPETRA && HAVE_MUELU_AMESOS void DeclareInput(Level ¤tLevel) const
Input.
Important warning messages (one line)
RCP< Epetra_LinearProblem > linearProblem_
Problem that Amesos uses internally.
static RCP< Epetra_MultiVector > MV2NonConstEpetraMV(RCP< MultiVector > Vec)
std::string toString(const T &what)
Little helper function to convert non-string types to strings.
Print external lib objects.
Timer to be used in factories. Similar to Monitor but with additional timers.
void Setup(Level ¤tLevel)
Set up the direct solver. This creates the underlying Amesos solver object according to the parameter...
Print additional debugging information.
AmesosSmoother(const std::string &type="", const Teuchos::ParameterList ¶mList=Teuchos::ParameterList())
Constructor.
std::string type_
amesos-specific key phrase that denote smoother type
Namespace for MueLu classes and methods.
virtual const Teuchos::ParameterList & GetParameterList() const
RCP< Matrix > A_
Matrix. Not used directly, but held inside of linearProblem_. So we have to keep an RCP pointer to it...
RCP< Amesos_BaseSolver > prec_
pointer to Amesos solver object
static RCP< const Epetra_MultiVector > MV2EpetraMV(RCP< MultiVector > const Vec)
Helper utility to pull out the underlying Epetra objects from an Xpetra object.
RCP< ParameterList > RemoveFactoriesFromList(const ParameterList &list) const
virtual void SetParameterList(const ParameterList ¶mList)
Set parameters from a parameter list and return with default values.
Class that holds all level-specific information.
bool IsSetup() const
Get the state of a smoother prototype.
#define MUELU_DESCRIBE
Helper macro for implementing Describable::describe() for BaseClass objects.
std::string description() const
Return a simple one-line description of this object.
Teuchos::FancyOStream & GetOStream(MsgType type, int thisProcRankOnly=0) const
Get an output stream for outputting the input message type.
Amesos_BaseSolver * Create(const char *ClassType, const Epetra_LinearProblem &LinearProblem)
virtual ~AmesosSmoother()
Destructor.
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply the direct solver.
Print class parameters (more parameters, more verbose)
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
Exception throws to report errors in the internal logical of the program.
static RCP< Epetra_CrsMatrix > Op2NonConstEpetraCrs(RCP< Matrix > Op)
Description of what is happening (more verbose)
void Input(Level &level, const std::string &varName) const
RCP< SmootherPrototype > Copy() const
virtual std::string description() const
Return a simple one-line description of this object.
bool Query(const char *ClassType)