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: /*@C
11: DAGetScatter - Gets the local-to-global, local-to-global, and
12: local-to-local vector scatter contexts for a distributed array.
14: Collective on DA
16: Input Parameter:
17: . da - the distributed array
19: Output Parameters:
20: + ltog - local-to-global scatter context (may be PETSC_NULL)
21: . gtol - global-to-local scatter context (may be PETSC_NULL)
22: - ltol - local-to-local scatter context (may be PETSC_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: DAGlobalToLocalBegin(), DAGlobalToLocalEnd(), DALocalToGlobal()
34: @*/
35: int DAGetScatter(DA da,VecScatter *ltog,VecScatter *gtol,VecScatter *ltol)
36: {
41: if (ltog) *ltog = da->ltog;
42: if (gtol) *gtol = da->gtol;
43: if (ltol) {
44: if (!da->ltol) {
45: DALocalToLocalCreate(da);
46: }
47: *ltol = da->ltol;
48: }
49: return(0);
50: }
51: