 |
Ginkgo
Generated from pipelines/2837190956 branch based on develop. Ginkgo version 2.0.0
A numerical linear algebra library targeting many-core architectures
|
5 #ifndef GKO_PUBLIC_CORE_MULTIGRID_UNIFORM_COARSENING_HPP_
6 #define GKO_PUBLIC_CORE_MULTIGRID_UNIFORM_COARSENING_HPP_
11 #include <ginkgo/core/base/composition.hpp>
12 #include <ginkgo/core/base/exception_helpers.hpp>
13 #include <ginkgo/core/base/lin_op.hpp>
14 #include <ginkgo/core/base/types.hpp>
15 #include <ginkgo/core/config/config.hpp>
16 #include <ginkgo/core/config/registry.hpp>
17 #include <ginkgo/core/config/type_descriptor.hpp>
18 #include <ginkgo/core/matrix/csr.hpp>
19 #include <ginkgo/core/matrix/dense.hpp>
20 #include <ginkgo/core/multigrid/multigrid_level.hpp>
23 namespace experimental {
24 namespace distributed {
27 template <
typename ValueType,
typename LocalIndexType,
typename GlobalIndexType>
30 template <
typename LocalIndexType,
typename GlobalIndexType>
58 template <
typename ValueType = default_precision,
typename IndexType =
int32>
59 class UniformCoarsening :
public LinOp,
public EnableMultigridLevel<ValueType> {
60 GKO_ASSERT_SUPPORTED_VALUE_AND_INDEX_TYPE;
63 using value_type = ValueType;
64 using index_type = IndexType;
73 return system_matrix_;
141 static parameters_type
parse(
144 config::make_type_descriptor<ValueType, IndexType>());
147 void apply_impl(
const LinOp* b,
LinOp* x)
const override
153 LinOp* x)
const override
159 :
LinOp(std::move(exec))
162 explicit UniformCoarsening(
const Factory* factory,
163 std::shared_ptr<const LinOp> system_matrix)
165 EnableMultigridLevel<ValueType>(system_matrix),
166 parameters_{factory->get_parameters()},
167 system_matrix_{system_matrix}
169 if (system_matrix_->get_size()[0] != 0) {
183 std::tuple<std::shared_ptr<LinOp>, std::shared_ptr<LinOp>,
184 std::shared_ptr<LinOp>>
186 std::shared_ptr<
const matrix::Csr<ValueType, IndexType>> local_matrix);
198 template <
typename GlobalIndexType>
199 array<GlobalIndexType> communicate_non_local_agg(
200 std::shared_ptr<
const experimental::distributed::Matrix<
201 ValueType, IndexType, GlobalIndexType>>
204 experimental::distributed::Partition<IndexType, GlobalIndexType>>
206 const array<IndexType>& local_agg);
210 std::shared_ptr<const LinOp> system_matrix_{};
211 array<IndexType> coarse_rows_;
219 #endif // GKO_PUBLIC_CORE_MULTIGRID_UNIFORM_COARSENING_HPP_
pnode describes a tree of properties.
Definition: property_tree.hpp:28
Definition: lin_op.hpp:117
std::shared_ptr< Composition< ValueType > > get_composition() const
Returns the composition operators.
Definition: composition.hpp:186
#define GKO_FACTORY_PARAMETER_SCALAR(_name, _default)
Creates a scalar factory parameter in the factory parameters structure.
Definition: abstract_factory.hpp:469
This class describes the value and index types to be used when building a Ginkgo type from a configur...
Definition: type_descriptor.hpp:39
The Ginkgo namespace.
Definition: abstract_factory.hpp:19
#define GKO_ENABLE_LIN_OP_FACTORY(_lin_op, _parameters_name, _factory_name)
This macro will generate a default implementation of a LinOpFactory for the LinOp subclass it is defi...
Definition: lin_op.hpp:899
value_type * get_data() noexcept
Returns a pointer to the block of memory used to store the elements of the array.
Definition: array.hpp:686
This class stores additional context for creating Ginkgo objects from configuration files.
Definition: registry.hpp:167
#define GKO_ENABLE_BUILD_METHOD(_factory_name)
Defines a build method for the factory, simplifying its construction by removing the repetitive typin...
Definition: abstract_factory.hpp:418
#define GKO_CREATE_FACTORY_PARAMETERS(_parameters_name, _factory_name)
This Macro will generate a new type containing the parameters for the factory _factory_name.
Definition: abstract_factory.hpp:304
const value_type * get_const_data() const noexcept
Returns a constant pointer to the block of memory used to store the elements of the array.
Definition: array.hpp:695
std::shared_ptr< const Executor > get_executor() const noexcept
Returns the Executor of the object.
Definition: polymorphic_object.hpp:69
const dim< 2 > & get_size() const noexcept
Returns the size of the operator.
Definition: lin_op.hpp:169