Actual source code: dascatter.c

petsc-3.7.3 2016-08-01
Report Typos and Errors
  2: /*
  3:   Code for manipulating distributed regular arrays in parallel.
  4: */

  6: #include <petsc/private/dmdaimpl.h>    /*I   "petscdmda.h"   I*/
  7: extern PetscErrorCode DMLocalToLocalCreate_DA(DM);

 11: /*@C
 12:    DMDAGetScatter - Gets the global-to-local, and
 13:    local-to-local vector scatter contexts for a distributed array.

 15:    Collective on DMDA

 17:    Input Parameter:
 18: .  da - the distributed array

 20:    Output Parameters:
 21: +  gtol - global-to-local scatter context (may be NULL)
 22: -  ltol - local-to-local scatter context (may be NULL)

 24:    Level: developer

 26:    Notes:
 27:    The output contexts are valid only as long as the input da is valid.
 28:    If you delete the da, the scatter contexts will become invalid.

 30: .keywords: distributed array, get, scatter, context, global-to-local,
 31:            local-to-global, local-to-local

 33: .seealso: DMGlobalToLocalBegin(), DMGlobalToLocalEnd(), DMLocalToGlobalBegin()
 34: @*/
 35: PetscErrorCode  DMDAGetScatter(DM da,VecScatter *gtol,VecScatter *ltol)
 36: {
 38:   DM_DA          *dd = (DM_DA*)da->data;

 42:   if (gtol) *gtol = dd->gtol;
 43:   if (ltol) {
 44:     if (!dd->ltol) {
 45:       DMLocalToLocalCreate_DA(da);
 46:     }
 47:     *ltol = dd->ltol;
 48:   }
 49:   return(0);
 50: }