Actual source code: ex4f90.F90

  1: ! setting up DMPlex for finite elements
  2: ! Contributed by Pratheek Shanthraj <p.shanthraj@mpie.de>
  3:       program main
  4:       implicit none
  5: #include <petsc/finclude/petsc.h90>
  6:       DM :: dm
  7:       PetscDS :: prob
  8:       PetscInt :: dim = 3
  9:       PetscBool :: simplex = PETSC_TRUE
 10:       PetscBool :: interpolate = PETSC_TRUE
 11:       PetscBool :: refinementUniform = PETSC_FALSE
 12:       PetscReal :: refinementLimit = 0.0
 13:       PetscErrorCode :: ierr

 15:       PetscCallA(PetscInitialize(PETSC_NULL_CHARACTER, ierr))
 16:       PetscCallA(DMPlexCreateDoublet(PETSC_COMM_WORLD, dim, simplex,interpolate, refinementUniform, refinementLimit, dm, ierr))
 17:       PetscCallA(DMSetUp(dm,ierr))
 18:       PetscCallA(PetscDSCreate(PETSC_COMM_WORLD,prob,ierr))
 19:       PetscCallA(DMGetDS(dm,prob,ierr))

 21:       PetscCallA(DMDestroy(dm, ierr))
 22:       PetscCallA(PetscFinalize(ierr))
 23:       end program main