Hi All,

I tried to compile the DMPlexCreateSection code but got error information as shown below.

Error: Symbol 'petsc_null_is' at (1) has no IMPLICIT type

I tried to use PETSC_NULL_OBJECT instead of PETSC_NULL_IS, then the code can be compiled but run into Segmentation Violation error in DMPlexCreateSection.

dmda_flow%da is distributed dm object that works fine.

The fortran example I follow is http://www.mcs.anl.gov/petsc/petsc-dev/src/dm/impls/plex/examples/tutorials/ex1f90.F90.

What parameters should I use if passing null to bcField, bcComps, bcPoints and perm.

PetscErrorCode <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscErrorCode.html#PetscErrorCode> DMPlexCreateSection <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/DMPLEX/DMPlexCreateSection.html#DMPlexCreateSection>(DM <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/DM/DM.html#DM> dm,PetscInt <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscInt.html#PetscInt> dim,PetscInt <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscInt.html#PetscInt> numFields,constPetscInt <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscInt.html#PetscInt> numComp[],constPetscInt <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscInt.html#PetscInt> numDof[],PetscInt <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscInt.html#PetscInt> numBC,constPetscInt <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscInt.html#PetscInt> bcField[], constIS <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/IS/IS.html#IS> bcComps[], constIS <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/IS/IS.html#IS> bcPoints[],IS <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/IS/IS.html#IS> perm,PetscSection <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/IS/PetscSection.html#PetscSection> *section)

#include <petsc/finclude/petscis.h>
#include <petsc/finclude/petscis.h90>
#include <petsc/finclude/petscdmplex.h>

...

#ifdef USG
        numFields = 1
        numComp(1) = 1
        pNumComp => numComp

        do i = 1, numFields*(dmda_flow%dim+1)
          numDof(i) = 0
        end do
        numDof(0*(dmda_flow%dim+1)+1) = dmda_flow%dof
        pNumDof => numDof

        numBC = 0

        call DMPlexCreateSection(dmda_flow%da,dmda_flow%dim,          &
numFields,pNumComp,pNumDof,                           &
numBC,PETSC_NULL_INTEGER,                               &
PETSC_NULL_IS,PETSC_NULL_IS, &             !Error here
                                 PETSC_NULL_IS,section,ierr)
        CHKERRQ(ierr)

        call PetscSectionSetFieldName(section,0,'flow',ierr)
        CHKERRQ(ierr)

        call DMSetDefaultSection(dmda_flow%da,section,ierr)
        CHKERRQ(ierr)

        call PetscSectionDestroy(section,ierr)
        CHKERRQ(ierr)
#endif

Thanks,

Danyang

Reply via email to