MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_SmootherPrototype_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_SMOOTHERPROTOTYPE_DECL_HPP
11 #define MUELU_SMOOTHERPROTOTYPE_DECL_HPP
12 
13 #include "MueLu_ConfigDefs.hpp"
15 #include "MueLu_SmootherBase.hpp"
16 #include "MueLu_Factory.hpp"
17 
18 namespace MueLu {
19 
20 class Level;
21 
34 template <class Scalar = SmootherBase<>::scalar_type,
35  class LocalOrdinal = typename SmootherBase<Scalar>::local_ordinal_type,
36  class GlobalOrdinal = typename SmootherBase<Scalar, LocalOrdinal>::global_ordinal_type,
37  class Node = typename SmootherBase<Scalar, LocalOrdinal, GlobalOrdinal>::node_type>
38 class SmootherPrototype : public SmootherBase<Scalar, LocalOrdinal, GlobalOrdinal, Node>,
39  public Factory {
40  public:
44  typedef Node node_type;
45 
46  private:
47 #undef MUELU_SMOOTHERPROTOTYPE_SHORT
48 #include "MueLu_UseShortNames.hpp"
49 
50  public:
52 
53 
55 
56  virtual ~SmootherPrototype();
57 
59 
61 
62 
63  virtual void DeclareInput(Level &currentLevel) const = 0;
64 
66 
68 
69 
70  virtual void Setup(Level &) = 0;
71 
72  virtual RCP<SmootherPrototype> Copy() const = 0;
73 
75 
77 
78 
80  bool IsSetup() const;
81 
83  // Developpers: this method must be called by your Setup() method.
84  void IsSetup(bool const &ToF);
85 
87 
89 
90  virtual void CallBuild(Level & /* requestedLevel */) const {
92  }
93 
95  virtual void CallDeclareInput(Level &requestedLevel) const {
96  DeclareInput(requestedLevel);
97  }
98 
100 
101  private:
102  bool isSetup_;
103 
104 }; // class SmootherPrototype
105 
106 } // namespace MueLu
107 
108 // TODO: private copy constructor
109 // TODO: update comments
110 
111 #define MUELU_SMOOTHERPROTOTYPE_SHORT
112 #endif // MUELU_SMOOTHERPROTOTYPE_DECL_HPP
virtual void DeclareInput(Level &currentLevel) const =0
Input.
MueLu::DefaultLocalOrdinal LocalOrdinal
Base class for smoother prototypes.
virtual void Setup(Level &)=0
MueLu::DefaultNode Node
virtual RCP< SmootherPrototype > Copy() const =0
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
Class that holds all level-specific information.
Definition: MueLu_Level.hpp:63
bool IsSetup() const
Get the state of a smoother prototype.
Base class for smoothers.
virtual void CallDeclareInput(Level &requestedLevel) const
virtual void CallBuild(Level &) const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)