PETSc version 3.17.4
DMStagRestoreProductCoordinateArrays
restore local array access
Synopsis
PetscErrorCode DMStagRestoreProductCoordinateArrays(DM dm,void *arrX,void *arrY,void *arrZ)
Logically Collective
Input Parameter
Output Parameters
| arrX,arrY,arrZ | - local 1D coordinate arrays
|
Notes
This function does not automatically perform a local->global scatter to populate global coordinates from the local coordinates. Thus, it may be required to explicitly perform these operations in some situations, as in the following partial example
PetscCall(DMGetCoordinateDM(dm,&cdm));
for (d=0; d<3; ++d) {
DM subdm;
Vec coor,coor_local;
PetscCall(DMProductGetDM(cdm,d,&subdm));
PetscCall(DMGetCoordinates(subdm,&coor));
PetscCall(DMGetCoordinatesLocal(subdm,&coor_local));
PetscCall(DMLocalToGlobal(subdm,coor_local,INSERT_VALUES,coor));
PetscCall(PetscPrintf(PETSC_COMM_WORLD,"Coordinates dim %D:\n",d));
PetscCall(VecView(coor,PETSC_VIEWER_STDOUT_WORLD));
}
See Also
DMSTAG, DMStagGetProductCoordinateArrays(), DMStagGetProductCoordinateArraysRead()
Level
intermediate
Location
src/dm/impls/stag/stagutils.c
Examples
src/dm/impls/stag/tutorials/ex6.c.html
Index of all DMSTAG routines
Table of Contents for all manual pages
Index of all manual pages