| /petsc/src/binding/petsc4py/demo/legacy/perftest/ |
| H A D | App.f90 | 5 integer(kind=C_INT), intent(in) :: nx, ny, nz local 7 real(kind=C_DOUBLE), intent(in) :: x(nx,ny,nz), xdot(nx,ny,nz) 8 real(kind=C_DOUBLE), intent(inout) :: f(nx,ny,nz) 9 call formfunction_f(nx, ny, nz, h, t, x, xdot, f) 16 integer(kind=C_INT), intent(in) :: nx, ny, nz local 18 real(kind=C_DOUBLE), intent(inout) :: x(nx,ny,nz) 19 call forminitial_f(nx, ny, nz, h, t, x) 45 integer, intent(in) :: nx, ny, nz local 47 real(kind=8), intent(inout) :: x(nx,ny,nz) 54 integer, intent(in) :: nx, ny, nz local [all …]
|
| H A D | App.pyf | 6 subroutine formFunction(nx, ny, nz, h, t, x, xdot, f) 9 integer, intent(in), intent(hide) :: ny = shape(x,1) 12 real(kind=8), intent(in) :: x(nx,ny,nz), xdot(nx,ny,nz) 13 real(kind=8), intent(inout) :: f(nx,ny,nz) 16 subroutine formInitial(nx, ny, nz, h, t, x) 19 integer, intent(in), intent(hide) :: ny = shape(x,1) 22 real(kind=8), intent(inout) :: x(nx,ny,nz)
|
| H A D | driver.py | 19 def __init__(self, nx, ny, nz): argument 20 self.n = np.array([nx, ny, nz], dtype='i') 40 nx, ny, nz = self.n 43 U = x.getArray(readonly=1).reshape(nx,ny,nz, order='f') 45 X, Y = mgrid[0:1:1j*nx,0:1:1j*ny] 57 Z = U[:,ny//4,:] 67 X, Y = mgrid[0:1:1j*ny,0:1:1j*nz] 79 def run_test(nx,ny,nz,samples,plot=False): argument 90 x = PETSc.Vec().createSeq(nx*ny*nz) 92 app = AppCtx(nx, ny, nz) [all …]
|
| H A D | driver.c | 11 PetscInt nx,ny,nz; member 23 formInitial(&app->nx,&app->ny,&app->nz,app->h,&t,x); in FormInitial() 41 formFunction(&app->nx,&app->ny,&app->nz,app->h,&t,x,xdot,f); in FormFunction() 49 PetscErrorCode RunTest(int nx, int ny, int nz, int loops, double *wt) in RunTest() argument 58 app->ny = ny; app->h[1] = 1./(ny-1); in RunTest() 62 PetscCall(VecSetSizes(x,nx*ny*nz,nx*ny*nz)); in RunTest() 125 int nx=n+1, ny=n+1, nz=n+1; in main() local 126 PetscCall(RunTest(nx,ny,nz,samples,&wt)); in main() 127 …Printf(PETSC_COMM_SELF,"Grid %3d x %3d x %3d -> %f seconds (%2d samples)\n",nx,ny,nz,wt,samples)); in main()
|
| /petsc/src/binding/petsc4py/demo/legacy/bratu2d/ |
| H A D | bratu2d.py | 12 def __init__(self, nx, ny, alpha, impl='python'): argument 14 self.ny = ny # y grid size 28 nx, ny = self.nx, self.ny 31 x = X.getArray(readonly=1).reshape(nx, ny, order=order) 32 f = F.getArray(readonly=0).reshape(nx, ny, order=order) 40 ny = OptDB.getInt('ny', nx) variable 46 appc = Bratu2D(nx, ny, alpha, impl) 51 f = PETSc.Vec().createSeq(nx*ny) 66 da = PETSc.DMDA().create([nx,ny]) 80 X, Y = mgrid[0:1:1j*nx,0:1:1j*ny] [all …]
|
| H A D | bratu2dnpy.py | 13 nx, ny = x.shape 15 hy = 1.0/(ny-1) # y grid spacing
|
| /petsc/src/dm/impls/stag/tests/ |
| H A D | ex19.c | 32 PetscInt i, j, startx, starty, nx, ny, extrax, extray; in main() local 35 …PetscCall(DMStagGetCorners(dmCoarse, &startx, &starty, NULL, &nx, &ny, NULL, &extrax, &extray, NUL… in main() 40 for (j = starty; j < starty + ny + extray; ++j) { in main() 43 arr[j][i][vx] = (j < starty + ny) ? 20.0 : -1; in main() 44 arr[j][i][p] = (i < startx + nx) && (j < starty + ny) ? 30.0 : -1; in main() 53 PetscInt i, j, startx, starty, nx, ny, extrax, extray; in main() local 56 … PetscCall(DMStagGetCorners(dm, &startx, &starty, NULL, &nx, &ny, NULL, &extrax, &extray, NULL)); in main() 61 for (j = starty; j < starty + ny + extray; ++j) { in main() 64 const PetscScalar expected_vx = (j < starty + ny) ? 20.0 : -1; in main() 65 const PetscScalar expected_p = (i < startx + nx) && (j < starty + ny) ? 30.0 : -1; in main()
|
| H A D | ex8.c | 20 PetscInt startx, starty, startz, nx, ny, nz, ex, ey, ez, nExtrax, nExtray, nExtraz; in main() local 44 …PetscCall(DMStagGetCorners(dmSol, &startx, &starty, &startz, &nx, &ny, &nz, &nExtrax, &nExtray, &n… in main() 53 for (ey = starty; ey < starty + ny + nExtray; ++ey) { in main() 61 if (ex < startx + nx && ey < starty + ny && ez < startz + nz) { in main() 125 …PetscInt startx, starty, startz, nx, ny, nz, nExtrax, nExtray, nExtraz, ex, ey, ez, idxP, i… in ApplyOperator() local 134 …PetscCall(DMStagGetCorners(dm, &startx, &starty, &startz, &nx, &ny, &nz, &nExtrax, &nExtray, &nExt… in ApplyOperator() 148 …for (ey = starty; ey < starty + ny + nExtray; ++ey) arrIn[ez][ey][-1][idxP] = arrIn[ez][ey][0][idx… in ApplyOperator() 153 …for (ey = starty; ey < starty + ny + nExtray; ++ey) arrIn[ez][ey][startx + nx][idxP] = arrIn[ez][e… in ApplyOperator() 163 …rtx; ex < startx + nx + nExtrax; ++ex) arrIn[ez][starty + ny][ex][idxP] = arrIn[ez][starty + ny - … in ApplyOperator() 168 for (ey = starty; ey < starty + ny + nExtray; ++ey) { in ApplyOperator() [all …]
|
| H A D | ex11.c | 20 PetscInt startx, starty, nx, ny, ex, ey, nExtrax, nExtray; in main() local 44 …PetscCall(DMStagGetCorners(dmSol, &startx, &starty, NULL, &nx, &ny, NULL, &nExtrax, &nExtray, NULL… in main() 51 for (ey = starty; ey < starty + ny + nExtray; ++ey) { in main() 57 if (ex < startx + nx && ey < starty + ny) { in main() 120 …PetscInt startx, starty, nx, ny, nExtrax, nExtray, ex, ey, idxP, idxUx, idxUy, startGhostx, … in ApplyOperator() local 129 PetscCall(DMStagGetCorners(dm, &startx, &starty, NULL, &nx, &ny, NULL, &nExtrax, &nExtray, NULL)); in ApplyOperator() 141 for (ey = starty; ey < starty + ny + nExtray; ++ey) arrIn[ey][-1][idxP] = arrIn[ey][0][idxP]; in ApplyOperator() 144 …for (ey = starty; ey < starty + ny + nExtray; ++ey) arrIn[ey][startx + nx][idxP] = arrIn[ey][start… in ApplyOperator() 150 … = startx; ex < startx + nx + nExtrax; ++ex) arrIn[starty + ny][ex][idxP] = arrIn[starty + ny - 1]… in ApplyOperator() 154 for (ey = starty; ey < starty + ny + nExtray; ++ey) { in ApplyOperator() [all …]
|
| H A D | ex13.c | 199 …PetscInt i, j, startx, starty, nx, ny, nExtrax, nExtray, dof0, dof1, dof2, c, idxLeft, idxDo… in Test2_2d() local 206 PetscCall(DMStagGetCorners(dm, &startx, &starty, NULL, &nx, &ny, NULL, &nExtrax, &nExtray, NULL)); in Test2_2d() 215 for (j = starty; j < starty + ny + nExtray; ++j) { in Test2_2d() 221 if (j < starty + ny) { in Test2_2d() 233 if (i < startx + nx && j < starty + ny) { in Test2_2d() 248 for (j = starty; j < starty + ny + nExtray; ++j) { in Test2_2d() 255 if (j < starty + ny) { in Test2_2d() 281 if (i < startx + nx && j < starty + ny) { in Test2_2d() 306 …PetscInt i, j, k, startx, starty, startz, nx, ny, nz, nExtrax, nExtray, nExtraz, dof0, dof1… in Test2_3d() local 312 …PetscCall(DMStagGetCorners(dm, &startx, &starty, &startz, &nx, &ny, &nz, &nExtrax, &nExtray, &nExt… in Test2_3d() [all …]
|
| H A D | ex9.c | 10 …PetscInt startx, starty, startz, nx, ny, nz, i, j, k, d, is, js, ks, dof0, dof1, dof2, dof3,… in main() local 38 PetscCall(DMStagGetCorners(dm, &startx, &starty, &startz, &nx, &ny, &nz, NULL, NULL, NULL)); in main() 42 for (j = starty; j < starty + ny; ++j) { in main() 65 …Width * stencilWidth * stencilWidth - 4 * stencilWidth * stencilWidth * (nx + ny + nz)) * dofTotal; in main() 71 for (i = 0; i < nz * ny * nx * dofTotal; ++i) { in main()
|
| H A D | ex12.c | 10 …PetscInt startx, starty, nx, ny, i, j, d, is, js, dof0, dof1, dof2, dofTotal, stencilWidth, … in main() local 37 PetscCall(DMStagGetCorners(dm, &startx, &starty, NULL, &nx, &ny, NULL, NULL, NULL, NULL)); in main() 40 for (j = starty; j < starty + ny; ++j) { in main() 67 for (i = 0; i < ny * nx * dofTotal; ++i) { in main()
|
| H A D | ex10.c | 10 …PetscInt startx, starty, nx, ny, i, j, d, is, js, dof0, dof1, dof2, dofTotal, stencilWidth, … in main() local 37 PetscCall(DMStagGetCorners(dm, &startx, &starty, NULL, &nx, &ny, NULL, NULL, NULL, NULL)); in main() 40 for (j = starty; j < starty + ny; ++j) { in main() 63 for (i = 0; i < ny * nx * dofTotal; ++i) { in main() 71 for (j = starty; j < starty + ny; ++j) { in main()
|
| /petsc/src/tao/unconstrained/tutorials/ |
| H A D | eptorsion3.c | 207 PetscInt i, j, k, nx = user->mx, ny = user->my; in FormInitialGuess() local 211 for (j = 0; j < ny; j++) { in FormInitialGuess() 212 temp = PetscMin(j + 1, ny - j) * hy; in FormInitialGuess() 264 PetscInt nx = user->mx, ny = user->my, i, j, k; in FormFunction() local 271 for (j = -1; j < ny; j++) { in FormFunction() 279 if (i > -1 && j < ny - 1) vt = x[k + nx]; in FormFunction() 288 for (j = 0; j <= ny; j++) { in FormFunction() 295 if (i > 0 && j < ny) vl = x[k - 1]; in FormFunction() 296 if (i < nx && j < ny) v = x[k]; in FormFunction() 311 PetscCall(PetscLogFlops(24.0 * nx * ny)); in FormFunction() [all …]
|
| H A D | eptorsion1.c | 191 PetscInt i, j, k, nx = user->mx, ny = user->my; in FormInitialGuess() local 195 for (j = 0; j < ny; j++) { in FormInitialGuess() 196 temp = PetscMin(j + 1, ny - j) * hy; in FormInitialGuess() 248 PetscInt nx = user->mx, ny = user->my, i, j, k; in FormFunction() local 255 for (j = -1; j < ny; j++) { in FormFunction() 263 if (i > -1 && j < ny - 1) vt = x[k + nx]; in FormFunction() 272 for (j = 0; j <= ny; j++) { in FormFunction() 279 if (i > 0 && j < ny) vl = x[k - 1]; in FormFunction() 280 if (i < nx && j < ny) v = x[k]; in FormFunction() 295 PetscCall(PetscLogFlops(24.0 * nx * ny)); in FormFunction() [all …]
|
| /petsc/src/snes/tutorials/ |
| H A D | ex70.c | 55 PetscInt nx, ny; /* nb of cells in x- and y-direction */ member 131 for (j = 0; j < s->ny; j++) { in StokesWriteSolution() 134 …[n]), (double)PetscRealPart(array[n + s->nx * s->ny]), (double)PetscRealPart(array[n + 2 * s->nx *… in StokesWriteSolution() 156 PetscCall(VecSetSizes(s->x, PETSC_DECIDE, 3 * s->nx * s->ny)); in StokesSetupVectors() 175 n = row % (s->nx * s->ny); in StokesGetPosition() 193 if (row < s->nx * s->ny) { in StokesExactSolution() 230 if (row < s->nx * s->ny) { in StokesRhs() 262 …tscCall(MatSetSizes(s->subA[0], PETSC_DECIDE, PETSC_DECIDE, 2 * s->nx * s->ny, 2 * s->nx * s->ny)); in StokesSetupMatBlock00() 272 if (row >= s->nx * s->ny) { in StokesSetupMatBlock00() 273 for (i = 0; i < sz; i++) cols[i] += s->nx * s->ny; in StokesSetupMatBlock00() [all …]
|
| /petsc/src/tao/bound/tutorials/ |
| H A D | jbearing2.c | 32 PetscInt nx, ny; /* discretization in x, y directions */ member 67 user.ny = 50; in main() 74 PetscCall(PetscOptionsGetInt(NULL, NULL, "-my", &user.ny, &flg)); in main() 80 …x: %" PetscInt_FMT ", my: %" PetscInt_FMT ", ecc: %g \n\n", user.nx, user.ny, (double)user.ecc)); in main() 91 …ORLD, DM_BOUNDARY_NONE, DM_BOUNDARY_NONE, DMDA_STENCIL_STAR, user.nx, user.ny, Nx, Ny, 1, 1, NULL,… in main() 175 PetscInt nx, ny, xs, xm, gxs, gxm, ys, ym, gys, gym; in ComputeB() local 183 ny = user->ny; in ComputeB() 185 hy = two * user->b / (ny + 1.0); in ComputeB() 212 PetscInt col[5], row, nx, ny, xs, xm, gxs, gxm, ys, ym, gys, gym; in FormFunctionGradient() local 224 ny = user->ny; in FormFunctionGradient() [all …]
|
| /petsc/src/dm/impls/da/ |
| H A D | fdda.c | 261 PetscInt xs, ys, nx, ny, i, j, ii, gxs, gys, gnx, gny, m, n, M, N, dim, s, k, nc, col; in DMCreateColoring_DA_2d_MPIAIJ() local 277 PetscCall(DMDAGetCorners(da, &xs, &ys, NULL, &nx, &ny, NULL)); in DMCreateColoring_DA_2d_MPIAIJ() 287 PetscCall(PetscMalloc1(nc * nx * ny, &colors)); in DMCreateColoring_DA_2d_MPIAIJ() 289 for (j = ys; j < ys + ny; j++) { in DMCreateColoring_DA_2d_MPIAIJ() 295 …PetscCall(ISColoringCreate(comm, ncolors, nc * nx * ny, colors, PETSC_OWN_POINTER, &dd->localcolor… in DMCreateColoring_DA_2d_MPIAIJ() 325 …PetscInt xs, ys, nx, ny, i, j, gxs, gys, gnx, gny, m, n, p, dim, s, k, nc, col, zs, gzs, i… in DMCreateColoring_DA_3d_MPIAIJ() local 344 PetscCall(DMDAGetCorners(da, &xs, &ys, &zs, &nx, &ny, &nz)); in DMCreateColoring_DA_3d_MPIAIJ() 351 PetscCall(PetscMalloc1(nc * nx * ny * nz, &colors)); in DMCreateColoring_DA_3d_MPIAIJ() 354 for (j = ys; j < ys + ny; j++) { in DMCreateColoring_DA_3d_MPIAIJ() 361 …PetscCall(ISColoringCreate(comm, ncolors, nc * nx * ny * nz, colors, PETSC_OWN_POINTER, &dd->local… in DMCreateColoring_DA_3d_MPIAIJ() [all …]
|
| /petsc/src/dm/tests/ |
| H A D | ex5.c | 9 PetscInt nx = 6, ny = 6, nz = 6, dim = 1, dof = 2; in main() local 23 …TSC_COMM_WORLD, DM_BOUNDARY_NONE, DM_BOUNDARY_NONE, DMDA_STENCIL_STAR, nx, ny, PETSC_DECIDE, PETSC… in main() 26 …M_BOUNDARY_NONE, DM_BOUNDARY_NONE, DM_BOUNDARY_NONE, DMDA_STENCIL_BOX, nx, ny, nz, PETSC_DECIDE, P… in main()
|
| H A D | ex45.c | 18 PetscInt ny = 2; in main() local 25 …PERIODIC, DM_BOUNDARY_PERIODIC, DM_BOUNDARY_GHOSTED, DMDA_STENCIL_BOX, nx, ny, nz, PETSC_DECIDE, P… in main()
|
| /petsc/src/binding/petsc4py/demo/legacy/bratu3d/ |
| H A D | makefile | 17 ${MPIEXEC} ${PYTHON} bratu3d.py -fd -nx 7 -ny 8 -nz 9 21 ${MPIEXEC} ${PYTHON} bratu3d.py -mf -nx 9 -ny 8 -nz 7
|
| /petsc/src/dm/impls/da/hypre/ |
| H A D | mhyp.h | 24 PetscInt rstart, gnx, gnxgny, xs, ys, zs, nx, ny, nxny; member 45 PetscInt rstart, gnx, gnxgny, gnxgnygnz, xs, ys, zs, nx, ny, nz, nxny, nxnynz; member
|
| H A D | mhyp.c | 55 index[1] = (HYPRE_Int)(ex->ys + ((row / ex->nx) % ex->ny)); in MatSetValuesLocal_HYPREStruct_3d() 78 index[1] = (HYPRE_Int)(ex->ys + ((row / ex->nx) % ex->ny)); in MatZeroRowsLocal_HYPREStruct_3d() 103 PetscInt dim, dof, psw, Nx, Ny, Nz, nx, ny, nz, ilower[3], iupper[3], ssize, i; in MatSetUp_HYPREStruct() local 203 PetscCall(DMDAGetCorners(da, 0, 0, 0, &nx, &ny, &nz)); in MatSetUp_HYPREStruct() 204 PetscCall(MatSetSizes(mat, dof * nx * ny * nz, dof * nx * ny * nz, PETSC_DECIDE, PETSC_DECIDE)); in MatSetUp_HYPREStruct() 224 PetscCall(DMDAGetCorners(ex->da, &ex->xs, &ex->ys, &ex->zs, &ex->nx, &ex->ny, 0)); in MatSetUp_HYPREStruct() 225 ex->nxny = ex->nx * ex->ny; in MatSetUp_HYPREStruct() 391 index[1] = (HYPRE_Int)(ex->ys + ((row / ex->nx) % ex->ny)); in MatSetValuesLocal_HYPRESStruct_3d() 430 index[1] = (HYPRE_Int)(ex->ys + ((row / ex->nx) % ex->ny)); in MatSetValuesLocal_HYPRESStruct_3d() 478 index[1] = (HYPRE_Int)(ex->ys + ((row / ex->nx) % ex->ny)); in MatZeroRowsLocal_HYPRESStruct_3d() [all …]
|
| /petsc/src/ksp/ksp/tutorials/ |
| H A D | ex49.c | 266 PetscInt si, sj, nx, ny, i, j; in DMDACoordViewGnuplot2d() local 281 PetscCall(DMDAGetGhostCorners(cda, &si, &sj, 0, &nx, &ny, 0)); in DMDACoordViewGnuplot2d() 282 for (j = sj; j < sj + ny - 1; j++) { in DMDACoordViewGnuplot2d() 306 PetscInt si, sj, nx, ny, i, j; in DMDAViewGnuplot2d() local 328 PetscCall(DMDAGetGhostCorners(cda, &si, &sj, 0, &nx, &ny, 0)); in DMDAViewGnuplot2d() 335 for (j = sj; j < sj + ny; j++) { in DMDAViewGnuplot2d() 368 PetscInt si, sj, nx, ny, i, j, p; in DMDAViewCoefficientsGnuplot2d() local 388 PetscCall(DMDAGetGhostCorners(cda, &si, &sj, 0, &nx, &ny, 0)); in DMDAViewCoefficientsGnuplot2d() 395 for (j = sj; j < sj + ny; j++) { in DMDAViewCoefficientsGnuplot2d() 713 PetscInt si, sj, nx, ny, i, j, p; in solve_elasticity_2d() local [all …]
|
| /petsc/src/binding/petsc4py/demo/legacy/poisson2d/ |
| H A D | poisson2d.py | 60 if j < ny-1: u_n = x[i, j+1] # north 69 ny = OptDB.getInt('ny', n) variable 71 da = PETSc.DMDA().create([nx, ny], stencil_width=1, setup=False)
|