<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hi All,</p>
    <p>I tried to compile the DMPlexCreateSection code but got error
      information as shown below.<br>
    </p>
    <p>Error: Symbol 'petsc_null_is' at (1) has no IMPLICIT type</p>
    <p>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.<br>
    </p>
    <p>dmda_flow%da is distributed dm object that works fine. </p>
    <p>The fortran example I follow is
<a class="moz-txt-link-freetext" href="http://www.mcs.anl.gov/petsc/petsc-dev/src/dm/impls/plex/examples/tutorials/ex1f90.F90">http://www.mcs.anl.gov/petsc/petsc-dev/src/dm/impls/plex/examples/tutorials/ex1f90.F90</a>.
      <br>
    </p>
    <p>What parameters should I use if passing null to bcField, bcComps,
      bcPoints and perm.<br>
    </p>
    <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"><a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</a> <a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/DMPLEX/DMPlexCreateSection.html#DMPlexCreateSection">DMPlexCreateSection</a>(<a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/DM/DM.html#DM">DM</a> dm, <a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscInt.html#PetscInt">PetscInt</a> dim, <a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscInt.html#PetscInt">PetscInt</a> numFields,const <a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscInt.html#PetscInt">PetscInt</a> numComp[],const <a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscInt.html#PetscInt">PetscInt</a> numDof[], <a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscInt.html#PetscInt">PetscInt</a> numBC,const <a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/PetscInt.html#PetscInt">PetscInt</a> bcField[], 
const <a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/IS/IS.html#IS">IS</a> bcComps[], const <a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/IS/IS.html#IS">IS</a> bcPoints[], <a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/IS/IS.html#IS">IS</a> perm, <a href="https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/IS/PetscSection.html#PetscSection">PetscSection</a> *section)

</pre>
    <p>#include <petsc/finclude/petscis.h><br>
      #include <petsc/finclude/petscis.h90><br>
      #include <petsc/finclude/petscdmplex.h></p>
    <p>...<br>
    </p>
    <p>#ifdef USG<br>
              numFields = 1<br>
              numComp(1) = 1<br>
              pNumComp => numComp<br>
      <br>
              do i = 1, numFields*(dmda_flow%dim+1)<br>
                numDof(i) = 0<br>
              end do<br>
              numDof(0*(dmda_flow%dim+1)+1) = dmda_flow%dof<br>
              pNumDof => numDof<br>
      <br>
              numBC = 0<br>
      <br>
              call
      DMPlexCreateSection(dmda_flow%da,dmda_flow%dim,          &<br>
                                      
      numFields,pNumComp,pNumDof,                           &<br>
                                      
      numBC,PETSC_NULL_INTEGER,                               &<br>
                                      
      PETSC_NULL_IS,PETSC_NULL_IS,                            
      &             !Error here<br>
                                       PETSC_NULL_IS,section,ierr)<br>
              CHKERRQ(ierr)<br>
      <br>
              call PetscSectionSetFieldName(section,0,'flow',ierr)<br>
              CHKERRQ(ierr)<br>
      <br>
              call DMSetDefaultSection(dmda_flow%da,section,ierr)<br>
              CHKERRQ(ierr)<br>
      <br>
              call PetscSectionDestroy(section,ierr)<br>
              CHKERRQ(ierr)<br>
      #endif</p>
    <p>Thanks,</p>
    <p>Danyang<br>
    </p>
  </body>
</html>