4.5.3. Scattering Ghost Values

Up: Contents Next: Vectors with Locations for Ghost Values Previous: Scatters and Gathers

The scatters provide a very general method for managing the communication of required ghost values for unstructured grid computations. One scatters the global vector into a local ``ghosted'' work vector, performs the computation on the local work vectors, and then scatters back into the global solution vector. In the simplest case this may be written as

   Function: (Input Vec globalin, Output Vec globalout) 

ierr = VecScatterBegin(Vec globalin,Vec localin,InsertMode INSERT_VALUES,ScatterMode SCATTER_FORWARD,VecScatter scatter); ierr = VecScatterEnd(Vec globalin,Vec localin,InsertMode INSERT_VALUES,ScatterMode SCATTER_FORWARD,VecScatter scatter); /* For example, do local calculations from localin to localout */ ierr = VecScatterBegin(Vec localout,Vec globalout,InsertMode ADD_VALUES,ScatterMode SCATTER_REVERSE,VecScatter scatter); ierr = VecScatterEnd(Vec localout,Vec globalout,InsertMode ADD_VALUES,ScatterMode SCATTER_REVERSE,VecScatter scatter);


Up: Contents Next: Vectors with Locations for Ghost Values Previous: Scatters and Gathers