MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_SmootherBase.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // MueLu: A package for multigrid based preconditioning
4 //
5 // Copyright 2012 NTESS and the MueLu contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef MUELU_SMOOTHERBASE_HPP
11 #define MUELU_SMOOTHERBASE_HPP
12 
13 #include "Xpetra_MultiVector.hpp"
14 
15 #include "MueLu_ConfigDefs.hpp"
16 #include "MueLu_BaseClass.hpp"
17 
18 namespace MueLu {
28 template <class Scalar = DefaultScalar,
31  class Node = DefaultNode>
32 class SmootherBase : public virtual BaseClass {
33  public:
37  typedef Node node_type;
38 
39  private:
40 #undef MUELU_SMOOTHERBASE_SHORT
41 #include "MueLu_UseShortNames.hpp"
42 
43  public:
46 
47  virtual ~SmootherBase() {}
49 
51 
52 
54  virtual void Apply(MultiVector& x, const MultiVector& rhs, bool InitialGuessIsZero = false) const = 0;
55 
57  virtual size_t getNodeSmootherComplexity() const = 0;
58 
59  void declareConstructionOutcome(bool fail, std::string msg) {
61  if (!fail)
63  else
65  };
67  std::string constructionErrorMsg() { return constructionErrorMsg_; }
68 
70 
71  private:
73  std::string constructionErrorMsg_;
74 
75 }; // class SmootherBase
76 } // namespace MueLu
77 
78 #define MUELU_SMOOTHERBASE_SHORT
79 
80 #endif // ifndef MUELU_SMOOTHERBASE_HPP
81 
82 // SmootherBase = Interface used by Hierarchy.Iterate(). Minimal condition to be used as smoother.
83 // SmootherPrototype = minimal interface used by the generic SmootherFactory.
84 // Note that one can implements and use his own SmootherFactory. In this case, SmootherBase is enough.
85 // AdvSmootherPrototype = for more complex case of reusing setup between presmoother and postsmoother
GlobalOrdinal global_ordinal_type
MueLu::DefaultLocalOrdinal LocalOrdinal
LocalOrdinal local_ordinal_type
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
virtual size_t getNodeSmootherComplexity() const =0
Compute a rough estimate of the cost to apply this smoother on this MPI rank. Return Teuchos::Ordinal...
std::string constructionErrorMsg_
MueLu::DefaultNode Node
MueLu::DefaultScalar Scalar
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
void declareConstructionOutcome(bool fail, std::string msg)
std::string constructionErrorMsg()
Base class for smoothers.
Base class for MueLu classes.
virtual void Apply(MultiVector &x, const MultiVector &rhs, bool InitialGuessIsZero=false) const =0
Apply smoother.