MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
19 
20 #include "MueLu_ConfigDefs.hpp"
22 
24 #include "MueLu_Level_fwd.hpp"
25 #include "MueLu_PerfUtils_fwd.hpp"
27 
28 namespace MueLu {
36 template <class Scalar = DefaultScalar,
39  class Node = DefaultNode>
41 #undef MUELU_RAPSHIFTFACTORY_SHORT
42 #include "MueLu_UseShortNames.hpp"
43 
44  public:
46 
47 
49 
50  virtual ~RAPShiftFactory() {}
51 
53 
55 
56 
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
size_t NumTransferFactories() const
Returns number of transfer factories.
void Build(Level &fineLevel, Level &coarseLevel) const
Build an object with this factory.
MueLu::DefaultLocalOrdinal LocalOrdinal
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Factory for building coarse grid matrices, when the matrix is of the form K+a*M. Useful when you want...
Base class for factories that use two levels (fineLevel and coarseLevel).
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
bool implicitTranspose_
If true, the action of the restriction operator action is implicitly defined by the transpose of the ...
MueLu::DefaultNode Node
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
std::vector< RCP< const FactoryBase > > transferFacts_
list of user-defined transfer Factories
MueLu::DefaultScalar Scalar
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
Class that holds all level-specific information.
Definition: MueLu_Level.hpp:63
void AddTransferFactory(const RCP< const FactoryBase > &factory)
Add transfer factory in the end of list of transfer factories in RepartitionAcFactory.
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...