5#ifndef GKO_PUBLIC_CORE_DISTRIBUTED_PRECONDITIONER_SCHWARZ_HPP_
6#define GKO_PUBLIC_CORE_DISTRIBUTED_PRECONDITIONER_SCHWARZ_HPP_
9#include <ginkgo/config.hpp>
15#include <ginkgo/core/base/abstract_factory.hpp>
16#include <ginkgo/core/base/lin_op.hpp>
17#include <ginkgo/core/distributed/matrix.hpp>
18#include <ginkgo/core/distributed/vector.hpp>
22namespace experimental {
23namespace distributed {
29namespace preconditioner {
50 typename LocalIndexType =
int32,
typename GlobalIndexType =
int64>
52 :
public EnableLinOp<Schwarz<ValueType, LocalIndexType, GlobalIndexType>> {
59 using value_type = ValueType;
60 using index_type = GlobalIndexType;
61 using local_index_type = LocalIndexType;
62 using global_index_type = GlobalIndexType;
69 std::shared_ptr<const LinOpFactory> GKO_DEFERRED_FACTORY_PARAMETER(
76 generated_local_solver,
nullptr);
87 explicit Schwarz(std::shared_ptr<const Executor> exec)
99 std::shared_ptr<const LinOp> system_matrix)
102 parameters_{factory->get_parameters()}
104 this->generate(system_matrix);
110 void generate(std::shared_ptr<const LinOp> system_matrix);
112 void apply_impl(
const LinOp* b,
LinOp* x)
const override;
114 template <
typename VectorType>
115 void apply_dense_impl(
const VectorType* b, VectorType* x)
const;
118 LinOp* x)
const override;
126 void set_solver(std::shared_ptr<const LinOp> new_solver);
128 std::shared_ptr<const LinOp> local_solver_;
The EnableLinOp mixin can be used to provide sensible default implementations of the majority of the ...
Definition lin_op.hpp:880
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition polymorphic_object.hpp:663
Definition lin_op.hpp:118
const dim< 2 > & get_size() const noexcept
Returns the size of the operator.
Definition lin_op.hpp:211
std::shared_ptr< const Executor > get_executor() const noexcept
Returns the Executor of the object.
Definition polymorphic_object.hpp:235
Definition schwarz.hpp:78
A Schwarz preconditioner is a simple domain decomposition preconditioner that generalizes the Block J...
Definition schwarz.hpp:52
#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:280
#define GKO_FACTORY_PARAMETER_SCALAR(_name, _default)
Creates a scalar factory parameter in the factory parameters structure.
Definition abstract_factory.hpp:445
#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:394
#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:1018
The Ginkgo namespace.
Definition abstract_factory.hpp:20
std::int32_t int32
32-bit signed integral type.
Definition types.hpp:103
double default_precision
Precision used if no precision is explicitly specified.
Definition types.hpp:171
std::int64_t int64
64-bit signed integral type.
Definition types.hpp:109
batch_dim< 2, DimensionType > transpose(const batch_dim< 2, DimensionType > &input)
Returns a batch_dim object with its dimensions swapped for batched operators.
Definition batch_dim.hpp:120