Re: [petsc-users] Clarification on MatMPIBAIJSetPreallocation (d_nnz and o_nnz)

2022-10-24 Thread Jed Brown
This looks like one block row per process? (BAIJ formats store explicit zeros that appear within nonzero blocks.) You'd use d_nnz[] = {1}, o_nnz[] = {1} on each process. If each of the dummy numbers there was replaced by a nonzero block (so the diagram would be sketching nonzero 3x3 blocks of

Re: [petsc-users] Clarification on MatMPIBAIJSetPreallocation (d_nnz and o_nnz)

2022-10-24 Thread Edoardo alinovi
Thank you Jed for the hint. So just to understand it with an example. Say I have this matrix here, which has 4 3x3 blocks 1 2 0 | 0 5 0 | 0 2 3 | 0 0 1 | < Proc 1 0 0 1 | 0 2 2 | || 1 2 0 | 0 5 0 | 0 2 0 | 0 0 1 | < Proc 2 0 0 1 | 0 0 2 | ---|-|

Re: [petsc-users] Clarification on MatMPIBAIJSetPreallocation (d_nnz and o_nnz)

2022-10-24 Thread Jed Brown
I recommend calling this one preallocation function, which will preallocate scalar and block formats. It takes one value per block row, counting in blocks. https://petsc.org/release/docs/manualpages/Mat/MatXAIJSetPreallocation/ Edoardo alinovi writes: > Hello Barry, > > I am doing some

[petsc-users] Clarification on MatMPIBAIJSetPreallocation (d_nnz and o_nnz)

2022-10-24 Thread Edoardo alinovi
Hello Barry, I am doing some preliminary work to add a coupled solver in my code. I am reading some documentation on MPIBAIJ as the matrix will be composed of blocks of size 3x3 in 2D and 4x4 in 3D for each cell in the domain. I can't quite understand how to set d_nnz and o_nnz. What is their