Loading...
Searching...
No Matches
cpr_amg_operations.hpp
/*
Copyright 2025 Equinor ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_GPU_CPR_AMG_OPERATIONS_HPP
#define OPM_GPU_CPR_AMG_OPERATIONS_HPP
#include <opm/simulators/linalg/gpuistl/GpuSparseMatrixWrapper.hpp>
#include <opm/simulators/linalg/gpuistl/GpuVector.hpp>
#include <cstddef>
namespace Opm::gpuistl::detail
{
template <typename T, bool transpose>
void getQuasiImpesWeights(const GpuSparseMatrixWrapper<T>& matrix,
std::size_t pressureVarIndex,
GpuVector<T>& weights,
const GpuVector<int>& diagonalIndices);
template <typename T, bool transpose>
void calculateCoarseEntries(const GpuSparseMatrixWrapper<T>& fineMatrix,
GpuSparseMatrixWrapper<T>& coarseMatrix,
const GpuVector<T>& weights,
std::size_t pressureVarIndex);
template <typename T, bool transpose>
void restrictVector(const GpuVector<T>& fine,
GpuVector<T>& coarse,
const GpuVector<T>& weights,
std::size_t pressureVarIndex);
template <typename T, bool transpose>
void prolongateVector(const GpuVector<T>& coarse,
GpuVector<T>& fine,
const GpuVector<T>& weights,
std::size_t pressureVarIndex);
} // namespace Opm::gpuistl::detail
#endif // OPM_GPU_CPR_AMG_OPERATIONS_HPP
Opm::gpuistl::GpuSparseMatrixWrapper
The GpuSparseMatrixWrapper Checks CUDA/HIP version and dispatches a version either using the old or t...
Definition GpuSparseMatrixWrapper.hpp:61
Opm::gpuistl::GpuVector
Definition gpu_type_detection.hpp:30
Opm::gpuistl::detail
Contains wrappers to make the CuBLAS library behave as a modern C++ library with function overlading.
Definition autotuner.hpp:30
Opm::gpuistl::detail::calculateCoarseEntries
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.
Opm::gpuistl::detail::restrictVector
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.
Opm::gpuistl::detail::getQuasiImpesWeights
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.
Opm::gpuistl::detail::prolongateVector
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.