[petsc-dev] PetscSF in Fortran

Adrian Croucher a.croucher at auckland.ac.nz
Tue Sep 26 22:49:51 CDT 2017

hi Matt,

On 25/09/17 23:12, Matthew Knepley wrote:
> If you truly need the exact same SF for your grid, you should be able 
> to use DMGet/SetPointSF() since it will just reference count it for 
> you. Then
> the default SF is created automatically from the point SF. Does this work?

It doesn't seem to work, unfortunately. If I run in parallel I get an 
error on each processor like this:

[0]PETSC ERROR: Nonconforming object sizes
[0]PETSC ERROR: SF roots 447 < pEnd 543
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html 
for trouble shooting.
[0]PETSC ERROR: Petsc Development GIT revision: v3.7.6-5886-gc423942  
GIT Date: 2017-06-28 18:43:52 -0500
[0]PETSC ERROR: test_all on a linux-gnu-c-opt named en-354401 by acro018 
Wed Sep 27 16:31:28 2017
[0]PETSC ERROR: Configure options --with-x --download-hdf5 
--download-netcdf --download-exodusii --downloa
d-triangle --download-ptscotch --download-chaco --download-hypre
[0]PETSC ERROR: #1 PetscSectionCreateGlobalSection() line 929 in 
[0]PETSC ERROR: #2 DMGetDefaultGlobalSection() line 3458 in 
[0]PETSC ERROR: #3 User provided function() line 0 in User file

The reason I thought just copying the SF across might work is that the 
partition ghost cells in my modified DMPlex should be in the same 
locations (DMPlex points) as they were in the original DMPlex. My 
understanding was that the SF just stores the root corresponding to a 
leaf (ghost point?) on the current processor, so those ought to be 
unchanged. But maybe there are subtleties about the SF stuff that I 
don't yet understand.

What I am doing is adding new points for the dual-porosity mesh into my 
modified DMPlex. I have added the new cells after the partition ghost 
cells, and before the boundary ghost cells (and similarly for other 
depth strata). So I have shifted the locations of the boundary ghost 
cells, but not the partition ghost cells. I give the new points the 
appropriate depth label values so that the depth stratum bounds are 
updated correctly. I also shift the end_interior value for each depth 
stratum, so that code relying on DMPlexGetHybridBounds() should still work.

Would you expect copying the SF to work in this case?

- Adrian

Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
University of Auckland, New Zealand
email: a.croucher at auckland.ac.nz
tel: +64 (0)9 923 4611

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170927/656c8e37/attachment.html>

More information about the petsc-dev mailing list