46#ifndef MUELU_REFMAXWELLSMOOTHER_DEF_HPP
47#define MUELU_REFMAXWELLSMOOTHER_DEF_HPP
51#include <Teuchos_ParameterList.hpp>
53#include <Xpetra_CrsMatrix.hpp>
54#include <Xpetra_Matrix.hpp>
55#include <Xpetra_MultiVectorFactory.hpp>
65 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
69 const bool solverSupported = (
type_ ==
"RefMaxwell");
75 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
80 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
82 this->
Input(currentLevel,
"A");
83 this->
Input(currentLevel,
"D0");
84 this->
Input(currentLevel,
"M1");
85 this->
Input(currentLevel,
"Ms");
86 this->
Input(currentLevel,
"M0inv");
87 this->
Input(currentLevel,
"Coordinates");
90 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
100 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
103 using coordinateType =
typename Teuchos::ScalarTraits<Scalar>::coordinateType;
104 using RealValuedMultiVector = Xpetra::MultiVector<coordinateType,LO,GO,NO>;
106 auto SM = currentLevel.
Get<RCP<Matrix> >(
"A");
107 auto D0 = currentLevel.
Get<RCP<Matrix> >(
"D0");
108 auto M1 = currentLevel.
Get<RCP<Matrix> >(
"M1");
109 auto Ms = currentLevel.
Get<RCP<Matrix> >(
"Ms");
110 auto M0inv = currentLevel.
Get<RCP<Matrix> >(
"M0inv");
111 auto coords = currentLevel.
Get<RCP<RealValuedMultiVector> >(
"Coordinates");
115 Teuchos::null, coords,
117 std::ostringstream oss;
118 op_->describe(*Teuchos::fancyOStream(Teuchos::rcpFromRef(oss)));
122 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
126 if (InitialGuessIsZero) {
132 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
139 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
141 std::ostringstream out;
143 out <<
op_->description();
144 out << std::endl << std::endl;
152 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
157 out0 <<
"Parameter list: " << std::endl;
158 Teuchos::OSTab tab2(out);
163 if (
op_ != Teuchos::null) {
164 Teuchos::OSTab tab2(out);
165 out << *
op_ << std::endl << std::endl;
176 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
178 return Teuchos::OrdinalTraits<size_t>::invalid();
#define MUELU_DESCRIBE
Helper macro for implementing Describable::describe() for BaseClass objects.
Exception throws to report errors in the internal logical of the program.
Timer to be used in factories. Similar to Monitor but with additional timers.
void Input(Level &level, const std::string &varName) const
Class that holds all level-specific information.
T & Get(const std::string &ename, const FactoryBase *factory=NoFactory::get())
Get data without decrementing associated storage counter (i.e., read-only access)....
virtual const Teuchos::ParameterList & GetParameterList() const
virtual void SetParameterList(const Teuchos::ParameterList ¶mList)=0
Set parameters from a parameter list and return with default values.
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
void SetupRefMaxwell(Level ¤tLevel)
void Setup(Level ¤tLevel)
Set up the smoother.
std::string cachedDescription_
RCP< Operator > op_
matrix, used in apply if solving residual equation
void SetParameterList(const Teuchos::ParameterList ¶mList)
Set parameters from a parameter list and return with default values.
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
void DeclareInput(Level ¤tLevel) const
Input.
RefMaxwellSmoother(const std::string type, const Teuchos::ParameterList ¶mList)
Constructor.
std::string description() const
Return a simple one-line description of this object.
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply the preconditioner.
RCP< SmootherPrototype > Copy() const
Preconditioner (wrapped as a Xpetra::Operator) for Maxwell's equations in curl-curl form.
void declareConstructionOutcome(bool fail, std::string msg)
bool IsSetup() const
Get the state of a smoother prototype.
Teuchos::FancyOStream & GetOStream(MsgType type, int thisProcRankOnly=0) const
Get an output stream for outputting the input message type.
Namespace for MueLu classes and methods.
@ Statistics1
Print more statistics.
@ External
Print external lib objects.
@ Parameters1
Print class parameters (more parameters, more verbose).