Actual source code: ex40f90.F90

  1: #include <petsc/finclude/petscis.h>
  2: program main
  3:   use petscis
  4:   implicit none

  6:   type(tPetscSection) section
  7:   PetscInt, parameter :: pStart = 0, pEnd = 5
  8:   PetscInt :: p
  9:   PetscErrorCode ierr

 11:   PetscCallA(PetscInitialize(ierr))

 13:   PetscCallA(PetscSectionCreate(PETSC_COMM_WORLD, section, ierr))
 14:   PetscCallA(PetscSectionSetChart(section, pStart, pEnd, ierr))
 15:   do p = pStart, pEnd - 1
 16:     PetscCallA(PetscSectionSetDof(section, p, 3_PETSC_INT_KIND, ierr))
 17:   end do
 18:   PetscCallA(PetscSectionSetUp(section, ierr))
 19:   PetscCallA(PetscSectionView(section, PETSC_VIEWER_STDOUT_WORLD, ierr))
 20:   PetscCallA(PetscSectionDestroy(section, ierr))
 21:   PetscCallA(PetscFinalize(ierr))
 22: end

 24: !/*TEST
 25: !
 26: !     test:
 27: !
 28: !TEST*/