MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_LowPrecisionFactory_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_LOWPRECISIONFACTORY_DECL_HPP
11 #define MUELU_LOWPRECISIONFACTORY_DECL_HPP
12 
13 #include <string>
14 
15 #include "MueLu_ConfigDefs.hpp"
17 
18 #include "MueLu_Level_fwd.hpp"
20 
21 namespace MueLu {
22 
28 template <class Scalar = double, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
30 #undef MUELU_LOWPRECISIONFACTORY_SHORT
31 #include "MueLu_UseShortNames.hpp"
32 
33  public:
35 
36 
38 
40  virtual ~LowPrecisionFactory() {}
41 
43 
45 
47 
48 
49  void DeclareInput(Level& currentLevel) const;
50 
52 
54 
55 
61  void Build(Level& currentLevel) const;
62 
64 
65 }; // class LowPrecisionFactory
66 
67 #if defined(HAVE_TPETRA_INST_DOUBLE) && defined(HAVE_TPETRA_INST_FLOAT)
68 template <class LocalOrdinal, class GlobalOrdinal, class Node>
69 class LowPrecisionFactory<double, LocalOrdinal, GlobalOrdinal, Node> : public SingleLevelFactoryBase {
70  typedef double Scalar;
71 #undef MUELU_LOWPRECISIONFACTORY_SHORT
72 #include "MueLu_UseShortNames.hpp"
73 
74  public:
76 
77 
79 
81  virtual ~LowPrecisionFactory() {}
82 
83  RCP<const ParameterList> GetValidParameterList() const;
84 
86 
88 
89 
90  void DeclareInput(Level& currentLevel) const;
91 
93 
95 
96 
102  void Build(Level& currentLevel) const;
103 
105 
106 }; // class LowPrecisionFactory
107 #endif
108 
109 #if defined(HAVE_TPETRA_INST_COMPLEX_DOUBLE) && defined(HAVE_TPETRA_INST_COMPLEX_FLOAT)
110 template <class LocalOrdinal, class GlobalOrdinal, class Node>
111 class LowPrecisionFactory<std::complex<double>, LocalOrdinal, GlobalOrdinal, Node> : public SingleLevelFactoryBase {
112  typedef std::complex<double> Scalar;
113 #undef MUELU_LOWPRECISIONFACTORY_SHORT
114 #include "MueLu_UseShortNames.hpp"
115 
116  public:
118 
119 
121 
123  virtual ~LowPrecisionFactory() {}
124 
125  RCP<const ParameterList> GetValidParameterList() const;
126 
128 
130 
131 
132  void DeclareInput(Level& currentLevel) const;
133 
135 
137 
138 
144  void Build(Level& currentLevel) const;
145 
147 
148 }; // class LowPrecisionFactory
149 #endif
150 
151 } // namespace MueLu
152 
153 #define MUELU_LOWPRECISIONFACTORY_SHORT
154 #endif // MUELU_LOWPRECISIONFACTORY_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
Factory for converting matrices to half precision operators.
MueLu::DefaultNode Node
void Build(Level &currentLevel) const
Build method.
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
Class that holds all level-specific information.
Definition: MueLu_Level.hpp:63
void DeclareInput(Level &currentLevel) const
Input.
Base class for factories that use one level (currentLevel).