1#ifndef AMREX_SMOOTHER_MV_H_
2#define AMREX_SMOOTHER_MV_H_
38 int setNumIters (
int a_niters) {
return std::exchange(m_niters, a_niters); }
48 bool with_initial_guess =
false)
50 auto const& diag = m_A->diagonalVector();
52 if ( ! with_initial_guess) {
55 for (
int iter = 0; iter < m_niters; ++iter) {
56 if ((iter == 0) && ! with_initial_guess) {
59 SpMV(Axvec, *m_A, xvec);
61 ForEach(xvec, Axvec, bvec, diag,
65 x += (b-ax)/d * T(2./3.);
#define AMREX_GPU_DEVICE
Definition AMReX_GpuQualifiers.H:18
Distributed dense vector that mirrors the layout of an AlgPartition.
Definition AMReX_AlgVector.H:29
void setVal(T val)
Definition AMReX_AlgVector.H:275
AlgPartition const & partition() const
Partition describing the global layout of the vector.
Definition AMReX_AlgVector.H:71
Weighted-Jacobi smoother for AlgVector/SpMatrix linear systems.
Definition AMReX_Smoother_MV.H:23
JacobiSmoother(SpMatrix< T > const *a_A)
Construct a weighted-Jacobi smoother that operates on a_A.
Definition AMReX_Smoother_MV.H:30
int setNumIters(int a_niters)
Update how many Jacobi sweeps to perform per apply.
Definition AMReX_Smoother_MV.H:38
void operator()(AlgVector< T > &xvec, AlgVector< T > const &bvec, bool with_initial_guess=false)
Apply the smoother to solve approximately for xvec.
Definition AMReX_Smoother_MV.H:47
Distributed CSR matrix that manages storage and GPU-friendly partitions.
Definition AMReX_SpMatrix.H:61
void streamSynchronize() noexcept
Definition AMReX_GpuDevice.H:310
Definition AMReX_Amr.cpp:49
constexpr void ForEach(TypeList< Ts... >, F &&f)
For each type t in TypeList, call f(t)
Definition AMReX_TypeList.H:83
void SpMV(Long nrows, Long ncols, T *__restrict__ py, CsrView< T const > const &A, T const *__restrict__ px)
Perform y = A * x using CSR data (GPU/CPU aware).
Definition AMReX_SpMV.H:28