So let me try to clarify again:
let say I have n nodes on my mesh, the nodes have 8dofs that I label 1 1 2 4 4 4 4 3.
What I want is to build a list of all the degrees of freedom with their label.
To get this list I run the following code
do i = 0, numnp-1
do dof = 1,ndf
ii = i*ndf+dof-1
k = mr(np(245) + ii)
jj = fsind(dof)
if( k .gt. 0 ) then
fsmax(jj) = fsmax(jj)+1
j = fsmax(jj)
indices(jj,j) = k-1
call PetscSectionSetDof(FSSection, k, 1, ierr)
call PetscSectionSetFieldDof(FSSection, k, jj-1, 1,
& ierr)
endif
enddo
enddo
This work fine in serial (or with parfeap on 1 processor) but when multiple processes are started this crashes.
You see that I check program array np(245) to detect Dirichlet BC and not take these dofs into account in my list.
This list is great because it allows me to use PETSc's FIELDSPLIT preconditioners, but so far I haven't found a stable implementation for multiple partition simulations. I will read the parallel manual again to find the mapping from local to global and try to work with it.
But the major point here is to create the hole list and pass it a PETSc DM, and to do that I need to collect the partial lists of all my partitions and gather them into one big list.
Any idea on how to do that ?