MueLu
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
MueLu_MatlabSmoother_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_MATLABSMOOTHER_DECL_HPP
11
#define MUELU_MATLABSMOOTHER_DECL_HPP
12
13
#include <Teuchos_ParameterList.hpp>
14
#include <Xpetra_Matrix_fwd.hpp>
15
#include "
MueLu_ConfigDefs.hpp
"
16
17
#if defined(HAVE_MUELU_MATLAB)
18
#include <Tpetra_CrsMatrix.hpp>
19
#include "MueLu_SmootherPrototype.hpp"
20
#include "
MueLu_MatlabSmoother_fwd.hpp
"
21
#include "
MueLu_MatlabUtils_decl.hpp
"
22
23
namespace
MueLu
{
24
33
34
template <class Scalar = SmootherPrototype<>::scalar_type,
35
class
LocalOrdinal
=
typename
SmootherPrototype<Scalar>::local_ordinal_type
,
36
class
GlobalOrdinal
=
typename
SmootherPrototype<Scalar, LocalOrdinal>::global_ordinal_type
,
37
class
Node
=
typename
SmootherPrototype<Scalar, LocalOrdinal, GlobalOrdinal>::node_type
>
38
class
MatlabSmoother
:
public
SmootherPrototype
<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
39
#undef MUELU_MATLABSMOOTHER_SHORT
40
#include "
MueLu_UseShortNames.hpp
"
41
42
public
:
44
45
// TODO: update doc for Matlab.
51
52
#ifndef _MSC_VER
53
// Avoid error C3772: invalid friend template declaration
54
template
<
class
Scalar2,
class
LocalOrdinal2,
class
GlobalOrdinal2,
class
Node2>
55
friend
class
MatlabSmoother
;
56
#endif
57
58
MatlabSmoother
(
const
Teuchos::ParameterList& paramList = Teuchos::ParameterList());
59
61
virtual
~MatlabSmoother
() {}
62
64
65
void
SetParameterList
(
const
Teuchos::ParameterList& paramList);
66
68
69
70
void
DeclareInput
(
Level
& currentLevel)
const
;
71
73
75
76
84
void
Setup
(
Level
& currentLevel);
85
94
void
Apply
(MultiVector& X,
const
MultiVector& B,
bool
InitialGuessIsZero =
false
)
const
;
95
97
99
100
101
RCP<SmootherPrototype>
Copy
()
const
;
102
104
106
template
<
typename
Node2>
107
RCP<MueLu::MatlabSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node2> >
108
clone
(
const
RCP<Node2>& node2,
const
Teuchos::RCP<
const
Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node2> >& A_newnode)
const
;
109
111
112
114
std::string
description
()
const
;
115
117
// using MueLu::Describable::describe; // overloading, not hiding
118
// void describe(Teuchos::FancyOStream &out, const VerbLevel verbLevel = Default) const
119
void
print
(Teuchos::FancyOStream& out,
const
VerbLevel
verbLevel =
Default
)
const
;
120
121
size_t
getNodeSmootherComplexity
()
const
{
return
Teuchos::OrdinalTraits<size_t>::invalid(); }
122
124
125
private
:
127
mutable
std::string
needsSetup_
;
128
130
size_t
solveDataSize_
;
131
133
std::vector<Teuchos::RCP<MuemexArg> >
solveData_
;
134
136
std::string
setupFunction_
;
137
139
std::string
solveFunction_
;
140
142
mutable
RCP<Matrix>
A_
;
143
144
};
// class MatlabSmoother
145
146
template
<
class
Scalar,
class
LocalOrdinal,
class
GlobalOrdinal,
class
Node>
147
template
<
typename
Node2>
148
RCP<MueLu::MatlabSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node2> >
149
MatlabSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::clone
(
const
RCP<Node2>& node2,
const
RCP<
const
Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node2> >& A_newnode)
const
{
150
const
ParameterList& paramList = this->
GetParameterList
();
151
152
RCP<MatlabSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node2> > cloneSmoother =
153
rcp(
new
MatlabSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node2>
(paramList));
154
155
cloneSmoother->needsSetup_ =
needsSetup_
;
156
cloneSmoother->setupFunction_ =
setupFunction_
;
157
cloneSmoother->solveFunction_ =
solveFunction_
;
158
cloneSmoother->A_ =
A_
;
159
160
for
(
size_t
i = 0; i <
solveData_
.size(); i++)
161
cloneSmoother->solveData_->push_back(
solveData_
[i]);
162
cloneSmoother->SetParameterList(paramList);
163
cloneSmoother->IsSetup(this->
IsSetup
());
164
return
cloneSmoother;
165
}
166
167
}
// namespace MueLu
168
169
#define MUELU_MATLABSMOOTHER_SHORT
170
#endif
// HAVE_MUELU_MATLAB
171
#endif
// MUELU_MATLABSMOOTHER_DECL_HPP
MueLu_ConfigDefs.hpp
MueLu_MatlabSmoother_fwd.hpp
MueLu_MatlabUtils_decl.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::MatlabSmoother::~MatlabSmoother
virtual ~MatlabSmoother()
Destructor.
Definition
MueLu_MatlabSmoother_decl.hpp:61
MueLu::MatlabSmoother::MatlabSmoother
MatlabSmoother(const Teuchos::ParameterList ¶mList=Teuchos::ParameterList())
Definition
MueLu_MatlabSmoother_def.hpp:20
MueLu::MatlabSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::solveFunction_
std::string solveFunction_
Definition
MueLu_MatlabSmoother_decl.hpp:139
MueLu::MatlabSmoother::DeclareInput
void DeclareInput(Level ¤tLevel) const
Input.
Definition
MueLu_MatlabSmoother_def.hpp:34
MueLu::MatlabSmoother::getNodeSmootherComplexity
size_t getNodeSmootherComplexity() const
Compute a rough estimate of the cost to apply this smoother on this MPI rank. Return Teuchos::Ordinal...
Definition
MueLu_MatlabSmoother_decl.hpp:121
MueLu::MatlabSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Level
MueLu::Level Level
MueLu::MatlabSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::needsSetup_
std::string needsSetup_
Definition
MueLu_MatlabSmoother_decl.hpp:127
MueLu::MatlabSmoother::clone
RCP< MueLu::MatlabSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node2 > > clone(const RCP< Node2 > &node2, const Teuchos::RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node2 > > &A_newnode) const
Clone the smoother to a different node type.
MueLu::MatlabSmoother::print
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
Definition
MueLu_MatlabSmoother_def.hpp:111
MueLu::MatlabSmoother::Setup
void Setup(Level ¤tLevel)
Set up the smoother.
Definition
MueLu_MatlabSmoother_def.hpp:47
MueLu::MatlabSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::solveDataSize_
size_t solveDataSize_
Definition
MueLu_MatlabSmoother_decl.hpp:130
MueLu::MatlabSmoother::Copy
RCP< SmootherPrototype > Copy() const
Definition
MueLu_MatlabSmoother_def.hpp:93
MueLu::MatlabSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::A_
RCP< Matrix > A_
Definition
MueLu_MatlabSmoother_decl.hpp:142
MueLu::MatlabSmoother::MatlabSmoother
friend class MatlabSmoother
Constructor.
Definition
MueLu_MatlabSmoother_decl.hpp:55
MueLu::MatlabSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::solveData_
std::vector< Teuchos::RCP< MuemexArg > > solveData_
Definition
MueLu_MatlabSmoother_decl.hpp:133
MueLu::MatlabSmoother::Apply
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply the preconditioner.
Definition
MueLu_MatlabSmoother_def.hpp:66
MueLu::MatlabSmoother< Scalar, LocalOrdinal, GlobalOrdinal, Node >::setupFunction_
std::string setupFunction_
Definition
MueLu_MatlabSmoother_decl.hpp:136
MueLu::MatlabSmoother::SetParameterList
void SetParameterList(const Teuchos::ParameterList ¶mList)
Set parameters from a parameter list and return with default values.
Definition
MueLu_MatlabSmoother_def.hpp:25
MueLu::MatlabSmoother::description
std::string description() const
Return a simple one-line description of this object.
Definition
MueLu_MatlabSmoother_def.hpp:100
MueLu::ParameterListAcceptorImpl::GetParameterList
virtual const Teuchos::ParameterList & GetParameterList() const
Definition
MueLu_ParameterListAcceptor.cpp:50
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< Scalar, LocalOrdinal, GlobalOrdinal, Node >::IsSetup
bool IsSetup() const
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
matlab
src
MueLu_MatlabSmoother_decl.hpp
Generated by
1.17.0