dagetarray.c (9c925a2c1965a879ab6e2178d4282b2f82226662) dagetarray.c (7e57d48a51ee858b36449453daefa9e5ed052d62)
1
2#include <petsc-private/dmdaimpl.h> /*I "petscdmda.h" I*/
3
4#undef __FUNCT__
5#define __FUNCT__ "DMDAVecGetArray"
6/*@C
7 DMDAVecGetArray - Returns a multiple dimension array that shares data with
8 the underlying vector and is indexed using the global dimensions.
9
10 Collective on Vec
11
12 Input Parameter:
13+ da - the distributed array
1
2#include <petsc-private/dmdaimpl.h> /*I "petscdmda.h" I*/
3
4#undef __FUNCT__
5#define __FUNCT__ "DMDAVecGetArray"
6/*@C
7 DMDAVecGetArray - Returns a multiple dimension array that shares data with
8 the underlying vector and is indexed using the global dimensions.
9
10 Collective on Vec
11
12 Input Parameter:
13+ da - the distributed array
14- vec - the vector, either a vector the same size as one obtained with
15 DMCreateGlobalVector() or DMCreateLocalVector()
14- vec - the vector, either a vector the same size as one obtained with DMCreateGlobalVector() or DMCreateLocalVector()
16
17 Output Parameter:
18. array - the array
19
20 Notes:
21 Call DMDAVecRestoreArray() once you have finished accessing the vector entries.
22
23 In C, the indexing is "backwards" from what expects: array[k][j][i] NOT array[i][j][k]!
24
15
16 Output Parameter:
17. array - the array
18
19 Notes:
20 Call DMDAVecRestoreArray() once you have finished accessing the vector entries.
21
22 In C, the indexing is "backwards" from what expects: array[k][j][i] NOT array[i][j][k]!
23
25 If vec is a local vector (obtained with DMCreateLocalVector() etc) then they ghost point locations are accessable. If it is
26 a global vector then the ghost points are not accessable. Of course with the local vector you will have had to do the
24 If vec is a local vector (obtained with DMCreateLocalVector() etc) then the ghost point locations are accessible. If it is
25 a global vector then the ghost points are not accessible. Of course with the local vector you will have had to do the
27
26
28 appropriate DMLocalToGlobalBegin() and DMLocalToGlobalEnd() to have correct values in the ghost locations.
27 appropriate DMGlobalToLocalBegin() and DMGlobalToLocalEnd() to have correct values in the ghost locations.
29
30 Fortran Notes: From Fortran use DMDAVecGetArrayF90() and pass for the array type PetscScalar,pointer :: array(:,...,:) of the appropriate
31 dimension. For a DMDA created with a dof of 1 use the dimension of the DMDA, for a DMDA created with a dof greater than 1 use one more than the
32 dimension of the DMDA. The order of the indices is array(xs:xs+xm-1,ys:ys+ym-1,zs:zs+zm-1) (when dof is 1) otherwise
33 array(0:dof-1,xs:xs+xm-1,ys:ys+ym-1,zs:zs+zm-1) where the values are obtained from
34 DMDAGetCorners() for a global array or DMDAGetGhostCorners() for a local array. Include finclude/petscdmda.h90 to access this routine.
35
36 Due to bugs in the compiler DMDAVecGetArrayF90() does not work with gfortran versions before 4.5

--- 228 unchanged lines hidden ---
28
29 Fortran Notes: From Fortran use DMDAVecGetArrayF90() and pass for the array type PetscScalar,pointer :: array(:,...,:) of the appropriate
30 dimension. For a DMDA created with a dof of 1 use the dimension of the DMDA, for a DMDA created with a dof greater than 1 use one more than the
31 dimension of the DMDA. The order of the indices is array(xs:xs+xm-1,ys:ys+ym-1,zs:zs+zm-1) (when dof is 1) otherwise
32 array(0:dof-1,xs:xs+xm-1,ys:ys+ym-1,zs:zs+zm-1) where the values are obtained from
33 DMDAGetCorners() for a global array or DMDAGetGhostCorners() for a local array. Include finclude/petscdmda.h90 to access this routine.
34
35 Due to bugs in the compiler DMDAVecGetArrayF90() does not work with gfortran versions before 4.5

--- 228 unchanged lines hidden ---