static char help[] = "Tests DMDA with variable multiple degrees of freedom per node.\n\n"; /* This code only compiles with gcc, since it is not ANSI C */ #include #include PetscErrorCode doit(DM da,Vec global) { PetscErrorCode ierr; PetscInt i,j,k,M,N,dof; ierr = DMDAGetInfo(da,0,&M,&N,0,0,0,0,&dof,0,0,0,0,0);CHKERRQ(ierr); { struct {PetscScalar inside[dof];} **mystruct; ierr = DMDAVecGetArrayRead(da,global,(void*) &mystruct);CHKERRQ(ierr); for (i=0; i