 |
Ginkgo
Generated from pipelines/3136675824 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/multivector.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>());
162 :
LinOp(std::move(exec))
165 explicit UniformCoarsening(
const Factory* factory,
166 std::shared_ptr<const LinOp> system_matrix)
168 EnableMultigridLevel<ValueType>(system_matrix),
169 parameters_{factory->get_parameters()},
170 system_matrix_{system_matrix}
172 if (system_matrix_->get_size()[0] != 0) {
186 std::tuple<std::shared_ptr<LinOp>, std::shared_ptr<LinOp>,
187 std::shared_ptr<LinOp>>
189 std::shared_ptr<
const matrix::Csr<ValueType, IndexType>> local_matrix);
201 template <
typename GlobalIndexType>
202 array<GlobalIndexType> communicate_non_local_agg(
203 std::shared_ptr<
const experimental::distributed::Matrix<
204 ValueType, IndexType, GlobalIndexType>>
207 experimental::distributed::Partition<IndexType, GlobalIndexType>>
209 const array<IndexType>& local_agg);
213 std::shared_ptr<const LinOp> system_matrix_{};
214 array<IndexType> coarse_rows_;
222 #endif // GKO_PUBLIC_CORE_MULTIGRID_UNIFORM_COARSENING_HPP_
pnode describes a tree of properties.
Definition: property_tree.hpp:28
Definition: lin_op.hpp:163
std::shared_ptr< Composition< ValueType > > get_composition() const
Returns the composition operators.
Definition: composition.hpp:189
#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:1192
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
Abstract interface class for (multi-)vector types.
Definition: multivector.hpp:81
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:259