MueLu Version of the Day
Loading...
Searching...
No Matches
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
20namespace MueLu {
21
54template <class Scalar = DefaultScalar,
57 class Node = DefaultNode>
58class TogglePFactory : public PFactory {
59#undef MUELU_TOGGLEPFACTORY_SHORT
61
62 public:
64
65
69
71 virtual ~TogglePFactory() {}
72
73 RCP<const ParameterList> GetValidParameterList() const;
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
108 void AddCoarseNullspaceFactory(const RCP<const FactoryBase> &factory);
109
111 size_t NumCoarseNullspaceFactories() const { return prolongatorFacts_.size(); }
112
113 RCP<const FactoryBase> getProlongatorFactory(size_t t) const { return prolongatorFacts_[t]; }
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
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Class that holds all level-specific information.
Factory that provides an interface for a concrete implementation of a prolongation operator.
Prolongator factory which allows switching between two different prolongator strategies.
std::vector< RCP< const FactoryBase > > ptentFacts_
list of user-defined tentative prolongation operator factories
RCP< const FactoryBase > getProlongatorFactory(size_t t) const
size_t NumCoarseNullspaceFactories() const
Returns number of coarse null space factories.
size_t NumPtentFactories() const
Returns number of tentative prolongator factories.
size_t NumProlongatorFactories() const
Returns number of prolongator factories.
void BuildP(Level &, Level &) const
Abstract Build method.
void AddCoarseNullspaceFactory(const RCP< const FactoryBase > &factory)
Add a coarse nullspace factory in the end of list of coarse nullspace factories.
void AddProlongatorFactory(const RCP< const FactoryBase > &factory)
Add a prolongator factory in the end of list of prolongator factories.
void AddPtentFactory(const RCP< const FactoryBase > &factory)
Add a tentative prolongator factory in the end of list of prolongator factories.
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
std::vector< RCP< const FactoryBase > > prolongatorFacts_
list of user-defined prolongation operator factories
std::vector< RCP< const FactoryBase > > nspFacts_
list of user-defined nullspace factories (i.e. the prolongator factories which also generate the coar...
virtual ~TogglePFactory()
Destructor.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
void Build(Level &fineLevel, Level &coarseLevel) const
Build method.
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar