diff --git a/src/dm/impls/plex/tutorials/ex3f90.F90 b/src/dm/impls/plex/tutorials/ex3f90.F90 index 83aab3ab49..64511505a1 100644 --- a/src/dm/impls/plex/tutorials/ex3f90.F90 +++ b/src/dm/impls/plex/tutorials/ex3f90.F90 @@ -14,6 +14,7 @@ PetscInt :: depth = 1 PetscErrorCode :: ierr PetscInt, dimension(2) :: numPoints + PetscInt, dimension(4) :: numPoints1 PetscInt, dimension(14) :: coneSize PetscInt, dimension(16) :: cones PetscInt, dimension(16) :: coneOrientations @@ -30,11 +31,13 @@ PetscReal, pointer :: pv0(:) PetscReal, pointer :: pJ(:) PetscReal, pointer :: pinvJ(:) - PetscReal :: detJ + PetscReal :: detJ + PetscMPIInt :: rank PetscInt :: i numPoints = [12, 2] + numPoints1 = [0, 0, 0, 0] coneSize = [8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] cones = [2,5,4,3,6,7,8,9, 3,4,11,10,7,12,13,8] coneOrientations = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0] @@ -54,12 +57,18 @@ print*,'Unable to initialize PETSc' stop endif + call MPI_Comm_rank(PETSC_COMM_WORLD,rank,ierr) call DMPlexCreate(PETSC_COMM_WORLD, dm, ierr);CHKERRA(ierr) call PetscObjectSetName(dm, 'testplex', ierr);CHKERRA(ierr) call DMSetDimension(dm, dim, ierr);CHKERRA(ierr) - call DMPlexCreateFromDAG(dm, depth, numPoints, coneSize, cones,coneOrientations, vertexCoords, ierr);CHKERRA(ierr) + if (rank == 0) then + call DMPlexCreateFromDAG(dm, depth, numPoints, coneSize, cones,coneOrientations, vertexCoords, ierr) + else + call DMPlexCreateFromDAG(dm, 3, numPoints1, PETSC_NULL_INTEGER, PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, PETSC_NULL_REAL, ierr) + endif + CHKERRA(ierr) call DMPlexInterpolate(dm, dmi, ierr);CHKERRA(ierr) call DMPlexCopyCoordinates(dm, dmi, ierr);CHKERRA(ierr)