MueLu Version of the Day
Loading...
Searching...
No Matches
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>
14#include <Xpetra_MapExtractorFactory_fwd.hpp>
15#include <Xpetra_Matrix_fwd.hpp>
16
17#include "MueLu_ConfigDefs.hpp"
18#include "MueLu_PFactory.hpp"
21
22namespace MueLu {
23
82template <class Scalar = DefaultScalar,
85 class Node = DefaultNode>
86class BlockedPFactory : public PFactory {
87#undef MUELU_BLOCKEDPFACTORY_SHORT
89 public:
91
92
96 BlockedPFactory(/*RCP<FactoryBase> AFact = Teuchos::null*/)
97 : diagonalView_("current") {}
98
100 virtual ~BlockedPFactory() {}
101
102 RCP<const ParameterList> GetValidParameterList() const;
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_ */
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Factory for building blocked, segregated prolongation operators.
void SetDiagonalView(std::string const &diagView)
Change view of diagonal.
std::string diagonalView_
Factory parameters.
void Build(Level &fineLevel, Level &coarseLevel) const
Build method.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
BlockedPFactory()
Constructor. User can supply a factory for generating the tentative prolongator.
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
std::string GetDiagonalView()
Returns current view of diagonal.
void BuildP(Level &fineLevel, Level &coarseLevel) const
Abstract Build method.
bool areGidsUnique(const std::vector< GO > &X) const
std::vector< Teuchos::RCP< const FactoryManagerBase > > FactManager_
Input factories.
void AddFactoryManager(RCP< const FactoryManagerBase > FactManager)
Add a factory manager.
Class that holds all level-specific information.
Factory that provides an interface for a concrete implementation of a prolongation operator.
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar