Actual source code: ex40f90.F90

petsc-3.12.2 2019-11-22
Report Typos and Errors
  1:       program main
  2:  #include <petsc/finclude/petscis.h>
  3:       use petscis
  4:       implicit none

  6:       type(tPetscSection)   section
  7:       PetscInt       pStart, pEnd, p,three
  8:       PetscErrorCode ierr

 10:       three = 3
 11:       call PetscInitialize(PETSC_NULL_CHARACTER,ierr)
 12:       if (ierr .ne. 0) then
 13:         print*,'Unable to initialize PETSc'
 14:         stop
 15:       endif
 16:       call PetscSectionCreate(PETSC_COMM_WORLD, section, ierr);CHKERRA(ierr)
 17:       pStart = 0
 18:       pEnd   = 5
 19:       call PetscSectionSetChart(section, pStart, pEnd, ierr);CHKERRA(ierr)
 20:       do p=pStart,pEnd-1
 21:          call PetscSectionSetDof(section, p, three, ierr);CHKERRA(ierr)
 22:       end do
 23:       call PetscSectionSetUp(section, ierr);CHKERRA(ierr)
 24:       call PetscSectionView(section, PETSC_VIEWER_STDOUT_WORLD, ierr);CHKERRA(ierr)
 25:       call PetscSectionDestroy(section, ierr);CHKERRA(ierr)
 26:       call PetscFinalize(ierr)
 27:       end

 29: !/*TEST
 30: !
 31: !     test:
 32: !
 33: !TEST*/