MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_TogglePFactory_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_TOGGLEPFACTORY_DECL_HPP
11 #define MUELU_TOGGLEPFACTORY_DECL_HPP
12 
13 #include "MueLu_ConfigDefs.hpp"
15 
16 #include "MueLu_Level_fwd.hpp"
18 #include "MueLu_PFactory.hpp"
19 
20 namespace MueLu {
21 
54 template <class Scalar = DefaultScalar,
57  class Node = DefaultNode>
58 class TogglePFactory : public PFactory {
59 #undef MUELU_TOGGLEPFACTORY_SHORT
60 #include "MueLu_UseShortNames.hpp"
61 
62  public:
64 
65 
68  : hasDeclaredInput_(false) {}
69 
71  virtual ~TogglePFactory() {}
72 
74 
76 
78 
79 
80  void DeclareInput(Level &fineLevel, Level &coarseLevel) const;
81 
83 
85 
86 
88  void Build(Level &fineLevel, Level &coarseLevel) const;
89 
90  void BuildP(Level & /* fineLevel */, Level & /* coarseLevel */) const {/* empty */};
92 
94 
96  void AddProlongatorFactory(const RCP<const FactoryBase> &factory);
97 
99  size_t NumProlongatorFactories() const { return prolongatorFacts_.size(); }
100 
102  void AddPtentFactory(const RCP<const FactoryBase> &factory);
103 
105  size_t NumPtentFactories() const { return ptentFacts_.size(); }
106 
109 
111  size_t NumCoarseNullspaceFactories() const { return prolongatorFacts_.size(); }
112 
115  private:
117  mutable std::vector<RCP<const FactoryBase> > prolongatorFacts_;
118 
120  mutable std::vector<RCP<const FactoryBase> > ptentFacts_;
121 
123  mutable std::vector<RCP<const FactoryBase> > nspFacts_;
124 
125  mutable bool hasDeclaredInput_;
126 }; // class TogglePFactory
127 
128 } // namespace MueLu
129 
130 #define MUELU_TOGGLEPFACTORY_SHORT
131 #endif // MUELU_TOGGLEPFACTORY_DECL_HPP
std::vector< RCP< const FactoryBase > > ptentFacts_
list of user-defined tentative prolongation operator factories
MueLu::DefaultLocalOrdinal LocalOrdinal
void Build(Level &fineLevel, Level &coarseLevel) const
Build method.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
void AddProlongatorFactory(const RCP< const FactoryBase > &factory)
Add a prolongator factory in the end of list of prolongator factories.
std::vector< RCP< const FactoryBase > > nspFacts_
list of user-defined nullspace factories (i.e. the prolongator factories which also generate the coar...
size_t NumPtentFactories() const
Returns number of tentative prolongator factories.
void BuildP(Level &, Level &) const
Abstract Build method.
MueLu::DefaultNode Node
RCP< const FactoryBase > getProlongatorFactory(size_t t) const
std::vector< RCP< const FactoryBase > > prolongatorFacts_
list of user-defined prolongation operator factories
virtual ~TogglePFactory()
Destructor.
MueLu::DefaultScalar Scalar
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
Class that holds all level-specific information.
Definition: MueLu_Level.hpp:63
Prolongator factory which allows switching between two different prolongator strategies.
size_t NumCoarseNullspaceFactories() const
Returns number of coarse null space factories.
Factory that provides an interface for a concrete implementation of a prolongation operator...
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
void AddPtentFactory(const RCP< const FactoryBase > &factory)
Add a tentative prolongator factory in the end of list of prolongator factories.
size_t NumProlongatorFactories() const
Returns number of prolongator factories.
void AddCoarseNullspaceFactory(const RCP< const FactoryBase > &factory)
Add a coarse nullspace factory in the end of list of coarse nullspace factories.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.