10 #ifndef MUELU_REFMAXWELLSMOOTHER_DEF_HPP
11 #define MUELU_REFMAXWELLSMOOTHER_DEF_HPP
19 #include <Xpetra_MultiVectorFactory.hpp>
27 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
30 const bool solverSupported = (
type_ ==
"RefMaxwell");
36 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
41 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
46 if (pL.
isType<
int>(
"refmaxwell: space number"))
47 spaceNumber = pL.
get<
int>(
"refmaxwell: space number");
48 this->Input(currentLevel,
"A");
49 this->Input(currentLevel,
"Dk_1");
51 this->Input(currentLevel,
"Dk_2");
52 this->Input(currentLevel,
"D0");
53 this->Input(currentLevel,
"Mk_one");
55 this->Input(currentLevel,
"Mk_1_one");
56 this->Input(currentLevel,
"M1_beta");
58 this->Input(currentLevel,
"M1_alpha");
59 this->Input(currentLevel,
"invMk_1_invBeta");
61 this->Input(currentLevel,
"invMk_2_invAlpha");
62 this->Input(currentLevel,
"Coordinates");
65 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
69 SetupRefMaxwell(currentLevel);
71 this->GetOStream(
Statistics1) << description() << std::endl;
74 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
81 if (params.
isType<
int>(
"refmaxwell: space number"))
82 spaceNumber = params.
get<
int>(
"refmaxwell: space number");
84 RCP<Matrix> SM, Dk_1, Dk_2, D0, Mk_one, Mk_1_one, M1_beta, M1_alpha, invMk_1_invBeta, invMk_2_invAlpha;
97 invMk_1_invBeta = currentLevel.
Get<
RCP<Matrix> >(
"invMk_1_invBeta");
99 invMk_2_invAlpha = currentLevel.
Get<
RCP<Matrix> >(
"invMk_2_invAlpha");
106 invMk_1_invBeta, invMk_2_invAlpha,
107 Teuchos::null, Teuchos::null, coords,
109 std::ostringstream oss;
110 op_->describe(*Teuchos::fancyOStream(Teuchos::rcpFromRef(oss)));
111 cachedDescription_ = oss.str();
114 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
118 if (InitialGuessIsZero) {
124 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
131 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
133 std::ostringstream out;
135 out << op_->description();
145 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
150 out0 <<
"Parameter list: " << std::endl;
152 out << this->GetParameterList();
156 if (op_ != Teuchos::null) {
158 out << *op_ << std::endl
170 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
177 #endif // MUELU_REFMAXWELLSMOOTHER_DEF_HPP
T & Get(const std::string &ename, const FactoryBase *factory=NoFactory::get())
Get data without decrementing associated storage counter (i.e., read-only access). Usage: Level->Get< RCP<Matrix> >("A", factory) if factory == NULL => use default factory.
RefMaxwellSmoother(const std::string type, const Teuchos::ParameterList ¶mList)
Constructor.
RCP< SmootherPrototype > Copy() const
Print external lib objects.
void SetupRefMaxwell(Level ¤tLevel)
T & get(const std::string &name, T def_value)
Timer to be used in factories. Similar to Monitor but with additional timers.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Preconditioner (wrapped as a Xpetra::Operator) for Maxwell's equations in curl-curl form...
virtual void SetParameterList(const Teuchos::ParameterList ¶mList)
Set parameters from a parameter list and return with default values.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void declareConstructionOutcome(bool fail, std::string msg)
Class that holds all level-specific information.
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
bool IsSetup() const
Get the state of a smoother prototype.
Class that encapsulates Operator smoothers.
std::string description() const
Return a simple one-line description of this object.
#define MUELU_DESCRIBE
Helper macro for implementing Describable::describe() for BaseClass objects.
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
void DeclareInput(Level ¤tLevel) const
Input.
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply the preconditioner.
bool isType(const std::string &name) const
Print class parameters (more parameters, more verbose)
Exception throws to report errors in the internal logical of the program.
void SetParameterList(const Teuchos::ParameterList ¶mList)
Set parameters from a parameter list and return with default values.
void Setup(Level ¤tLevel)
Set up the smoother.