MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_BlockedPFactory_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_BLOCKEDPFACTORY_DECL_HPP_
11 #define MUELU_BLOCKEDPFACTORY_DECL_HPP_
12 
13 #include <set>
15 #include <Xpetra_Matrix_fwd.hpp>
16 
17 #include "MueLu_ConfigDefs.hpp"
18 #include "MueLu_PFactory.hpp"
21 
22 namespace MueLu {
23 
82 template <class Scalar = DefaultScalar,
85  class Node = DefaultNode>
86 class BlockedPFactory : public PFactory {
87 #undef MUELU_BLOCKEDPFACTORY_SHORT
88 #include "MueLu_UseShortNames.hpp"
89  public:
91 
92 
96  BlockedPFactory(/*RCP<FactoryBase> AFact = Teuchos::null*/)
97  : diagonalView_("current") {}
98 
100  virtual ~BlockedPFactory() {}
101 
103 
105 
107 
108 
110  void SetDiagonalView(std::string const &diagView) { diagonalView_ = diagView; }
111 
113  void AddFactoryManager(RCP<const FactoryManagerBase> FactManager) { FactManager_.push_back(FactManager); }
114 
116 
118 
119 
121  std::string GetDiagonalView() { return diagonalView_; }
122 
124 
126 
127 
128  void DeclareInput(Level &fineLevel, Level &coarseLevel) const;
130 
132 
133 
140  void Build(Level &fineLevel, Level &coarseLevel) const;
141 
142  void BuildP(Level &fineLevel, Level &coarseLevel) const;
143 
145 
146  private:
147  bool areGidsUnique(const std::vector<GO> &X) const {
148  std::set<GO> Y(X.begin(), X.end());
149  return X.size() == Y.size();
150  }
151 
153  std::vector<Teuchos::RCP<const FactoryManagerBase> > FactManager_;
154 
156  std::string diagonalView_;
157 };
158 
159 } // namespace MueLu
160 
161 #define MUELU_BLOCKEDPFACTORY_SHORT
162 #endif /* MUELU_BLOCKEDPFACTORY_DECL_HPP_ */
bool areGidsUnique(const std::vector< GO > &X) const
MueLu::DefaultLocalOrdinal LocalOrdinal
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
std::string GetDiagonalView()
Returns current view of diagonal.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Factory for building blocked, segregated prolongation operators.
MueLu::DefaultNode Node
std::vector< Teuchos::RCP< const FactoryManagerBase > > FactManager_
Input factories.
MueLu::DefaultScalar Scalar
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
std::string diagonalView_
Factory parameters.
Class that holds all level-specific information.
Definition: MueLu_Level.hpp:63
virtual ~BlockedPFactory()
Destructor.
BlockedPFactory()
Constructor. User can supply a factory for generating the tentative prolongator.
void BuildP(Level &fineLevel, Level &coarseLevel) const
Abstract Build method.
Factory that provides an interface for a concrete implementation of a prolongation operator...
void SetDiagonalView(std::string const &diagView)
Change view of diagonal.
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
void Build(Level &fineLevel, Level &coarseLevel) const
Build method.
void AddFactoryManager(RCP< const FactoryManagerBase > FactManager)
Add a factory manager.