MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_StructuredRAPFactory_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#ifndef MUELU_STRUCTUREDRAPFACTORY_DECL_HPP
10#define MUELU_STRUCTUREDRAPFACTORY_DECL_HPP
11
12#include <string>
13#include <vector>
14
15#include <Xpetra_Matrix_fwd.hpp>
16#include <Xpetra_MatrixFactory_fwd.hpp>
17#include <Xpetra_MatrixUtils_fwd.hpp>
18
19#include "MueLu_ConfigDefs.hpp"
20
23
25#include "MueLu_Level_fwd.hpp"
28
29namespace MueLu {
34template <class Scalar = DefaultScalar,
37 class Node = DefaultNode>
39#undef MUELU_STRUCTUREDRAPFACTORY_SHORT
41
42 public:
44
45
47
48 virtual ~StructuredRAPFactory() = default;
49
51
53
54
55 RCP<const ParameterList> GetValidParameterList() const;
56
57 void DeclareInput(Level& fineLevel, Level& coarseLevel) const;
58
60
62
63 void Build(Level& fineLevel, Level& coarseLevel) const;
65
67
72 void AddTransferFactory(const RCP<const FactoryBase>& factory);
73
75 size_t NumTransferFactories() const { return transferFacts_.size(); }
76
78
79 // These implementation details must be public because CUDA extended lambdas
80 // cannot be enclosed by a private member function or capture a private type.
82 int x;
83 int y;
84 int z;
85 };
86
90 std::vector<StencilOffset> stencilOffsets;
91 std::string description;
92 };
93
94 void GetStructuredGraph(RCP<Matrix>& Ac, const RCP<Matrix> P,
95 const Teuchos::Array<LocalOrdinal>& lCoarseNodesPerDim,
96 const StructuredGraphSpec& graphSpec) const;
97
98 private:
100
101 mutable bool hasDeclaredInput_;
102
104
106
108 std::vector<RCP<const FactoryBase>> transferFacts_;
109
111
113
114 StructuredGraphSpec GetStructuredGraphSpec(const std::string& matrixType, int interpolationOrder) const;
115
116 void ConfigureRAPFactoryDelegate() const;
117
118 mutable RCP<MueLu::RAPFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>> rapFactoryDelegate_;
119
120 //}
121
122}; // class StructuredRAPFactory
123
124} // namespace MueLu
125
126#define MUELU_STRUCTUREDRAPFACTORY_SHORT
127#endif // MUELU_STRUCTUREDRAPFACTORY_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Class that holds all level-specific information.
Factory for building coarse matrices in an optimized way by prebuilding the coarse graph based on the...
virtual ~StructuredRAPFactory()=default
void AddTransferFactory(const RCP< const FactoryBase > &factory)
Add transfer factory in the end of list of transfer factories in RepartitionAcFactory.
size_t NumTransferFactories() const
Returns number of transfer factories.
void GetStructuredGraph(RCP< Matrix > &Ac, const RCP< Matrix > P, const Teuchos::Array< LocalOrdinal > &lCoarseNodesPerDim, const StructuredGraphSpec &graphSpec) const
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
void Build(Level &fineLevel, Level &coarseLevel) const
Build an object with this factory.
StructuredGraphSpec GetStructuredGraphSpec(const std::string &matrixType, int interpolationOrder) const
RCP< MueLu::RAPFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node > > rapFactoryDelegate_
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
std::vector< RCP< const FactoryBase > > transferFacts_
list of user-defined transfer Factories
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