MueLu Version of the Day
Loading...
Searching...
No Matches
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
21namespace MueLu {
22
23class Level;
24
25template <class Scalar = SmootherPrototype<>::scalar_type,
29class MergedSmoother : public SmootherPrototype<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
30#undef MUELU_MERGEDSMOOTHER_SHORT
32
33 public:
35
36
38 MergedSmoother(ArrayRCP<RCP<SmootherPrototype> >& smootherList, bool verbose = false);
39
42
44 RCP<SmootherPrototype> Copy() const;
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;
60 const ArrayRCP<const RCP<SmootherPrototype> > GetSmootherList() const { return smootherList_; }
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
91 ArrayRCP<RCP<SmootherPrototype> > SmootherListDeepCopy(const ArrayRCP<const RCP<SmootherPrototype> >& srcSmootherList);
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
102 ArrayRCP<RCP<SmootherPrototype> > smootherList_;
103
104 //
106
107 // tmp, for debug
109
110}; // class MergedSmoother
111
112} // namespace MueLu
113
114#define MUELU_MERGEDSMOOTHER_SHORT
115#endif // MUELU_MERGEDSMOOTHER_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Class that holds all level-specific information.
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
RCP< SmootherPrototype > Copy() const
Copy method (performs a deep copy of input object)
virtual ~MergedSmoother()
Destructor.
void DeclareInput(Level &currentLevel) const
Input.
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
ArrayRCP< RCP< SmootherPrototype > > smootherList_
ArrayRCP< RCP< SmootherPrototype > > SmootherListDeepCopy(const ArrayRCP< const RCP< SmootherPrototype > > &srcSmootherList)
void Setup(Level &level)
Set up.
void SetFactory(const std::string &varName, const RCP< const FactoryBase > &factory)
Custom SetFactory.
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply.
void CopyParameters(RCP< SmootherPrototype > src)
const ArrayRCP< const RCP< SmootherPrototype > > GetSmootherList() const
Base class for smoother prototypes.
Namespace for MueLu classes and methods.