cpr_amg_operations.hpp
Go to the documentation of this file.
1/*
2 Copyright 2025 Equinor ASA
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef OPM_GPU_CPR_AMG_OPERATIONS_HPP
20#define OPM_GPU_CPR_AMG_OPERATIONS_HPP
21
24
25#include <cstddef>
26
28{
29
38template <typename T, bool transpose>
40 std::size_t pressureVarIndex,
41 GpuVector<T>& weights,
42 const GpuVector<int>& diagonalIndices);
43
52template <typename T, bool transpose>
54 GpuSparseMatrixWrapper<T>& coarseMatrix,
55 const GpuVector<T>& weights,
56 std::size_t pressureVarIndex);
57
58
67template <typename T, bool transpose>
69 GpuVector<T>& coarse,
70 const GpuVector<T>& weights,
71 std::size_t pressureVarIndex);
72
81template <typename T, bool transpose>
82void prolongateVector(const GpuVector<T>& coarse,
83 GpuVector<T>& fine,
84 const GpuVector<T>& weights,
85 std::size_t pressureVarIndex);
86
87} // namespace Opm::gpuistl::detail
88
89#endif // OPM_GPU_CPR_AMG_OPERATIONS_HPP
The GpuSparseMatrixWrapper Checks CUDA/HIP version and dispatches a version either using the old or t...
Definition: GpuSparseMatrixWrapper.hpp:61
Definition: gpu_type_detection.hpp:30
Definition: autotuner.hpp:30
void calculateCoarseEntries(const GpuSparseMatrixWrapper< T > &fineMatrix, GpuSparseMatrixWrapper< T > &coarseMatrix, const GpuVector< T > &weights, std::size_t pressureVarIndex)
Calculates the coarse level matrix entries based on the fine level matrix and weights.
void restrictVector(const GpuVector< T > &fine, GpuVector< T > &coarse, const GpuVector< T > &weights, std::size_t pressureVarIndex)
Restricts a fine level vector to a coarse level vector based on pressure index.
void getQuasiImpesWeights(const GpuSparseMatrixWrapper< T > &matrix, std::size_t pressureVarIndex, GpuVector< T > &weights, const GpuVector< int > &diagonalIndices)
Calculates quasi-IMPES weights for CPR preconditioner on GPU.
void prolongateVector(const GpuVector< T > &coarse, GpuVector< T > &fine, const GpuVector< T > &weights, std::size_t pressureVarIndex)
Prolongs a coarse level vector to a fine level vector based on pressure index.