MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_BlockedRAPFactory_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_BLOCKEDRAPFACTORY_DECL_HPP
11#define MUELU_BLOCKEDRAPFACTORY_DECL_HPP
12
13#include <Xpetra_Matrix_fwd.hpp>
14#include <Xpetra_CrsMatrix_fwd.hpp>
15#include <Xpetra_BlockedCrsMatrix_fwd.hpp>
16#include <Xpetra_MatrixFactory_fwd.hpp>
17
18#include "MueLu_ConfigDefs.hpp"
20
21#include "MueLu_Level_fwd.hpp"
25
26namespace MueLu {
31template <class Scalar = DefaultScalar,
34 class Node = DefaultNode>
36#undef MUELU_BLOCKEDRAPFACTORY_SHORT
38
39 public:
41
42
44
45 virtual ~BlockedRAPFactory() = default;
47
49
50
51 RCP<const ParameterList> GetValidParameterList() const override;
52
53 void DeclareInput(Level &fineLevel, Level &coarseLevel) const override;
54
56
58
59 void Build(Level &fineLevel, Level &coarseLevel) const override;
61
63
64
66 void SetRepairZeroDiagonal(bool const &repair) {
67 repairZeroDiagonals_ = repair;
68 if (repair) checkAc_ = true; // make sure that plausibility check is performed. Otherwise SetRepairZeroDiagonal(true) has no effect.
69 }
70
72 void SetPlausibilityCheck(bool const &check) {
73 checkAc_ = check;
74 }
75
77
82 void AddTransferFactory(const RCP<const FactoryBase> &factory);
83
84 // TODO add a function to remove a specific transfer factory?
85
87 size_t NumTransferFactories() const { return transferFacts_.size(); }
88
90
91 private:
94 static void CheckMainDiagonal(RCP<BlockedCrsMatrix> &bAc, bool repairZeroDiagonals = false);
95
99
104
106
108 std::vector<RCP<const FactoryBase> > transferFacts_;
109
111
112}; // class BlockedRAPFactory
113
114} // namespace MueLu
115
116#define MUELU_BLOCKEDRAPFACTORY_SHORT
117#endif // MUELU_BLOCKEDRAPFACTORY_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Factory for building coarse matrices.
void SetPlausibilityCheck(bool const &check)
Indicate that a simple plausibility check shall be done for Ac after building RAP.
void SetRepairZeroDiagonal(bool const &repair)
Indicate that zero entries on the diagonal of Ac shall be repaired (i.e. if A(i,i) == 0....
size_t NumTransferFactories() const
Returns number of transfer factories.
static void CheckMainDiagonal(RCP< BlockedCrsMatrix > &bAc, bool repairZeroDiagonals=false)
virtual ~BlockedRAPFactory()=default
void Build(Level &fineLevel, Level &coarseLevel) const override
Build an object with this factory.
void DeclareInput(Level &fineLevel, Level &coarseLevel) const override
Input.
std::vector< RCP< const FactoryBase > > transferFacts_
list of user-defined transfer Factories
RCP< const ParameterList > GetValidParameterList() const override
Return a const parameter list of valid parameters that setParameterList() will accept.
void AddTransferFactory(const RCP< const FactoryBase > &factory)
Add transfer factory in the end of list of transfer factories in RepartitionAcFactory.
Class that holds all level-specific information.
Base class for factories that use two levels (fineLevel and coarseLevel).
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar