MueLu
Version of the Day
Toggle main menu visibility
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
"
14
#include "
MueLu_MergedSmoother_fwd.hpp
"
15
#include "MueLu_SmootherPrototype.hpp"
16
20
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
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
//
105
bool
reverseOrder_
;
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
MueLu_ConfigDefs.hpp
MueLu_MergedSmoother_fwd.hpp
LocalOrdinal
MueLu::DefaultLocalOrdinal LocalOrdinal
Definition
MueLu_UseDefaultTypes.hpp:13
GlobalOrdinal
MueLu::DefaultGlobalOrdinal GlobalOrdinal
Definition
MueLu_UseDefaultTypes.hpp:14
Node
MueLu::DefaultNode Node
Definition
MueLu_UseDefaultTypes.hpp:15
MueLu_UseShortNames.hpp
MueLu::Level
Class that holds all level-specific information.
Definition
MueLu_Level.hpp:63
MueLu::MergedSmoother::getNodeSmootherComplexity
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
Definition
MueLu_MergedSmoother_def.hpp:179
MueLu::MergedSmoother::Copy
RCP< SmootherPrototype > Copy() const
Copy method (performs a deep copy of input object).
Definition
MueLu_MergedSmoother_def.hpp:161
MueLu::MergedSmoother::~MergedSmoother
virtual ~MergedSmoother()
Destructor.
Definition
MueLu_MergedSmoother_decl.hpp:47
MueLu::MergedSmoother::DeclareInput
void DeclareInput(Level ¤tLevel) const
Input.
Definition
MueLu_MergedSmoother_def.hpp:44
MueLu::MergedSmoother::StandardOrder
void StandardOrder()
Definition
MueLu_MergedSmoother_decl.hpp:53
MueLu::MergedSmoother::ReverseOrder
void ReverseOrder()
Definition
MueLu_MergedSmoother_decl.hpp:54
MueLu::MergedSmoother::print
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Definition
MueLu_MergedSmoother_def.hpp:92
MueLu::MergedSmoother::verbose_
bool verbose_
Definition
MueLu_MergedSmoother_decl.hpp:108
MueLu::MergedSmoother::smootherList_
ArrayRCP< RCP< SmootherPrototype > > smootherList_
Definition
MueLu_MergedSmoother_decl.hpp:102
MueLu::MergedSmoother::SmootherListDeepCopy
ArrayRCP< RCP< SmootherPrototype > > SmootherListDeepCopy(const ArrayRCP< const RCP< SmootherPrototype > > &srcSmootherList)
Definition
MueLu_MergedSmoother_def.hpp:168
MueLu::MergedSmoother::Setup
void Setup(Level &level)
Set up.
Definition
MueLu_MergedSmoother_def.hpp:50
MueLu::MergedSmoother::reverseOrder_
bool reverseOrder_
Definition
MueLu_MergedSmoother_decl.hpp:105
MueLu::MergedSmoother::SetFactory
void SetFactory(const std::string &varName, const RCP< const FactoryBase > &factory)
Custom SetFactory.
Definition
MueLu_MergedSmoother_def.hpp:37
MueLu::MergedSmoother::Apply
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply.
Definition
MueLu_MergedSmoother_def.hpp:69
MueLu::MergedSmoother::MergedSmoother
MergedSmoother(ArrayRCP< RCP< SmootherPrototype > > &smootherList, bool verbose=false)
Constructor.
Definition
MueLu_MergedSmoother_def.hpp:19
MueLu::MergedSmoother::CopyParameters
void CopyParameters(RCP< SmootherPrototype > src)
Definition
MueLu_MergedSmoother_def.hpp:97
MueLu::MergedSmoother::GetSmootherList
const ArrayRCP< const RCP< SmootherPrototype > > GetSmootherList() const
Definition
MueLu_MergedSmoother_decl.hpp:60
MueLu::MergedSmoother::GetReverseOrder
bool GetReverseOrder() const
Definition
MueLu_MergedSmoother_decl.hpp:57
MueLu::SmootherPrototype::node_type
Node node_type
Definition
MueLu_SmootherPrototype_decl.hpp:44
MueLu::SmootherPrototype::SmootherPrototype
SmootherPrototype()
@nameConstructors/Destructors.
Definition
MueLu_SmootherPrototype_def.hpp:18
MueLu::SmootherPrototype::global_ordinal_type
GlobalOrdinal global_ordinal_type
Definition
MueLu_SmootherPrototype_decl.hpp:43
MueLu::SmootherPrototype::local_ordinal_type
LocalOrdinal local_ordinal_type
Definition
MueLu_SmootherPrototype_decl.hpp:42
MueLu
Namespace for MueLu classes and methods.
Definition
MueLu_BrickAggregationFactory_decl.hpp:42
MueLu::VerbLevel
int VerbLevel
Definition
MueLu_VerbosityLevel.hpp:76
MueLu::Default
@ Default
Definition
MueLu_VerbosityLevel.hpp:70
src
Smoothers
MueLu_MergedSmoother_decl.hpp
Generated by
1.17.0