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

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


Found my way to the answer of the first question:
ksp/ksp/examples/tutorials/ex13f90.F90

With respect to question 2...
I'm still confused about this behaviour of the DMPlex; or I am missing
something.

Best regards.
Bernardo

On Tue, Apr 10, 2018 at 3:19 PM, Bernardo Rocha <
bernardomartinsrocha at gmail.com> wrote:

> 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/569af955/attachment.html>


More information about the petsc-users mailing list