Actual source code: dascatter.c

  1: /*$Id: dascatter.c,v 1.23 2001/03/23 23:25:00 balay Exp $*/
  2: 
  3: /*
  4:   Code for manipulating distributed regular arrays in parallel.
  5: */

 7:  #include src/dm/da/daimpl.h
  8: extern int DALocalToLocalCreate(DA);

 10: #undef __FUNCT__  
 12: /*@C
 13:    DAGetScatter - Gets the local-to-global, local-to-global, and 
 14:    local-to-local vector scatter contexts for a distributed array.

 16:    Collective on DA

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

 21:    Output Parameters:
 22: +  ltog - local-to-global scatter context (may be PETSC_NULL)
 23: .  gtol - global-to-local scatter context (may be PETSC_NULL) 
 24: -  ltol - local-to-local scatter context (may be PETSC_NULL)

 26:    Level: developer

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

 32: .keywords: distributed array, get, scatter, context, global-to-local,
 33:            local-to-global, local-to-local

 35: .seealso: DAGlobalToLocalBegin(), DAGlobalToLocalEnd(), DALocalToGlobal()
 36: @*/
 37: int DAGetScatter(DA da,VecScatter *ltog,VecScatter *gtol,VecScatter *ltol)
 38: {

 43:   if (ltog) *ltog = da->ltog;
 44:   if (gtol) *gtol = da->gtol;
 45:   if (ltol) {
 46:     if (!da->ltol) {
 47:       DALocalToLocalCreate(da);
 48:     }
 49:     *ltol = da->ltol;
 50:   }
 51:   return(0);
 52: }
 53: