MueLu
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
MueLu_TrilinosSmoother_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_TRILINOSSMOOTHER_DECL_HPP
11
#define MUELU_TRILINOSSMOOTHER_DECL_HPP
12
13
#include <Teuchos_ParameterList.hpp>
14
15
#include "
MueLu_ConfigDefs.hpp
"
16
#include "
MueLu_TrilinosSmoother_fwd.hpp
"
17
#include "MueLu_SmootherPrototype.hpp"
18
19
#include "
MueLu_FactoryBase_fwd.hpp
"
20
#include "
MueLu_IfpackSmoother_fwd.hpp
"
21
22
#include "
MueLu_Ifpack2Smoother_fwd.hpp
"
23
#include "MueLu_Ifpack2Smoother.hpp"
24
25
#if defined(HAVE_MUELU_BELOS)
26
#include "
MueLu_BelosSmoother_fwd.hpp
"
27
#endif
28
29
#if defined(HAVE_MUELU_STRATIMIKOS)
30
#include "
MueLu_StratimikosSmoother_fwd.hpp
"
31
#endif
32
33
// Note: TrilinosSmoother is a SmootherPrototype that cannot be turned into a smoother using Setup().
34
// When this prototype is cloned using Copy(), the clone is an Ifpack or an Ifpack2 smoother.
35
// The clone can be used as a smoother after calling Setup().
36
37
namespace
MueLu
{
38
46
47
template <class Scalar = SmootherPrototype<>::scalar_type,
48
class
LocalOrdinal
=
typename
SmootherPrototype<Scalar>::local_ordinal_type
,
49
class
GlobalOrdinal
=
typename
SmootherPrototype<Scalar, LocalOrdinal>::global_ordinal_type
,
50
class
Node
=
typename
SmootherPrototype<Scalar, LocalOrdinal, GlobalOrdinal>::node_type
>
51
class
TrilinosSmoother
:
public
SmootherPrototype
<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
52
#undef MUELU_TRILINOSSMOOTHER_SHORT
53
#include "
MueLu_UseShortNames.hpp
"
54
55
public
:
57
58
70
71
TrilinosSmoother
(
const
std::string& type =
""
,
const
Teuchos::ParameterList& paramList = Teuchos::ParameterList(),
const
LO& overlap = 0);
72
74
virtual
~TrilinosSmoother
() {}
75
77
79
80
81
void
DeclareInput
(
Level
& currentLevel)
const
;
82
84
86
87
89
void
Setup
(
Level
& currentLevel);
90
92
void
Apply
(MultiVector& X,
const
MultiVector& B,
bool
InitialGuessIsZero =
false
)
const
;
93
95
97
void
SetFactory
(
const
std::string& varName,
const
RCP<const FactoryBase>& factory);
98
100
RCP<SmootherPrototype>
Copy
()
const
;
101
102
#ifndef _MSC_VER
104
template
<
class
Scalar2,
class
LocalOrdinal2,
class
GlobalOrdinal2,
class
Node2>
105
friend
class
TrilinosSmoother
;
106
#endif
107
109
// As a temporary solution.
110
// See https://software.sandia.gov/bugzilla/show_bug.cgi?id=5283#c5 for what I proposed to do
111
static
std::string
Ifpack2ToIfpack1Type
(
const
std::string& type);
112
114
// As a temporary solution.
115
// See https://software.sandia.gov/bugzilla/show_bug.cgi?id=5283#c5 for what I proposed to do
116
/* TODO:
117
ifpackList.set("type", "Chebyshev");
118
ifpackList.set("chebyshev: degree", (int) 1);
119
ifpackList.set("chebyshev: max eigenvalue", (double) 2.0);
120
ifpackList.set("chebyshev: min eigenvalue", (double) 1.0);
121
ifpackList.set("chebyshev: zero starting solution", false);
122
*/
123
static
Teuchos::ParameterList
Ifpack2ToIfpack1Param
(
const
Teuchos::ParameterList& ifpack2List);
124
126
127
129
std::string
description
()
const
;
130
132
// using MueLu::Describable::describe; // overloading, not hiding
133
// void describe(Teuchos::FancyOStream &out, const VerbLevel verbLevel = Default) const {
134
void
print
(Teuchos::FancyOStream& out,
const
VerbLevel
verbLevel =
Default
)
const
;
135
137
RCP<SmootherPrototype>
getSmoother
() {
return
s_
; }
138
140
size_t
getNodeSmootherComplexity
()
const
{
return
s_
->getNodeSmootherComplexity(); }
141
143
144
private
:
146
std::string
type_
;
147
149
LO
overlap_
;
150
152
RCP<FactoryBase>
AFact_
;
153
154
//
155
// Underlying Smoother
156
//
157
159
RCP<SmootherPrototype>
sEpetra_
,
sTpetra_
,
sBelos_
,
sStratimikos_
;
160
mutable
RCP<SmootherPrototype>
s_
;
161
162
// Records for the case if something goes wrong
163
bool
triedEpetra_
,
triedTpetra_
,
triedBelos_
,
triedStratimikos_
;
164
std::string
errorEpetra_
,
errorTpetra_
,
errorBelos_
,
errorStratimikos_
;
165
166
};
// class TrilinosSmoother
167
168
}
// namespace MueLu
169
170
#define MUELU_TRILINOSSMOOTHER_SHORT
171
#endif
// MUELU_TRILINOSSMOOTHER_DECL_HPP
MueLu_BelosSmoother_fwd.hpp
MueLu_ConfigDefs.hpp
MueLu_FactoryBase_fwd.hpp
MueLu_Ifpack2Smoother_fwd.hpp
MueLu_IfpackSmoother_fwd.hpp
MueLu_StratimikosSmoother_fwd.hpp
MueLu_TrilinosSmoother_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::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::TrilinosSmoother::Copy
RCP< SmootherPrototype > Copy() const
When this prototype is cloned using Copy(), the clone is an Ifpack or an Ifpack2 smoother.
Definition
MueLu_TrilinosSmoother_def.hpp:202
MueLu::TrilinosSmoother::Setup
void Setup(Level ¤tLevel)
TrilinosSmoother cannot be turned into a smoother using Setup(). Setup() always returns a RuntimeErro...
Definition
MueLu_TrilinosSmoother_def.hpp:178
MueLu::TrilinosSmoother::getSmoother
RCP< SmootherPrototype > getSmoother()
For diagnostic purposes.
Definition
MueLu_TrilinosSmoother_decl.hpp:137
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::overlap_
LO overlap_
Definition
MueLu_TrilinosSmoother_decl.hpp:149
MueLu::TrilinosSmoother::Ifpack2ToIfpack1Param
static Teuchos::ParameterList Ifpack2ToIfpack1Param(const Teuchos::ParameterList &ifpack2List)
Convert an Ifpack2 parameter list to Ifpack.
Definition
MueLu_TrilinosSmoother_def.hpp:315
MueLu::TrilinosSmoother::Ifpack2ToIfpack1Type
static std::string Ifpack2ToIfpack1Type(const std::string &type)
Convert an Ifpack2 preconditioner name to Ifpack.
Definition
MueLu_TrilinosSmoother_def.hpp:231
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::type_
std::string type_
Definition
MueLu_TrilinosSmoother_decl.hpp:146
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::errorBelos_
std::string errorBelos_
Definition
MueLu_TrilinosSmoother_decl.hpp:164
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::sBelos_
RCP< SmootherPrototype > sBelos_
Definition
MueLu_TrilinosSmoother_decl.hpp:159
MueLu::TrilinosSmoother::TrilinosSmoother
friend class TrilinosSmoother
Friend declaration required for clone() functionality.
Definition
MueLu_TrilinosSmoother_decl.hpp:105
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::errorStratimikos_
std::string errorStratimikos_
Definition
MueLu_TrilinosSmoother_decl.hpp:164
MueLu::TrilinosSmoother::DeclareInput
void DeclareInput(Level ¤tLevel) const
Input.
Definition
MueLu_TrilinosSmoother_def.hpp:128
MueLu::TrilinosSmoother::getNodeSmootherComplexity
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
Definition
MueLu_TrilinosSmoother_decl.hpp:140
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::errorEpetra_
std::string errorEpetra_
Definition
MueLu_TrilinosSmoother_decl.hpp:164
MueLu::TrilinosSmoother::~TrilinosSmoother
virtual ~TrilinosSmoother()
Destructor.
Definition
MueLu_TrilinosSmoother_decl.hpp:74
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::sEpetra_
RCP< SmootherPrototype > sEpetra_
Definition
MueLu_TrilinosSmoother_decl.hpp:159
MueLu::TrilinosSmoother::TrilinosSmoother
TrilinosSmoother(const std::string &type="", const Teuchos::ParameterList ¶mList=Teuchos::ParameterList(), const LO &overlap=0)
Constructor.
Definition
MueLu_TrilinosSmoother_def.hpp:28
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::triedStratimikos_
bool triedStratimikos_
Definition
MueLu_TrilinosSmoother_decl.hpp:163
MueLu::TrilinosSmoother::SetFactory
void SetFactory(const std::string &varName, const RCP< const FactoryBase > &factory)
Custom SetFactory.
Definition
MueLu_TrilinosSmoother_def.hpp:119
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::sStratimikos_
RCP< SmootherPrototype > sStratimikos_
Definition
MueLu_TrilinosSmoother_decl.hpp:159
MueLu::TrilinosSmoother::Apply
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
TrilinosSmoother cannot be applied. Apply() always returns a RuntimeError exception.
Definition
MueLu_TrilinosSmoother_def.hpp:194
MueLu::TrilinosSmoother::print
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
Definition
MueLu_TrilinosSmoother_def.hpp:342
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::triedTpetra_
bool triedTpetra_
Definition
MueLu_TrilinosSmoother_decl.hpp:163
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::triedEpetra_
bool triedEpetra_
Definition
MueLu_TrilinosSmoother_decl.hpp:163
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::s_
RCP< SmootherPrototype > s_
Definition
MueLu_TrilinosSmoother_decl.hpp:160
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::AFact_
RCP< FactoryBase > AFact_
Definition
MueLu_TrilinosSmoother_decl.hpp:152
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::triedBelos_
bool triedBelos_
Definition
MueLu_TrilinosSmoother_decl.hpp:163
MueLu::TrilinosSmoother::description
std::string description() const
Return a simple one-line description of this object.
Definition
MueLu_TrilinosSmoother_def.hpp:330
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::errorTpetra_
std::string errorTpetra_
Definition
MueLu_TrilinosSmoother_decl.hpp:164
MueLu::TrilinosSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::sTpetra_
RCP< SmootherPrototype > sTpetra_
Definition
MueLu_TrilinosSmoother_decl.hpp:159
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_TrilinosSmoother_decl.hpp
Generated by
1.17.0