MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_RAPShiftFactory_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_RAPSHIFTFACTORY_DECL_HPP
11#define MUELU_RAPSHIFTFACTORY_DECL_HPP
12
13#include <string>
14
15#include <Xpetra_Matrix_fwd.hpp>
16#include <Xpetra_MatrixFactory2_fwd.hpp>
17#include <Xpetra_Vector_fwd.hpp>
18#include <Xpetra_VectorFactory_fwd.hpp>
19
20#include "MueLu_ConfigDefs.hpp"
22
24#include "MueLu_Level_fwd.hpp"
27
28namespace MueLu {
36template <class Scalar = DefaultScalar,
39 class Node = DefaultNode>
41#undef MUELU_RAPSHIFTFACTORY_SHORT
43
44 public:
46
47
49
50 virtual ~RAPShiftFactory() {}
51
53
55
56
57 RCP<const ParameterList> GetValidParameterList() const;
58
59 void DeclareInput(Level &fineLevel, Level &coarseLevel) const;
60
62
64
65 void Build(Level &fineLevel, Level &coarseLevel) const;
67
69
70
72 void SetImplicitTranspose(bool const &implicit) {
73 implicitTranspose_ = implicit;
74 }
75
76 void SetShifts(std::vector<Scalar> &shifts) {
77 shifts_.clear();
78 shifts_ = shifts;
79 }
80
82
84
89 void AddTransferFactory(const RCP<const FactoryBase> &factory);
90
91 // TODO add a function to remove a specific transfer factory?
92
94 size_t NumTransferFactories() const { return transferFacts_.size(); }
95
97
98 private:
101
103 std::vector<RCP<const FactoryBase> > transferFacts_;
104
105 // vector of shifting terms
106 std::vector<Scalar> shifts_;
107
108}; // class RAPShiftFactory
109
110} // namespace MueLu
111
112#define MUELU_RAPSHIFTFACTORY_SHORT
113#endif // MUELU_RAPSHIFTFACTORY_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Class that holds all level-specific information.
Factory for building coarse grid matrices, when the matrix is of the form K+a*M. Useful when you want...
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
void SetShifts(std::vector< Scalar > &shifts)
void SetImplicitTranspose(bool const &implicit)
Indicate that the restriction operator action should be implicitly defined by the transpose of the pr...
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
void AddTransferFactory(const RCP< const FactoryBase > &factory)
Add transfer factory in the end of list of transfer factories in RepartitionAcFactory.
std::vector< RCP< const FactoryBase > > transferFacts_
list of user-defined transfer Factories
size_t NumTransferFactories() const
Returns number of transfer factories.
bool implicitTranspose_
If true, the action of the restriction operator action is implicitly defined by the transpose of the ...
void Build(Level &fineLevel, Level &coarseLevel) const
Build an object with this factory.
Base class for factories that use two levels (fineLevel and coarseLevel).
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar