Actual source code: daltol.c

  1: /*$Id: daltol.c,v 1.24 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"    /*I   "petscda.h"   I*/

  9: /*@
 10:    DALocalToLocalBegin - Maps from a local vector (including ghost points
 11:    that contain irrelevant values) to another local vector where the ghost
 12:    points in the second are set correctly. Must be followed by DALocalToLocalEnd().

 14:    Collective on DA and Vec

 16:    Input Parameters:
 17: +  da - the distributed array context
 18: .  g - the original local vector
 19: -  mode - one of INSERT_VALUES or ADD_VALUES

 21:    Output Parameter:
 22: .  l  - the local vector with correct ghost values

 24:    Level: intermediate

 26:    Notes:
 27:    The local vectors used here need not be the same as those
 28:    obtained from DACreateLocalVector(), BUT they
 29:    must have the same parallel data layout; they could, for example, be 
 30:    obtained with VecDuplicate() from the DA originating vectors.

 32: .keywords: distributed array, local-to-local, begin

 34: .seealso: DALocalToLocalEnd(), DALocalToGlobal(), DAGlobalToLocal()
 35: @*/
 36: int DALocalToLocalBegin(DA da,Vec g,InsertMode mode,Vec l)
 37: {

 42:   VecScatterBegin(g,l,mode,SCATTER_FORWARD,da->ltol);
 43:   return(0);
 44: }

 46: /*@
 47:    DALocalToLocalEnd - Maps from a local vector (including ghost points
 48:    that contain irrelevant values) to another local vector where the ghost
 49:    points in the second are set correctly.  Must be preceeded by 
 50:    DALocalToLocalBegin().

 52:    Collective on DA and Vec

 54:    Input Parameters:
 55: +  da - the distributed array context
 56: .  g - the original local vector
 57: -  mode - one of INSERT_VALUES or ADD_VALUES

 59:    Output Parameter:
 60: .  l  - the local vector with correct ghost values

 62:    Level: intermediate

 64:    Note:
 65:    The local vectors used here need not be the same as those
 66:    obtained from DACreateLocalVector(), BUT they
 67:    must have the same parallel data layout; they could, for example, be 
 68:    obtained with VecDuplicate() from the DA originating vectors.

 70: .keywords: distributed array, local-to-local, end

 72: .seealso: DALocalToLocalBegin(), DALocalToGlobal(), DAGlobalToLocal()
 73: @*/
 74: int DALocalToLocalEnd(DA da,Vec g,InsertMode mode,Vec l)
 75: {

 80:   VecScatterEnd(g,l,mode,SCATTER_FORWARD,da->ltol);
 81:   return(0);
 82: }