Greetings my dear PETSc list.

In my Fortran Code, I usually checked against PETSC_NULL_DM or
PETSC_NULL_IS after calling methods such as DMPlexDistribute or
DMGetStratumIS.

Recently this fails me.

I saw the DMPlexDistribute example in
dm/label/examples/tutorials/ex1f90.F90

where the value of dm_distributed%v is compared against -1

Now, after the recent change of PETSC_NULL_DM (tDM(1) -> tDM(0) in
3d1df95b1) I am not 100% percent sure how to deal with it.

Could you please clarify if testing against ``-1`` is the intended way
to do it or may this change again soonish?

Many Thanks,

Fabian


Here some code snippets to clarify what lead me to put up this question...

This used to validate:

call DMGetStratumIS(dm, 'DomainBoundary', SIDEFACE, bc_idx, ierr)
if (bc_ids.eq.PETSC_NULL_IS) then ! dont have domain boundary points
...
endif

or

call DMPlexDistribute(dm, i0, PETSC_NULL_SF, dmdist, ierr)
if (dmdist.eq.PETSC_NULL_DM) then ! DM was not distributed
endif


Now I could do something like:

if(bc_ids%v.eq.-1)

of (dmdist%v.eq.-1)

...

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to