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

Re: [petsc-users] MatMatMult causes crash

2017-01-19 Thread Cyrill Vonplanta
integers are not large enough for the problem. Try configuring on the cray with --with-64-bit-indices Barry On Jan 19, 2017, at 7:14 AM, Cyrill Vonplanta mailto:cyrill.von.pla...@usi.ch>> wrote: Dear PETSc Users, I have a problem with a solver running on a cray machine that crashes at th

[petsc-users] MatMatMult causes crash

2017-01-19 Thread Cyrill Vonplanta
Dear PETSc Users, I have a problem with a solver running on a cray machine that crashes at the command “MatMatMult” (see error message below). When i run the same solver on my machine in serial or parallel it runs through, also when I look at it with -malloc_debug there doesn’t seem to be any

Re: [petsc-users] MatSOR and GaussSeidel

2016-09-27 Thread Cyrill Vonplanta
23 Aug 2016, at 16:54, Jed Brown wrote: > > Cyrill Vonplanta writes: > >> Dear PETSc-Users, >> >> I am debugging a smoother of ours and i was wondering what settings of >> MatSOR exactly form one ordinary Gauss Seidel smoothing step. Currently I >> use

Re: [petsc-users] Example for MatInvertBlockDiagonal

2016-09-27 Thread Cyrill Vonplanta
> >> On Sep 19, 2016, at 2:21 PM, Cyrill Vonplanta >> wrote: >> >> >>> block size > 1 really only makes sense if the block size is really greater >>> than one. So if A has blocks of size 3 you should create A as BAIJ and thus >>> never n

Re: [petsc-users] Example for MatInvertBlockDiagonal

2016-09-19 Thread Cyrill Vonplanta
> block size > 1 really only makes sense if the block size is really greater > than one. So if A has blocks of size 3 you should create A as BAIJ and thus > never need to call the convert routine. Unfortunately A is not created by my part of the program and comes with blocksize 1. > > You

Re: [petsc-users] Example for MatInvertBlockDiagonal

2016-09-19 Thread Cyrill Vonplanta
of the block > diagonals in column major form. You can then call MatSetValues() with with > each of those blocks into another PETSc matrix. values[i*bs*bs] is the > starting point of each block in the array. > > Barry > >> On Sep 19, 2016, at 4:55 AM, Cyrill Vonplanta &

[petsc-users] Example for MatInvertBlockDiagonal

2016-09-19 Thread Cyrill Vonplanta
Dear PETSc-Users, I would like to use the inverted block diagonals of a a matrix. I have seen the function MatInvertBlockDiagonal() but I don’t know how to create a matrix out of them or an array of block matrizes. Does anyone have an example on how to use **values to create a PETSc matrix? T

[petsc-users] MatSOR and GaussSeidel

2016-08-23 Thread Cyrill Vonplanta
Dear PETSc-Users, I am debugging a smoother of ours and i was wondering what settings of MatSOR exactly form one ordinary Gauss Seidel smoothing step. Currently I use: ierr = MatSOR(A,b,1.0,(MatSORType)(SOR_ZERO_INITIAL_GUESS | SOR_FORWARD_SWEEP),0,1,1,x); CHKERRV(ierr); I expect this to be th

Re: [petsc-users] Reordering rows of parallel matrix across processors

2016-07-08 Thread Cyrill Vonplanta
Cyrill mailto:cyrill.von.pla...@usi.ch>> Cc: "petsc-users@mcs.anl.gov<mailto:petsc-users@mcs.anl.gov>" mailto:petsc-users@mcs.anl.gov>> Subject: Re: [petsc-users] Reordering rows of parallel matrix across processors On Thu, Jul 7, 2016 at 3:37 AM, Cyrill Vonplanta mailt

[petsc-users] Reordering rows of parallel matrix across processors

2016-07-07 Thread Cyrill Vonplanta
Dear all, I would like to reorder the rows of a matrix across processors. Is this possible with MatPermute(…)? To illustrate here is how an index set would look like for a matrix with M=35 on 2 CPU’s. Amongst other things I intend to swap the first and last row here. [0] Number of indices in

Re: [petsc-users] Example for FAS

2016-03-01 Thread Cyrill Vonplanta
Thanks a lot. Checking out with example 5 works fine, problem solved (for now). Cyrill

[petsc-users] Example for FAS

2016-03-01 Thread Cyrill Vonplanta
Dear PETSc User-list, I am trying to use the FAS from PETSc in version 3.6.3. For other solvers there would be usually an example or two on the documentation, but on http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESFAS.html I couldn’t find one at the bottom. Does anybody ha