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
92
96 std::vector<StencilOffset> stencilOffsets;
97 std::vector<FineStencilEntry> entries;
98 };
99
103 std::vector<StencilOffset> stencilOffsets;
104 std::string description;
105 };
106
107 void GetStructuredGraph(RCP<Matrix>& Ac, const RCP<Matrix>& P,
108 const Teuchos::Array<LocalOrdinal>& lCoarseNodesPerDim,
109 const StructuredGraphSpec& graphSpec) const;
110
112 const Matrix& A, int numDimensions,
113 const Teuchos::Array<LocalOrdinal>& lFineNodesPerDim) const;
114
116 const FineStencilSpec& fineStencil,
117 int interpolationOrder) const;
118
119 private:
121
122 mutable bool hasDeclaredInput_;
123
125
127
129 std::vector<RCP<const FactoryBase>> transferFacts_;
130
132
134
135 void ConfigureRAPFactoryDelegate() const;
136
137 RCP<const FactoryBase> GetStructuredMetadataFactory(const std::string& varName) const;
138
139 mutable RCP<MueLu::RAPFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>> rapFactoryDelegate_;
140
141 //}
142
143}; // class StructuredRAPFactory
144
145} // namespace MueLu
146
147#define MUELU_STRUCTUREDRAPFACTORY_SHORT
148#endif // MUELU_STRUCTUREDRAPFACTORY_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Class that holds all level-specific information.
virtual ~StructuredRAPFactory()=default
RCP< const FactoryBase > GetStructuredMetadataFactory(const std::string &varName) const
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 DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
void Build(Level &fineLevel, Level &coarseLevel) const
Build an object with this factory.
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
void GetStructuredGraph(RCP< Matrix > &Ac, const RCP< Matrix > &P, const Teuchos::Array< LocalOrdinal > &lCoarseNodesPerDim, const StructuredGraphSpec &graphSpec) const
StructuredGraphSpec DeriveCoarseRAPStencil(const FineStencilSpec &fineStencil, int interpolationOrder) const
FineStencilSpec DetectFineStencil(const Matrix &A, int numDimensions, const Teuchos::Array< LocalOrdinal > &lFineNodesPerDim) const
TwoLevelFactoryBase()
Constructor.
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar
LocalOrdinal rowDof
StencilOffset offset
LocalOrdinal columnDof