5 #ifndef GKO_PUBLIC_CORE_MULTIGRID_MULTIGRID_LEVEL_HPP_
6 #define GKO_PUBLIC_CORE_MULTIGRID_MULTIGRID_LEVEL_HPP_
12 #include <ginkgo/core/base/abstract_factory.hpp>
13 #include <ginkgo/core/base/composition.hpp>
14 #include <ginkgo/core/base/exception_helpers.hpp>
15 #include <ginkgo/core/base/lin_op.hpp>
16 #include <ginkgo/core/base/utils.hpp>
45 virtual std::shared_ptr<const LinOp>
get_fine_op()
const = 0;
59 virtual std::shared_ptr<const LinOp>
get_coarse_op()
const = 0;
80 template <
typename ValueType>
84 using value_type = ValueType;
115 void set_multigrid_level(std::shared_ptr<const LinOp> prolong_op,
116 std::shared_ptr<const LinOp> coarse_op,
117 std::shared_ptr<const LinOp> restrict_op)
120 restrict_op->get_size()[1]};
121 GKO_ASSERT_EQUAL_DIMENSIONS(fine_op_->get_size(), mg_size);
123 this->set_composition(prolong_op, coarse_op, restrict_op);
132 void set_fine_op(std::shared_ptr<const LinOp> fine_op)
134 GKO_ASSERT_EQUAL_DIMENSIONS(fine_op_->get_size(), fine_op->get_size());
138 explicit EnableMultigridLevel() {}
149 explicit EnableMultigridLevel(std::shared_ptr<const LinOp> fine_op)
154 std::shared_ptr<const LinOp> fine_op_;
162 #endif // GKO_PUBLIC_CORE_MULTIGRID_MULTIGRID_LEVEL_HPP_