Re: [petsc-users] Compute the sum of the absolute values of the off-block diagonal entries of each row

2019-03-05 Thread Cyrill Vonplanta via petsc-users
rE-rS; ++r) { >> sum = 0.0; >> MatGetRow(Ao, r, &ncols, NULL, &vals); >> for (c = 0; c < ncols; ++c) sum += PetscAbsScalar(vals[c]); > // do what you need with sum >> } > > > Barry > > > >> On Mar 4, 2019, at 10:38 AM, Matth

[petsc-users] Compute the sum of the absolute values of the off-block diagonal entries of each row

2019-03-04 Thread Cyrill Vonplanta via petsc-users
Dear Petsc Users, I am trying to implement a variant of the $l^1$-Gauss-Seidel smoother from https://doi.org/10.1137/100798806 (eq. 6.1 and below). One of the main issues is that I need to compute the sum $\sum_j |a_{i_j}|$ of the matrix entries that are not part of the local diagonal block. I