From 9c16dd38672f73a90ae46841d703a47bb97021f4 Mon Sep 17 00:00:00 2001 From: James Wright Date: Sat, 26 Oct 2024 21:44:43 -0600 Subject: [PATCH] swarm: Implement RestorePointsPerCell --- examples/petsc/dmswarm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/petsc/dmswarm.c b/examples/petsc/dmswarm.c index 1dc3618fd8..113730e15a 100644 --- a/examples/petsc/dmswarm.c +++ b/examples/petsc/dmswarm.c @@ -398,7 +398,7 @@ PetscErrorCode DMSwarmInterpolateFromCellToSwarm_Petsc(DM dm_swarm, const char * PetscCall(DMRestoreWorkArray(dm_mesh, num_points_in_cell * dim, MPIU_REAL, &coords_points_cell_true)); PetscCall(DMRestoreWorkArray(dm_mesh, num_points_in_cell * dim, MPIU_REAL, &coords_points_cell_ref)); PetscCall(PetscTabulationDestroy(&tabulation)); - PetscCall(PetscFree(points_cell)); + PetscCall(DMSwarmSortRestorePointsPerCell(dm_swarm, cell, &num_points_in_cell, &points_cell)); } // Cleanup @@ -486,7 +486,7 @@ PetscErrorCode DMSwarmCheckSwarmValues(DM dm_swarm, const char *field, PetscScal } // -- Cleanup - PetscCall(PetscFree(points)); + PetscCall(DMSwarmSortRestorePointsPerCell(dm_swarm, cell, &num_points_in_cell, &points)); } // Cleanup