MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_MergedSmoother_decl.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_MERGEDSMOOTHER_DECL_HPP
11 #define MUELU_MERGEDSMOOTHER_DECL_HPP
12 
13 #include "MueLu_ConfigDefs.hpp"
15 #include "MueLu_SmootherPrototype.hpp"
16 
21 namespace MueLu {
22 
23 class Level;
24 
25 template <class Scalar = SmootherPrototype<>::scalar_type,
26  class LocalOrdinal = typename SmootherPrototype<Scalar>::local_ordinal_type,
27  class GlobalOrdinal = typename SmootherPrototype<Scalar, LocalOrdinal>::global_ordinal_type,
28  class Node = typename SmootherPrototype<Scalar, LocalOrdinal, GlobalOrdinal>::node_type>
29 class MergedSmoother : public SmootherPrototype<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
30 #undef MUELU_MERGEDSMOOTHER_SHORT
31 #include "MueLu_UseShortNames.hpp"
32 
33  public:
35 
36 
38  MergedSmoother(ArrayRCP<RCP<SmootherPrototype> >& smootherList, bool verbose = false);
39 
41  MergedSmoother(const MergedSmoother& src);
42 
45 
47  virtual ~MergedSmoother() {}
49 
51 
52 
53  void StandardOrder() { reverseOrder_ = false; }
54  void ReverseOrder() { reverseOrder_ = true; }
55 
56  // TODO: GetOrder() is a better name (+ enum to define order)
57  bool GetReverseOrder() const { return reverseOrder_; }
58 
59  // TODO const ArrayRCP<const RCP<const SmootherPrototype> > & GetSmootherList() const;
61 
63 
64  void DeclareInput(Level& currentLevel) const;
65 
67 
68 
70  void Setup(Level& level);
71 
80  void Apply(MultiVector& X, const MultiVector& B, bool InitialGuessIsZero = false) const;
81 
83 
85  void SetFactory(const std::string& varName, const RCP<const FactoryBase>& factory);
86 
87  void print(Teuchos::FancyOStream& out, const VerbLevel verbLevel = Default) const;
88 
89  void CopyParameters(RCP<SmootherPrototype> src); // TODO: wrong prototype. We do not need an RCP here.
90 
92 
94  size_t getNodeSmootherComplexity() const;
95 
97 
98  private:
99  // List of smoothers. It is an ArrayRCP of RCP because:
100  // 1) I need a vector of pointers (to avoid slicing problems)
101  // 2) I can use an std::vector insead of an ArrayRCP but then the constructor will do a copy of user input
103 
104  //
106 
107  // tmp, for debug
108  bool verbose_;
109 
110 }; // class MergedSmoother
111 
112 } // namespace MueLu
113 
114 #define MUELU_MERGEDSMOOTHER_SHORT
115 #endif // MUELU_MERGEDSMOOTHER_DECL_HPP
RCP< SmootherPrototype > Copy() const
Copy method (performs a deep copy of input object)
MueLu::DefaultLocalOrdinal LocalOrdinal
ArrayRCP< RCP< SmootherPrototype > > smootherList_
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
Base class for smoother prototypes.
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply.
MueLu::DefaultNode Node
void DeclareInput(Level &currentLevel) const
Input.
void CopyParameters(RCP< SmootherPrototype > src)
MueLu::DefaultGlobalOrdinal GlobalOrdinal
Class that holds all level-specific information.
Definition: MueLu_Level.hpp:63
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
ArrayRCP< RCP< SmootherPrototype > > SmootherListDeepCopy(const ArrayRCP< const RCP< SmootherPrototype > > &srcSmootherList)
const ArrayRCP< const RCP< SmootherPrototype > > GetSmootherList() const
void SetFactory(const std::string &varName, const RCP< const FactoryBase > &factory)
Custom SetFactory.
MergedSmoother(ArrayRCP< RCP< SmootherPrototype > > &smootherList, bool verbose=false)
Constructor.
virtual ~MergedSmoother()
Destructor.
void Setup(Level &level)
Set up.