Skip to content

Commit

Permalink
swarm: Implement RestorePointsPerCell
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwrigh committed Oct 27, 2024
1 parent 243afec commit 391f7d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/petsc/dmswarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/petsc/src/swarmutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ PetscErrorCode DMSwarmCreateReferenceCoordinates(DM dm_swarm, IS *is_points, Vec
}

// -- Cleanup
PetscCall(PetscFree(points_in_cell));
PetscCall(DMSwarmSortRestorePointsPerCell(dm_swarm, cell, &num_points_in_cell, &points_in_cell));
}
cell_points[points_offset - 1] = num_points_local + points_offset;

Expand Down

0 comments on commit 391f7d9

Please sign in to comment.