46 #ifndef MUELU_MERGEDSMOOTHER_DEF_HPP
47 #define MUELU_MERGEDSMOOTHER_DEF_HPP
54 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
56 : smootherList_(smootherList), reverseOrder_(false), verbose_(verbose) {
62 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
64 : reverseOrder_(src.reverseOrder_), verbose_(src.verbose_) {
69 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
73 (*it)->SetFactory(varName, factory);
77 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
80 (*it)->DeclareInput(currentLevel);
83 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
86 this->GetOStream(
Warnings0) <<
"MueLu::MergedSmoother::Setup(): Setup() has already been called";
93 std::string msg =
"MueLu::MergedSmoother<>::Setup(): Runtime Error.\n One of the underlying smoother throwed the following exception: \n";
102 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
107 sz_t n = smootherList_.
size(), c = (reverseOrder_ ? n-1 : 0);
108 char d = (reverseOrder_ ? -1 : 1);
110 for (sz_t i = 0; i < n; i++)
113 smootherList_[c + d*Teuchos::as<char>(i)]->Apply(X, B, InitialGuessIsZero);
116 InitialGuessIsZero =
false;
119 std::string msg =
"MueLu::MergedSmoother<>::Apply(): Runtime Error. One of the underlying smoothers throws the following exception: \n";
125 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
130 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
140 "MueLu::MergedSmoother<>:CopyParameters(): thisSmootherList == Teuchos::null");
151 reuse = reuse && (thisSmootherList.
size() == srcSmootherList.
size());
159 "MueLu::MergedSmoother<>:CopyParameters(): internal logic error");
174 if (srcSmootherList[i] != Teuchos::null) {
178 isSetup = isSetup && thisSmootherList[i]->IsSetup();
185 smootherList_ = Teuchos::null;
186 smootherList_ = SmootherListDeepCopy(srcSmootherList);
193 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
201 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
209 newSmootherList[i] = srcSmootherList[i]->
Copy();
211 return newSmootherList;
215 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
225 #endif // MUELU_MERGEDSMOOTHER_DEF_HPP