Lines Matching +full:- +full:m

8   DM_DA      *dd = (DM_DA *)da->data;  in DMView_DA_2d()
43 …PetscCall(PetscViewerASCIIPrintf(viewer, " Load Balance - Grid Points: Min %" PetscInt_FMT " avg… in DMView_DA_2d()
50M %" PetscInt_FMT " N %" PetscInt_FMT " m %" PetscInt_FMT " n %" PetscInt_FMT " w %" PetscInt_FMT … in DMView_DA_2d()
57 double ymin = -1 * dd->s - 1, ymax = dd->N + dd->s; in DMView_DA_2d()
58 double xmin = -1 * dd->s - 1, xmax = dd->M + dd->s; in DMView_DA_2d()
77 ymax = dd->N - 1; in DMView_DA_2d()
78 …for (xmin = 0; xmin < dd->M; xmin++) PetscCall(PetscDrawLine(draw, xmin, ymin, xmin, ymax, PETSC_D… in DMView_DA_2d()
80 xmax = dd->M - 1; in DMView_DA_2d()
81 …for (ymin = 0; ymin < dd->N; ymin++) PetscCall(PetscDrawLine(draw, xmin, ymin, xmax, ymin, PETSC_D… in DMView_DA_2d()
89 xmin = dd->xs / dd->w; in DMView_DA_2d()
90 xmax = (dd->xe - 1) / dd->w; in DMView_DA_2d()
91 ymin = dd->ys; in DMView_DA_2d()
92 ymax = dd->ye - 1; in DMView_DA_2d()
98 base = (dd->base) / dd->w; in DMView_DA_2d()
111 PetscCall(ISLocalToGlobalMappingGetBlockIndices(da->ltogmap, &idx)); in DMView_DA_2d()
113 xmin = dd->Xs; in DMView_DA_2d()
114 xmax = dd->Xe; in DMView_DA_2d()
115 ymin = dd->Ys; in DMView_DA_2d()
116 ymax = dd->Ye; in DMView_DA_2d()
119 if ((base % dd->w) == 0) { in DMView_DA_2d()
120 PetscCall(PetscSNPrintf(node, sizeof(node), "%d", (int)(idx[base / dd->w]))); in DMView_DA_2d()
121 PetscCall(PetscDrawString(draw, x / dd->w, y, PETSC_DRAW_BLUE, node)); in DMView_DA_2d()
126 PetscCall(ISLocalToGlobalMappingRestoreBlockIndices(da->ltogmap, &idx)); in DMView_DA_2d()
145 DMDAGetDiagonal_MFFD - Gets the diagonal for a matrix-free matrix where local
148 y ~= (F(u + ha) - F(u))/h,
162 PetscCall((*ctx->func)(0, U, a, ctx->funcctx)); in DMDAGetDiagonal_MFFD()
163 PetscCall((*ctx->funcisetbase)(U, ctx->funcctx)); in DMDAGetDiagonal_MFFD()
172 else if (PetscRealPart(h) < 0.0 && PetscAbsScalar(h) < umin) h = -umin; in DMDAGetDiagonal_MFFD()
176 PetscCall((*ctx->funci)(i, w, &v, ctx->funcctx)); in DMDAGetDiagonal_MFFD()
177 aa[nI] = (v - aa[nI]) / h; in DMDAGetDiagonal_MFFD()
178 ww[gI] -= h; in DMDAGetDiagonal_MFFD()
189 DM_DA *dd = (DM_DA *)da->data; in DMSetUp_DA_2D()
190 const PetscInt M = dd->M; in DMSetUp_DA_2D() local
191 const PetscInt N = dd->N; in DMSetUp_DA_2D()
192 PetscMPIInt m, n; in DMSetUp_DA_2D() local
193 const PetscInt dof = dd->w; in DMSetUp_DA_2D()
194 const PetscInt s = dd->s; in DMSetUp_DA_2D()
195 DMBoundaryType bx = dd->bx; in DMSetUp_DA_2D()
196 DMBoundaryType by = dd->by; in DMSetUp_DA_2D()
197 DMDAStencilType stencil_type = dd->stencil_type; in DMSetUp_DA_2D()
198 PetscInt *lx = dd->lx; in DMSetUp_DA_2D()
199 PetscInt *ly = dd->ly; in DMSetUp_DA_2D()
215M) * ((PetscInt64)N) * ((PetscInt64)dof) <= (PetscInt64)PETSC_MPI_INT_MAX, comm, PETSC_ERR_INT_OVE… in DMSetUp_DA_2D()
217 PetscCall(PetscMPIIntCast(dd->m, &m)); in DMSetUp_DA_2D()
218 PetscCall(PetscMPIIntCast(dd->n, &n)); in DMSetUp_DA_2D()
223 dd->p = 1; in DMSetUp_DA_2D()
224 if (m != PETSC_DECIDE) { in DMSetUp_DA_2D()
225 …PetscCheck(m >= 1, comm, PETSC_ERR_ARG_OUTOFRANGE, "Non-positive number of processors in X directi… in DMSetUp_DA_2D()
226 …PetscCheck(m <= size, comm, PETSC_ERR_ARG_OUTOFRANGE, "Too many processors in X direction: %d %d",… in DMSetUp_DA_2D()
229 …PetscCheck(n >= 1, comm, PETSC_ERR_ARG_OUTOFRANGE, "Non-positive number of processors in Y directi… in DMSetUp_DA_2D()
233 if (m == PETSC_DECIDE || n == PETSC_DECIDE) { in DMSetUp_DA_2D()
235 m = size / n; in DMSetUp_DA_2D()
236 } else if (m != PETSC_DECIDE) { in DMSetUp_DA_2D()
237 n = size / m; in DMSetUp_DA_2D()
240 m = (PetscMPIInt)(0.5 + PetscSqrtReal(((PetscReal)M) * ((PetscReal)size) / ((PetscReal)N))); in DMSetUp_DA_2D()
241 if (!m) m = 1; in DMSetUp_DA_2D()
242 while (m > 0) { in DMSetUp_DA_2D()
243 n = size / m; in DMSetUp_DA_2D()
244 if (m * n == size) break; in DMSetUp_DA_2D()
245 m--; in DMSetUp_DA_2D()
247 if (M > N && m < n) { in DMSetUp_DA_2D()
248 PetscMPIInt _m = m; in DMSetUp_DA_2D()
249 m = n; in DMSetUp_DA_2D()
253 …PetscCheck(m * n == size, comm, PETSC_ERR_PLIB, "Unable to create partition, check the size of the… in DMSetUp_DA_2D()
254 } else PetscCheck(m * n == size, comm, PETSC_ERR_ARG_OUTOFRANGE, "Given Bad partition"); in DMSetUp_DA_2D()
256 …PetscCheck(M >= m, comm, PETSC_ERR_ARG_OUTOFRANGE, "Partition in x direction is too fine! %" Petsc… in DMSetUp_DA_2D()
264 PetscCall(PetscMalloc1(m, &dd->lx)); in DMSetUp_DA_2D()
265 lx = dd->lx; in DMSetUp_DA_2D()
266 for (i = 0; i < m; i++) lx[i] = M / m + ((M % m) > i); in DMSetUp_DA_2D()
268 x = lx[rank % m]; in DMSetUp_DA_2D()
270 for (i = 0; i < (rank % m); i++) xs += lx[i]; in DMSetUp_DA_2D()
273 for (i = (rank % m); i < m; i++) left += lx[i]; in DMSetUp_DA_2D()
274 …k(left == M, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Sum of lx across processors not equal to in DMSetUp_DA_2D()
282 PetscCall(PetscMalloc1(n, &dd->ly)); in DMSetUp_DA_2D()
283 ly = dd->ly; in DMSetUp_DA_2D()
286 y = ly[rank / m]; in DMSetUp_DA_2D()
288 for (i = 0; i < (rank / m); i++) ys += ly[i]; in DMSetUp_DA_2D()
291 for (i = (rank / m); i < n; i++) left += ly[i]; in DMSetUp_DA_2D()
299 …PetscCheck((x >= s) || ((m <= 1) && (bx != DM_BOUNDARY_PERIODIC)), PETSC_COMM_SELF, PETSC_ERR_ARG_… in DMSetUp_DA_2D()
300 … DM_BOUNDARY_PERIODIC)), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Local y-width of domain y %" … in DMSetUp_DA_2D()
301 … != DM_BOUNDARY_MIRROR), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Local x-width of domain x %" … in DMSetUp_DA_2D()
302 … != DM_BOUNDARY_MIRROR), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Local y-width of domain y %" … in DMSetUp_DA_2D()
307 if (xs - s > 0) { in DMSetUp_DA_2D()
308 Xs = xs - s; in DMSetUp_DA_2D()
309 IXs = xs - s; in DMSetUp_DA_2D()
312 Xs = xs - s; in DMSetUp_DA_2D()
318 if (xe + s <= M) { in DMSetUp_DA_2D()
323 Xs = xs - s; in DMSetUp_DA_2D()
326 Xe = M; in DMSetUp_DA_2D()
328 IXe = M; in DMSetUp_DA_2D()
332 IXs = xs - s; in DMSetUp_DA_2D()
334 Xs = xs - s; in DMSetUp_DA_2D()
338 if (ys - s > 0) { in DMSetUp_DA_2D()
339 Ys = ys - s; in DMSetUp_DA_2D()
340 IYs = ys - s; in DMSetUp_DA_2D()
343 Ys = ys - s; in DMSetUp_DA_2D()
362 IYs = ys - s; in DMSetUp_DA_2D()
364 Ys = ys - s; in DMSetUp_DA_2D()
377 for (i = 1; i <= size; i++) bases[i] = ldims[i - 1]; in DMSetUp_DA_2D()
378 for (i = 1; i <= size; i++) bases[i] += bases[i - 1]; in DMSetUp_DA_2D()
382 dd->Nlocal = x * y * dof; in DMSetUp_DA_2D()
383 PetscCall(VecCreateMPIWithArray(comm, dof, dd->Nlocal, PETSC_DECIDE, NULL, &global)); in DMSetUp_DA_2D()
384 dd->nlocal = (Xe - Xs) * (Ye - Ys) * dof; in DMSetUp_DA_2D()
385 PetscCall(VecCreateSeqWithArray(PETSC_COMM_SELF, dof, dd->nlocal, NULL, &local)); in DMSetUp_DA_2D()
391 PetscCall(PetscMalloc1((IXe - IXs) * (IYe - IYs), &idx)); in DMSetUp_DA_2D()
393 left = IXs - Xs; in DMSetUp_DA_2D()
394 right = left + (IXe - IXs); in DMSetUp_DA_2D()
395 down = IYs - Ys; in DMSetUp_DA_2D()
396 up = down + (IYe - IYs); in DMSetUp_DA_2D()
399 for (j = left; j < right; j++) idx[count++] = j + i * (Xe - Xs); in DMSetUp_DA_2D()
405 /* ---------| in DMSetUp_DA_2D()
407 |--- ---| up in DMSetUp_DA_2D()
410 ---- ---- down in DMSetUp_DA_2D()
412 ----------- in DMSetUp_DA_2D()
414 left = xs - Xs; in DMSetUp_DA_2D()
416 down = ys - Ys; in DMSetUp_DA_2D()
420 for (i = (IYs - Ys); i < down; i++) { in DMSetUp_DA_2D()
421 for (j = left; j < right; j++) idx[count++] = j + i * (Xe - Xs); in DMSetUp_DA_2D()
425 for (j = (IXs - Xs); j < (IXe - Xs); j++) idx[count++] = j + i * (Xe - Xs); in DMSetUp_DA_2D()
428 for (i = up; i < up + IYe - ye; i++) { in DMSetUp_DA_2D()
429 for (j = left; j < right; j++) idx[count++] = j + i * (Xe - Xs); in DMSetUp_DA_2D()
439 /* Assume the Non-Periodic Case */ in DMSetUp_DA_2D()
440 n1 = rank - m; in DMSetUp_DA_2D()
441 if (rank % m) { in DMSetUp_DA_2D()
442 n0 = n1 - 1; in DMSetUp_DA_2D()
444 n0 = -1; in DMSetUp_DA_2D()
446 if ((rank + 1) % m) { in DMSetUp_DA_2D()
449 n8 = rank + m + 1; in DMSetUp_DA_2D()
450 if (n8 >= m * n) n8 = -1; in DMSetUp_DA_2D()
452 n2 = -1; in DMSetUp_DA_2D()
453 n5 = -1; in DMSetUp_DA_2D()
454 n8 = -1; in DMSetUp_DA_2D()
456 if (rank % m) { in DMSetUp_DA_2D()
457 n3 = rank - 1; in DMSetUp_DA_2D()
458 n6 = n3 + m; in DMSetUp_DA_2D()
459 if (n6 >= m * n) n6 = -1; in DMSetUp_DA_2D()
461 n3 = -1; in DMSetUp_DA_2D()
462 n6 = -1; in DMSetUp_DA_2D()
464 n7 = rank + m; in DMSetUp_DA_2D()
465 if (n7 >= m * n) n7 = -1; in DMSetUp_DA_2D()
470 if ((n6 < 0) && (n7 < 0) && (n3 < 0)) n6 = m - 1; in DMSetUp_DA_2D()
472 if ((n2 < 0) && (n5 < 0) && (n1 < 0)) n2 = size - m; in DMSetUp_DA_2D()
473 if ((n0 < 0) && (n3 < 0) && (n1 < 0)) n0 = size - 1; in DMSetUp_DA_2D()
476 if (n1 < 0) n1 = rank + m * (n - 1); in DMSetUp_DA_2D()
477 if (n7 < 0) n7 = rank - m * (n - 1); in DMSetUp_DA_2D()
478 if ((n3 >= 0) && (n0 < 0)) n0 = size - m + rank - 1; in DMSetUp_DA_2D()
479 if ((n3 >= 0) && (n6 < 0)) n6 = (rank % m) - 1; in DMSetUp_DA_2D()
480 if ((n5 >= 0) && (n2 < 0)) n2 = size - m + rank + 1; in DMSetUp_DA_2D()
481 if ((n5 >= 0) && (n8 < 0)) n8 = (rank % m) + 1; in DMSetUp_DA_2D()
484 if (n3 < 0) n3 = rank + (m - 1); in DMSetUp_DA_2D()
485 if (n5 < 0) n5 = rank - (m - 1); in DMSetUp_DA_2D()
486 if ((n1 >= 0) && (n0 < 0)) n0 = rank - 1; in DMSetUp_DA_2D()
487 if ((n1 >= 0) && (n2 < 0)) n2 = rank - 2 * m + 1; in DMSetUp_DA_2D()
488 if ((n7 >= 0) && (n6 < 0)) n6 = rank + 2 * m - 1; in DMSetUp_DA_2D()
491 if (n1 < 0) n1 = rank + m * (n - 1); in DMSetUp_DA_2D()
492 if (n7 < 0) n7 = rank - m * (n - 1); in DMSetUp_DA_2D()
493 if ((n3 >= 0) && (n0 < 0)) n0 = size - m + rank - 1; in DMSetUp_DA_2D()
494 if ((n3 >= 0) && (n6 < 0)) n6 = (rank % m) - 1; in DMSetUp_DA_2D()
495 if ((n5 >= 0) && (n2 < 0)) n2 = size - m + rank + 1; in DMSetUp_DA_2D()
496 if ((n5 >= 0) && (n8 < 0)) n8 = (rank % m) + 1; in DMSetUp_DA_2D()
498 if (n3 < 0) n3 = rank + (m - 1); in DMSetUp_DA_2D()
499 if (n5 < 0) n5 = rank - (m - 1); in DMSetUp_DA_2D()
500 if ((n1 >= 0) && (n0 < 0)) n0 = rank - 1; in DMSetUp_DA_2D()
501 if ((n1 >= 0) && (n2 < 0)) n2 = rank - 2 * m + 1; in DMSetUp_DA_2D()
502 if ((n7 >= 0) && (n6 < 0)) n6 = rank + 2 * m - 1; in DMSetUp_DA_2D()
506 PetscCall(PetscMalloc1(9, &dd->neighbors)); in DMSetUp_DA_2D()
508 dd->neighbors[0] = n0; in DMSetUp_DA_2D()
509 dd->neighbors[1] = n1; in DMSetUp_DA_2D()
510 dd->neighbors[2] = n2; in DMSetUp_DA_2D()
511 dd->neighbors[3] = n3; in DMSetUp_DA_2D()
512 dd->neighbors[4] = rank; in DMSetUp_DA_2D()
513 dd->neighbors[5] = n5; in DMSetUp_DA_2D()
514 dd->neighbors[6] = n6; in DMSetUp_DA_2D()
515 dd->neighbors[7] = n7; in DMSetUp_DA_2D()
516 dd->neighbors[8] = n8; in DMSetUp_DA_2D()
524 n0 = n2 = n6 = n8 = -1; in DMSetUp_DA_2D()
527 PetscCall(PetscMalloc1((Xe - Xs) * (Ye - Ys), &idx)); in DMSetUp_DA_2D()
533 x_t = lx[n0 % m]; in DMSetUp_DA_2D()
534 y_t = ly[n0 / m]; in DMSetUp_DA_2D()
535 s_t = bases[n0] + x_t * y_t - (s_y - i) * x_t - s_x; in DMSetUp_DA_2D()
541 y_t = ly[n1 / m]; in DMSetUp_DA_2D()
542 s_t = bases[n1] + x_t * y_t - (s_y + 1 - i) * x_t; in DMSetUp_DA_2D()
545 for (j = 0; j < x; j++) idx[nn++] = bases[rank] + x * (s_y - i + 1) + j; in DMSetUp_DA_2D()
549 x_t = lx[n2 % m]; in DMSetUp_DA_2D()
550 y_t = ly[n2 / m]; in DMSetUp_DA_2D()
551 s_t = bases[n2] + x_t * y_t - (s_y + 1 - i) * x_t; in DMSetUp_DA_2D()
558 x_t = lx[n3 % m]; in DMSetUp_DA_2D()
560 s_t = bases[n3] + (i + 1) * x_t - s_x; in DMSetUp_DA_2D()
563 for (j = 0; j < s_x; j++) idx[nn++] = bases[rank] + x * i + s_x - j; in DMSetUp_DA_2D()
569 x_t = lx[n5 % m]; in DMSetUp_DA_2D()
574 for (j = 0; j < s_x; j++) idx[nn++] = bases[rank] + x * (i + 1) - 2 - j; in DMSetUp_DA_2D()
580 x_t = lx[n6 % m]; in DMSetUp_DA_2D()
581 /* y_t = ly[n6 / m]; */ in DMSetUp_DA_2D()
582 s_t = bases[n6] + (i)*x_t - s_x; in DMSetUp_DA_2D()
588 /* y_t = ly[n7 / m]; */ in DMSetUp_DA_2D()
589 s_t = bases[n7] + (i - 1) * x_t; in DMSetUp_DA_2D()
592 for (j = 0; j < x; j++) idx[nn++] = bases[rank] + x * (y - i - 1) + j; in DMSetUp_DA_2D()
596 x_t = lx[n8 % m]; in DMSetUp_DA_2D()
597 /* y_t = ly[n8 / m]; */ in DMSetUp_DA_2D()
598 s_t = bases[n8] + (i - 1) * x_t; in DMSetUp_DA_2D()
625 x_t = lx[n0 % m]; in DMSetUp_DA_2D()
626 y_t = ly[n0 / m]; in DMSetUp_DA_2D()
627 s_t = bases[n0] + x_t * y_t - (s_y - i) * x_t - s_x; in DMSetUp_DA_2D()
629 } else if (xs - Xs > 0 && ys - Ys > 0) { in DMSetUp_DA_2D()
630 for (j = 0; j < s_x; j++) idx[nn++] = -1; in DMSetUp_DA_2D()
634 y_t = ly[n1 / m]; in DMSetUp_DA_2D()
635 s_t = bases[n1] + x_t * y_t - (s_y + 1 - i) * x_t; in DMSetUp_DA_2D()
637 } else if (ys - Ys > 0) { in DMSetUp_DA_2D()
639 for (j = 0; j < x; j++) idx[nn++] = bases[rank] + x * (s_y - i + 1) + j; in DMSetUp_DA_2D()
641 for (j = 0; j < x; j++) idx[nn++] = -1; in DMSetUp_DA_2D()
645 x_t = lx[n2 % m]; in DMSetUp_DA_2D()
646 y_t = ly[n2 / m]; in DMSetUp_DA_2D()
647 s_t = bases[n2] + x_t * y_t - (s_y + 1 - i) * x_t; in DMSetUp_DA_2D()
649 } else if (Xe - xe > 0 && ys - Ys > 0) { in DMSetUp_DA_2D()
650 for (j = 0; j < s_x; j++) idx[nn++] = -1; in DMSetUp_DA_2D()
656 x_t = lx[n3 % m]; in DMSetUp_DA_2D()
658 s_t = bases[n3] + (i + 1) * x_t - s_x; in DMSetUp_DA_2D()
660 } else if (xs - Xs > 0) { in DMSetUp_DA_2D()
662 for (j = 0; j < s_x; j++) idx[nn++] = bases[rank] + x * i + s_x - j; in DMSetUp_DA_2D()
664 for (j = 0; j < s_x; j++) idx[nn++] = -1; in DMSetUp_DA_2D()
671 x_t = lx[n5 % m]; in DMSetUp_DA_2D()
675 } else if (Xe - xe > 0) { in DMSetUp_DA_2D()
677 for (j = 0; j < s_x; j++) idx[nn++] = bases[rank] + x * (i + 1) - 2 - j; in DMSetUp_DA_2D()
679 for (j = 0; j < s_x; j++) idx[nn++] = -1; in DMSetUp_DA_2D()
686 x_t = lx[n6 % m]; in DMSetUp_DA_2D()
687 /* y_t = ly[n6 / m]; */ in DMSetUp_DA_2D()
688 s_t = bases[n6] + (i)*x_t - s_x; in DMSetUp_DA_2D()
690 } else if (xs - Xs > 0 && Ye - ye > 0) { in DMSetUp_DA_2D()
691 for (j = 0; j < s_x; j++) idx[nn++] = -1; in DMSetUp_DA_2D()
695 /* y_t = ly[n7 / m]; */ in DMSetUp_DA_2D()
696 s_t = bases[n7] + (i - 1) * x_t; in DMSetUp_DA_2D()
698 } else if (Ye - ye > 0) { in DMSetUp_DA_2D()
700 for (j = 0; j < x; j++) idx[nn++] = bases[rank] + x * (y - i - 1) + j; in DMSetUp_DA_2D()
702 for (j = 0; j < x; j++) idx[nn++] = -1; in DMSetUp_DA_2D()
706 x_t = lx[n8 % m]; in DMSetUp_DA_2D()
707 /* y_t = ly[n8 / m]; */ in DMSetUp_DA_2D()
708 s_t = bases[n8] + (i - 1) * x_t; in DMSetUp_DA_2D()
710 } else if (Xe - xe > 0 && Ye - ye > 0) { in DMSetUp_DA_2D()
711 for (j = 0; j < s_x; j++) idx[nn++] = -1; in DMSetUp_DA_2D()
719 PetscCall(ISLocalToGlobalMappingCreate(comm, dof, nn, idx, PETSC_OWN_POINTER, &da->ltogmap)); in DMSetUp_DA_2D()
722 dd->m = m; in DMSetUp_DA_2D()
723 dd->n = n; in DMSetUp_DA_2D()
725 dd->xs = xs * dof; in DMSetUp_DA_2D()
726 dd->xe = xe * dof; in DMSetUp_DA_2D()
727 dd->ys = ys; in DMSetUp_DA_2D()
728 dd->ye = ye; in DMSetUp_DA_2D()
729 dd->zs = 0; in DMSetUp_DA_2D()
730 dd->ze = 1; in DMSetUp_DA_2D()
731 dd->Xs = Xs * dof; in DMSetUp_DA_2D()
732 dd->Xe = Xe * dof; in DMSetUp_DA_2D()
733 dd->Ys = Ys; in DMSetUp_DA_2D()
734 dd->Ye = Ye; in DMSetUp_DA_2D()
735 dd->Zs = 0; in DMSetUp_DA_2D()
736 dd->Ze = 1; in DMSetUp_DA_2D()
741 dd->gtol = gtol; in DMSetUp_DA_2D()
742 dd->base = base; in DMSetUp_DA_2D()
743 da->ops->view = DMView_DA_2d; in DMSetUp_DA_2D()
744 dd->ltol = NULL; in DMSetUp_DA_2D()
745 dd->ao = NULL; in DMSetUp_DA_2D()
750 DMDACreate2d - Creates an object that will manage the communication of two-dimensional
756 + comm - MPI communicator
757 . bx - type of ghost nodes the x array have. Use one of `DM_BOUNDARY_NONE`, `DM_BOUNDARY_…
758 . by - type of ghost nodes the y array have. Use one of `DM_BOUNDARY_NONE`, `DM_BOUNDARY_…
759 . stencil_type - stencil type. Use either `DMDA_STENCIL_BOX` or `DMDA_STENCIL_STAR`.
760 . M - global dimension in x direction of the array
761 . N - global dimension in y direction of the array
762 . m - corresponding number of processors in x dimension (or `PETSC_DECIDE` to have calcu…
763 . n - corresponding number of processors in y dimension (or `PETSC_DECIDE` to have calcu…
764 . dof - number of degrees of freedom per node
765 . s - stencil width
766 . lx - arrays containing the number of nodes in each cell along the x coordinates, or `NU…
767 - ly - arrays containing the number of nodes in each cell along the y coordinates, or `NU…
770 . da - the resulting distributed array object
773 + -dm_view - Calls `DMView()` at the conclusion of `DMDACreate2d()`
774 . -da_grid_x <nx> - number of grid points in x direction
775 . -da_grid_y <ny> - number of grid points in y direction
776 . -da_processors_x <nx> - number of processors in x direction
777 . -da_processors_y <ny> - number of processors in y direction
778 . -da_bd_x <bx> - boundary type in x direction
779 . -da_bd_y <by> - boundary type in y direction
780 . -da_bd_all <bt> - boundary type in all directions
781 . -da_refine_x <rx> - refinement ratio in x direction
782 . -da_refine_y <ry> - refinement ratio in y direction
783 - -da_refine <n> - refine the `DMDA` n times before creating
788 If `lx` or `ly` are non-null, these must be of length as `m` and `n`, and the corresponding
789 `m` and `n` cannot be `PETSC_DECIDE`. The sum of the `lx` entries must be `M`, and the sum of
793 standard 5-pt stencil, while `DMDA_STENCIL_BOX` with width 1 denotes
794 the standard 9-pt stencil.
810 …e bx, DMBoundaryType by, DMDAStencilType stencil_type, PetscInt M, PetscInt N, PetscInt m, PetscIn… in DMDACreate2d() argument
815 PetscCall(DMDASetSizes(*da, M, N, 1)); in DMDACreate2d()
816 PetscCall(DMDASetNumProcs(*da, m, n, PETSC_DECIDE)); in DMDACreate2d()