MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_SimpleSmoother_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_SIMPLESMOOTHER_DECL_HPP_
11#define MUELU_SIMPLESMOOTHER_DECL_HPP_
12
13#include "MueLu_ConfigDefs.hpp"
14
15#include <Teuchos_ParameterList.hpp>
16
17// Xpetra
18#include <Xpetra_MapExtractor_fwd.hpp>
19#include <Xpetra_MultiVectorFactory_fwd.hpp>
20#include <Xpetra_Matrix_fwd.hpp>
21
22// MueLu
24#include "MueLu_SmootherPrototype.hpp"
29
32
33namespace MueLu {
34
41template <class Scalar = SmootherPrototype<>::scalar_type,
45class SimpleSmoother : public SmootherPrototype<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
46 typedef Xpetra::MapExtractor<Scalar, LocalOrdinal, GlobalOrdinal, Node> MapExtractorClass;
47
48#undef MUELU_SIMPLESMOOTHER_SHORT
50
51 public:
53
54
57
59 virtual ~SimpleSmoother();
60
62
64
65
66 RCP<const ParameterList> GetValidParameterList() const;
67
68 void DeclareInput(Level &currentLevel) const;
69
72 void SetVelocityPredictionFactoryManager(RCP<FactoryManager> FactManager);
73
76 void SetSchurCompFactoryManager(RCP<FactoryManager> FactManager);
77
79 void AddFactoryManager(RCP<const FactoryManagerBase> FactManager, int pos);
80
82
84
85
95 void Setup(Level &currentLevel);
96
102 void Apply(MultiVector &X, MultiVector const &B, bool InitialGuessIsZero = false) const;
104
105 RCP<SmootherPrototype> Copy() const;
106
108
109
111 std::string description() const;
112
114 // using MueLu::Describable::describe; // overloading, not hiding
115 void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel = Default) const;
116
118 size_t getNodeSmootherComplexity() const;
119
121
122 private:
124 std::string type_;
125
127 RCP<const FactoryBase> AFact_;
128
130 RCP<Matrix> A_;
131
133 RCP<const MapExtractorClass> rangeMapExtractor_;
134
136 RCP<const MapExtractorClass> domainMapExtractor_;
137
140
142 Teuchos::RCP<Vector> diagFinv_;
143
145 Teuchos::RCP<Matrix> F_;
146
148 Teuchos::RCP<Matrix> G_;
149
151 Teuchos::RCP<Matrix> D_;
152
154 Teuchos::RCP<Matrix> Z_;
155
157
159 Teuchos::RCP<SmootherBase> velPredictSmoo_;
160
162 Teuchos::RCP<SmootherBase> schurCompSmoo_;
163
169 std::vector<Teuchos::RCP<const FactoryManagerBase> > FactManager_;
170};
171
172} // namespace MueLu
173
174#define MUELU_SIMPLESMOOTHER_SHORT
175
176#endif /* MUELU_SIMPLESMOOTHER_DECL_HPP_ */
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Class that holds all level-specific information.
SIMPLE smoother for 2x2 block matrices.
RCP< Matrix > A_
Internal blocked operator "A" generated by AFact_.
void SetVelocityPredictionFactoryManager(RCP< FactoryManager > FactManager)
void Setup(Level &currentLevel)
Setup routine.
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
std::string description() const
Return a simple one-line description of this object.
RCP< const FactoryBase > AFact_
void DeclareInput(Level &currentLevel) const
Input.
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
Teuchos::RCP< Matrix > Z_
Pressure stabilization term or null block.
RCP< const ParameterList > GetValidParameterList() const
Input.
std::vector< Teuchos::RCP< const FactoryManagerBase > > FactManager_
Vector of internal factory managers.
Teuchos::RCP< Matrix > D_
Divergence operator.
std::string type_
smoother type
virtual ~SimpleSmoother()
Destructor.
RCP< SmootherPrototype > Copy() const
Xpetra::MapExtractor< Scalar, LocalOrdinal, GlobalOrdinal, Node > MapExtractorClass
void AddFactoryManager(RCP< const FactoryManagerBase > FactManager, int pos)
Add a factory manager at a specific position.
Teuchos::RCP< SmootherBase > schurCompSmoo_
Smoother for SchurComplement equation.
void Apply(MultiVector &X, MultiVector const &B, bool InitialGuessIsZero=false) const
Apply the Braess Sarazin smoother.
Teuchos::RCP< Matrix > G_
Pressure gradient operator.
Teuchos::RCP< SmootherBase > velPredictSmoo_
Smoother for velocity prediction.
RCP< const MapExtractorClass > rangeMapExtractor_
Range map extractor (from A_ generated by AFact)
Teuchos::RCP< Matrix > F_
Fluid operator.
Teuchos::RCP< Vector > diagFinv_
Inverse diagonal of fluid operator (vector).
void SetSchurCompFactoryManager(RCP< FactoryManager > FactManager)
RCP< const MapExtractorClass > domainMapExtractor_
Domain map extractor (from A_ generated by AFact)
Base class for smoother prototypes.
Namespace for MueLu classes and methods.