[petsc-users] PETSc version 3.9 with Fortran and DMPlex questions

Bernardo Rocha bernardomartinsrocha at gmail.com
Tue Apr 10 13:19:29 CDT 2018


Hi everyone,

I have two questions.

(Q1)
The first one is related to the new PETSc 3.9.
I've been using Fortran and using the "userctx" to wrap some data
for the function calls within my program.

Just like : call func(...,userctx)
and retrieving data as:
PetscFortranAddr userctx(*)
b = userctx(2)

With the new version I got the following error:
b = userctx(2)
Error: Can't convert INTEGER(8) to TYPE(tvec) at (1)

Is there a way to keep using the trick with "userctx", instead of passing
all the arguments to the functions separately?

(Q2)
The second is related to DMPlex.
When I use the CreateBoxMesh with 2x1x1 cells, I get the expected output:

DM Object: 1 MPI processes
  type: plex
DM_0x84000000_0 in 3 dimensions:
  0-cells: 12
 * 1-cells: 20*
  *2-cells: 11*
  3-cells: 2
Labels:
  depth: 4 strata with value/size (0 (12), 1 (20), 2 (11), 3 (2))

However, If I try to create that manually to reproduce the same case 2x1x1
cells (creating this simple element connectivity by hand) using
DMPlexCreateFromCellList I get the following:

DM Object: DM_0x84000000_0 1 MPI processes
  type: plex
DM_0x84000000_0 in 3 dimensions:
  0-cells: 12
  *1-cells: 22*
*  2-cells: 12*
  3-cells: 2
Labels:
  depth: 4 strata with value/size (0 (12), 1 (22), 2 (12), 3 (2))

That is, it seems the shared face between the two cells is counted twice.
Is that right? What am I missing here?

Best regards,
Bernardo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180410/39f4f5d6/attachment.html>


More information about the petsc-users mailing list