19#ifndef OPM_CUSEQILU0_HPP
20#define OPM_CUSEQILU0_HPP
22#include <dune/istl/preconditioner.hh>
23#include <opm/simulators/linalg/PreconditionerWithUpdate.hpp>
24#include <opm/simulators/linalg/cuistl/CuSparseMatrix.hpp>
25#include <opm/simulators/linalg/cuistl/detail/CuMatrixDescription.hpp>
26#include <opm/simulators/linalg/cuistl/detail/CuSparseHandle.hpp>
27#include <opm/simulators/linalg/cuistl/detail/CuSparseResource.hpp>
48template <
class M,
class X,
class Y,
int l = 1>
71 virtual void pre(X& x, Y&
b)
override;
74 virtual void apply(X&
v,
const Y&
d)
override;
78 virtual void post(X& x)
override;
81 virtual Dune::SolverCategory::Category
category()
const override;
84 virtual void update()
override;
102 const M& m_underlyingMatrix;
120 std::unique_ptr<CuVector<field_type>> m_buffer;
123 bool m_analysisDone =
false;
125 void analyzeMatrix();
126 size_t findBufferSize();
130 void updateILUConfiguration();
Interface class adding the update() method to the preconditioner interface.
Definition PreconditionerWithUpdate.hpp:32
Definition AquiferInterface.hpp:35
Sequential ILU0 preconditioner on the GPU through the CuSparse library.
Definition CuSeqILU0.hpp:50
virtual void pre(X &x, Y &b) override
Prepare the preconditioner.
Definition CuSeqILU0.cpp:73
virtual Dune::SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category)
Definition CuSeqILU0.cpp:142
typename X::field_type field_type
The field type of the preconditioner.
Definition CuSeqILU0.hpp:59
static constexpr bool shouldCallPre()
Definition CuSeqILU0.hpp:88
typename std::remove_const< M >::type matrix_type
The matrix type the preconditioner is for.
Definition CuSeqILU0.hpp:53
static constexpr bool shouldCallPost()
Definition CuSeqILU0.hpp:94
virtual void update() override
Updates the matrix data.
Definition CuSeqILU0.cpp:149
Y range_type
The range type of the preconditioner.
Definition CuSeqILU0.hpp:57
virtual void apply(X &v, const Y &d) override
Apply the preconditoner.
Definition CuSeqILU0.cpp:79
X domain_type
The domain type of the preconditioner.
Definition CuSeqILU0.hpp:55
virtual void post(X &x) override
Post processing.
Definition CuSeqILU0.cpp:136
The CuSparseHandle class provides a singleton for the simulator universal cuSparseHandle.
Definition CuSparseHandle.hpp:41
The CuSparseResource class wraps a CuSparse resource in a proper RAII pattern.
Definition CuSparseResource.hpp:55
std::shared_ptr< CuSparseResource< cusparseMatDescr_t > > CuSparseMatrixDescriptionPtr
Pointer to CuSparseMatrixDescription holder.
Definition CuMatrixDescription.hpp:35