33#ifndef GKO_PUBLIC_CORE_MULTIGRID_MULTIGRID_LEVEL_HPP_
34#define GKO_PUBLIC_CORE_MULTIGRID_MULTIGRID_LEVEL_HPP_
41#include <ginkgo/core/base/abstract_factory.hpp>
42#include <ginkgo/core/base/composition.hpp>
43#include <ginkgo/core/base/exception_helpers.hpp>
44#include <ginkgo/core/base/lin_op.hpp>
45#include <ginkgo/core/base/utils.hpp>
109template <
typename ValueType>
113 using value_type = ValueType;
144 void set_multigrid_level(std::shared_ptr<const LinOp>
prolong_op,
150 GKO_ASSERT_EQUAL_DIMENSIONS(fine_op_->get_size(),
mg_size);
161 void set_fine_op(std::shared_ptr<const LinOp>
fine_op)
163 GKO_ASSERT_EQUAL_DIMENSIONS(fine_op_->get_size(),
fine_op->get_size());
167 explicit EnableMultigridLevel() {}
178 explicit EnableMultigridLevel(std::shared_ptr<const LinOp>
fine_op)
183 std::shared_ptr<const LinOp> fine_op_;
The UseComposition class can be used to store the composition information in LinOp.
Definition composition.hpp:206
std::shared_ptr< const LinOp > get_operator_at(size_type index) const
Returns the operator at index-th position of composition.
Definition composition.hpp:231
The EnableMultigridLevel gives the default implementation of MultigridLevel with composition and prov...
Definition multigrid_level.hpp:111
std::shared_ptr< const LinOp > get_prolong_op() const override
Returns the prolong operator.
Definition multigrid_level.hpp:130
std::shared_ptr< const LinOp > get_restrict_op() const override
Returns the restrict operator.
Definition multigrid_level.hpp:120
std::shared_ptr< const LinOp > get_coarse_op() const override
Returns the operator on coarse level.
Definition multigrid_level.hpp:125
std::shared_ptr< const LinOp > get_fine_op() const override
Returns the operator on fine level.
Definition multigrid_level.hpp:115
This class represents two levels in a multigrid hierarchy.
Definition multigrid_level.hpp:67
virtual std::shared_ptr< const LinOp > get_prolong_op() const =0
Returns the prolong operator.
virtual std::shared_ptr< const LinOp > get_fine_op() const =0
Returns the operator on fine level.
virtual std::shared_ptr< const LinOp > get_restrict_op() const =0
Returns the restrict operator.
virtual std::shared_ptr< const LinOp > get_coarse_op() const =0
Returns the operator on coarse level.
The Ginkgo namespace.
Definition abstract_factory.hpp:48
constexpr T one()
Returns the multiplicative identity for T.
Definition math.hpp:803
A type representing the dimensions of a multidimensional object.
Definition dim.hpp:55