| /petsc/src/sys/classes/draw/impls/x/ |
| H A D | xtone.c | 14 int lc, rc = 0, lx, rx = 0, xx, y, c; in PetscDrawInterpolatedTriangle_X() local 69 lx = (int)(lfrac * ((PetscReal)x2_x1) + (PetscReal)x1); in PetscDrawInterpolatedTriangle_X() 76 rx_lx = rx - lx; in PetscDrawInterpolatedTriangle_X() 77 if (rx > lx) { in PetscDrawInterpolatedTriangle_X() 78 for (xx = lx; xx <= rx; xx++) { in PetscDrawInterpolatedTriangle_X() 79 c = (((xx - lx) * (rc_lc)) / (rx_lx) + lc) >> SHIFT_VAL; in PetscDrawInterpolatedTriangle_X() 83 } else if (rx < lx) { in PetscDrawInterpolatedTriangle_X() 84 for (xx = lx; xx >= rx; xx--) { in PetscDrawInterpolatedTriangle_X() 85 c = (((xx - lx) * (rc_lc)) / (rx_lx) + lc) >> SHIFT_VAL; in PetscDrawInterpolatedTriangle_X() 92 XDrawPoint(win->disp, PetscDrawXiDrawable(win), win->gc.set, lx, y); in PetscDrawInterpolatedTriangle_X() [all …]
|
| /petsc/src/vec/vec/tutorials/ |
| H A D | ex9.c | 25 Vec lx, gx, gxs; in main() local 105 PetscCall(VecGhostGetLocalForm(gx, &lx)); in main() 124 PetscCall(VecGetArray(lx, &array)); in main() 126 PetscCall(VecRestoreArray(lx, &array)); in main() 128 PetscCall(VecGhostRestoreLocalForm(gx, &lx)); in main() 133 PetscCall(VecGhostGetLocalForm(gx, &lx)); in main() 134 PetscCall(VecGetArray(lx, &array)); in main() 136 PetscCall(VecRestoreArray(lx, &array)); in main() 137 PetscCall(VecGhostRestoreLocalForm(gx, &lx)); in main() 142 PetscCall(VecGhostGetLocalForm(gx, &lx)); in main() [all …]
|
| H A D | ex14f.F90 | 23 Vec lx, gx, gxs 83 PetscCallA(VecGhostGetLocalForm(gx, lx, ierr)) 104 PetscCallA(VecView(lx, singleton, ierr)) 107 PetscCallA(VecGhostRestoreLocalForm(gx, lx, ierr))
|
| H A D | ex9f.F90 | 23 Vec lx, gx, gxs 81 PetscCallA(VecGhostGetLocalForm(gx, lx, ierr)) 102 PetscCallA(VecView(lx, subviewer, ierr)) 105 PetscCallA(VecGhostRestoreLocalForm(gx, lx, ierr))
|
| /petsc/src/dm/tests/output/ |
| H A D | ex34_1.out | 27 [0] lx ly lz 31 [1] lx ly lz 35 [2] lx ly lz 39 [3] lx ly lz 43 [4] lx ly lz 47 [5] lx ly lz 51 [6] lx ly lz 55 [7] lx ly lz 59 [8] lx ly lz 63 [9] lx ly lz [all …]
|
| /petsc/src/sys/classes/draw/impls/image/ |
| H A D | drawimage.h | 115 int lc, rc = 0, lx, rx = 0, xx, y, c; in PetscImageDrawTriangle() local 168 lx = (int)(lfrac * ((float)x2_x1) + (float)x_1); in PetscImageDrawTriangle() 175 rx_lx = rx - lx; in PetscImageDrawTriangle() 176 if (rx > lx) { in PetscImageDrawTriangle() 177 for (xx = lx; xx <= rx; xx++) { in PetscImageDrawTriangle() 178 c = (((xx - lx) * (rc_lc)) / (rx_lx) + lc) >> SHIFT_VAL; in PetscImageDrawTriangle() 181 } else if (rx < lx) { in PetscImageDrawTriangle() 182 for (xx = lx; xx >= rx; xx--) { in PetscImageDrawTriangle() 183 c = (((xx - lx) * (rc_lc)) / (rx_lx) + lc) >> SHIFT_VAL; in PetscImageDrawTriangle() 188 PetscImageDrawPixel(img, lx, y, c); in PetscImageDrawTriangle() [all …]
|
| /petsc/src/dm/impls/da/ftn-custom/ |
| H A D | zdaf.c | 35 PETSC_EXTERN void dmdagetownershipranges_(DM *da, F90Array1d *lx, F90Array1d *ly, F90Array1d *lz, P… in dmdagetownershipranges_() argument 44 if ((void *)lx != PETSC_NULL_INTEGER_POINTER_Fortran) { in dmdagetownershipranges_() 45 *ierr = F90Array1dCreate((PetscInt *)gx, MPIU_INT, 1, M, lx PETSC_F90_2PTR_PARAM(lxd)); in dmdagetownershipranges_() 55 PETSC_EXTERN void dmdarestoreownershipranges_(DM *da, F90Array1d *lx, F90Array1d *ly, F90Array1d *l… in dmdarestoreownershipranges_() argument 57 if ((void *)lx != PETSC_NULL_INTEGER_POINTER_Fortran) { in dmdarestoreownershipranges_() 58 *ierr = F90Array1dDestroy(lx, MPIU_INT PETSC_F90_2PTR_PARAM(lxd)); in dmdarestoreownershipranges_()
|
| /petsc/src/dm/tests/ |
| H A D | ex46.c | 10 PetscInt *lx = NULL, *ly = NULL, *lz = NULL; in main() local 69 PetscCall(PetscMalloc1(m, &lx)); in main() 70 for (i = 0; i < m - 1; i++) lx[i] = 4; in main() 71 lx[m - 1] = M - 4 * (m - 1); in main() 82 …PetscCall(DMDACreate3d(PETSC_COMM_WORLD, bx, by, bz, stencil_type, M, N, P, m, n, p, w, s, lx, ly,… in main() 99 …PetscCall(DMDACreate3d(comm2, bx, by, bz, stencil_type, M, N, P, m, n, p, w, s, lx, ly, lz, &da2)); in main() 122 …PetscCall(DMDACreate3d(PETSC_COMM_WORLD, bx, by, bz, stencil_type, M, N, P, m, n, p, w, 0, lx, ly,… in main() 135 …PetscCall(DMDACreate3d(PETSC_COMM_WORLD, bx, by, bz2, stencil_type, M, N, P, m, n, p, w, s, lx, ly… in main() 147 …reate3d(PETSC_COMM_WORLD, bx, by, bz, stencil_type, M, N, P * 2, m, n, p, w, s, lx, ly, lz, &da2)); in main() 166 …PetscCall(DMDACreate3d(PETSC_COMM_WORLD, bx, by, bz, stencil_type, M, N, P, m, n, p, w, s, lx, ly,… in main() [all …]
|
| H A D | ex34.c | 11 const PetscInt *lx, *ly, *lz; in main() local 30 PetscCall(DMDAGetOwnershipRanges(da, &lx, &ly, &lz)); in main() 35 PetscCall(PetscIntView(m, lx, vw)); in main()
|
| H A D | ex1f.F90 | 17 PetscInt, pointer :: lx(:), ly(:) 39 PetscCallA(DMDAGetOwnershipRanges(da, lx, ly, PETSC_NULL_INTEGER_POINTER, ierr)) 40 PetscCallA(DMDARestoreOwnershipRanges(da, lx, ly, PETSC_NULL_INTEGER_POINTER, ierr))
|
| H A D | ex4.c | 13 PetscInt *lx = NULL, *ly = NULL; in main() local 63 PetscCall(PetscMalloc1(m, &lx)); in main() 64 for (i = 0; i < m - 1; i++) lx[i] = 4; in main() 65 lx[m - 1] = M - 4 * (m - 1); in main() 73 PetscCall(DMDACreate2d(PETSC_COMM_WORLD, bx, by, st, M, N, m, n, w, s, lx, ly, &da)); in main() 76 PetscCall(PetscFree(lx)); in main()
|
| H A D | ex6.c | 13 PetscInt *lx = NULL, *ly = NULL, *lz = NULL; in main() local 77 PetscCall(PetscMalloc1(m, &lx)); in main() 78 for (i = 0; i < m - 1; i++) lx[i] = 4; in main() 79 lx[m - 1] = M - 4 * (m - 1); in main() 91 …PetscCall(DMDACreate3d(PETSC_COMM_WORLD, bx, by, bz, stencil_type, M, N, P, m, n, p, w, s, lx, ly,… in main() 94 PetscCall(PetscFree(lx)); in main()
|
| /petsc/src/dm/impls/da/ |
| H A D | da.c | 566 …PetscErrorCode DMDACheckOwnershipRanges_Private(DM da, PetscInt M, PetscInt m, const PetscInt lx[]) in DMDACheckOwnershipRanges_Private() argument 572 for (i = sum = 0; i < m; i++) sum += lx[i]; in DMDACheckOwnershipRanges_Private() 595 PetscErrorCode DMDASetOwnershipRanges(DM da, const PetscInt lx[], const PetscInt ly[], const PetscI… in DMDASetOwnershipRanges() argument 602 if (lx) { in DMDASetOwnershipRanges() 604 PetscCall(DMDACheckOwnershipRanges_Private(da, dd->M, dd->m, lx)); in DMDASetOwnershipRanges() 605 if (!dd->lx) PetscCall(PetscMalloc1(dd->m, &dd->lx)); in DMDASetOwnershipRanges() 606 PetscCall(PetscArraycpy(dd->lx, lx, dd->m)); in DMDASetOwnershipRanges() 748 PetscErrorCode DMDAGetOwnershipRanges(DM da, PeOp const PetscInt *lx[], PeOp const PetscInt *ly[], … in DMDAGetOwnershipRanges() argument 754 if (lx) *lx = dd->lx; in DMDAGetOwnershipRanges() 1059 PetscInt *lx, *ly, *lz; in DMRefine_DA() local [all …]
|
| H A D | da1.c | 130 const PetscInt *lx = dd->lx; in DMSetUp_DA_1D() local 160 if (!lx) { in DMSetUp_DA_1D() 161 PetscCall(PetscMalloc1(m, &dd->lx)); in DMSetUp_DA_1D() 177 PetscCallMPI(MPI_Allgather(&xs, 1, MPIU_INT, dd->lx, 1, MPIU_INT, comm)); in DMSetUp_DA_1D() 178 for (i = 0; i < m - 1; i++) dd->lx[i] = dd->lx[i + 1] - dd->lx[i]; in DMSetUp_DA_1D() 179 dd->lx[m - 1] = M - dd->lx[m - 1]; in DMSetUp_DA_1D() 181 x = lx[rank]; in DMSetUp_DA_1D() 183 for (i = 0; i < rank; i++) xs += lx[i]; in DMSetUp_DA_1D() 186 for (i = rank; i < size; i++) left += lx[i]; in DMSetUp_DA_1D() 357 …PI_Comm comm, DMBoundaryType bx, PetscInt M, PetscInt dof, PetscInt s, const PetscInt lx[], DM *da) in DMDACreate1d() argument [all …]
|
| H A D | da2.c | 198 PetscInt *lx = dd->lx; in DMSetUp_DA_2D() local 263 if (!lx) { 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() 533 x_t = lx[n0 % m]; in DMSetUp_DA_2D() 549 x_t = lx[n2 % m]; in DMSetUp_DA_2D() [all …]
|
| H A D | da3.c | 203 PetscInt *lx = dd->lx; in DMSetUp_DA_3D() local 335 if (!lx) { in DMSetUp_DA_3D() 336 PetscCall(PetscMalloc1(m, &dd->lx)); in DMSetUp_DA_3D() 337 lx = dd->lx; in DMSetUp_DA_3D() 338 for (i = 0; i < m; i++) lx[i] = M / m + ((M % m) > (i % m)); in DMSetUp_DA_3D() 340 x = lx[rank % m]; in DMSetUp_DA_3D() 342 for (i = 0; i < (rank % m); i++) xs += lx[i]; in DMSetUp_DA_3D() 815 x_t = lx[n0 % m]; in DMSetUp_DA_3D() 831 x_t = lx[n2 % m]; in DMSetUp_DA_3D() 842 x_t = lx[n3 % m]; in DMSetUp_DA_3D() [all …]
|
| H A D | dacorn.c | 308 const PetscInt *lx, *ly, *lz; in DMDACreateCompatibleDMDA() local 330 PetscCall(DMDAGetOwnershipRanges(da, &lx, &ly, &lz)); in DMDACreateCompatibleDMDA() 332 PetscCall(DMDACreate1d(PetscObjectComm((PetscObject)da), bx, M, nfields, s, dd->lx, nda)); in DMDACreateCompatibleDMDA() 334 …te2d(PetscObjectComm((PetscObject)da), bx, by, stencil_type, M, N, m, n, nfields, s, lx, ly, nda)); in DMDACreateCompatibleDMDA() 336 …ctComm((PetscObject)da), bx, by, bz, stencil_type, M, N, P, m, n, p, nfields, s, lx, ly, lz, nda)); in DMDACreateCompatibleDMDA()
|
| /petsc/src/dm/impls/plex/tests/ |
| H A D | ex23.c | 178 Vec x, lx; in TestFunctionProjection() local 196 PetscCall(DMGetLocalVector(dm, &lx)); in TestFunctionProjection() 199 PetscCall(PetscObjectSetName((PetscObject)lx, lname)); in TestFunctionProjection() 200 if (!label) PetscCall(DMProjectFunctionLocal(dm, 0.0, funcs, NULL, INSERT_VALUES, lx)); in TestFunctionProjection() 201 …Call(DMProjectFunctionLabelLocal(dm, 0.0, label, 1, val, 0, NULL, funcs, NULL, INSERT_VALUES, lx)); in TestFunctionProjection() 202 PetscCall(VecViewFromOptions(lx, NULL, "-local_func_view")); in TestFunctionProjection() 203 PetscCall(DMRestoreLocalVector(dm, &lx)); in TestFunctionProjection() 213 Vec lx, lu; in TestFieldProjection() local 232 PetscCall(DMGetLocalVector(dm, &lx)); in TestFieldProjection() 235 PetscCall(PetscObjectSetName((PetscObject)lx, lname)); in TestFieldProjection() [all …]
|
| /petsc/src/dm/impls/stag/tests/ |
| H A D | ex14.c | 21 PetscInt lx[4] = {2, 3}, ranksx = 2, mx = 5; in main() local 29 …Call(DMStagCreate1d(PETSC_COMM_WORLD, DM_BOUNDARY_NONE, mx, 1, 1, DMSTAG_STENCIL_BOX, 1, lx, &dm)); in main() 33 …DARY_NONE, DM_BOUNDARY_NONE, mx, my, ranksx, ranksy, 1, 1, 1, DMSTAG_STENCIL_BOX, 1, lx, ly, &dm)); in main() 37 …ARY_NONE, mx, my, mz, ranksx, ranksy, ranksz, 1, 1, 1, 1, DMSTAG_STENCIL_BOX, 1, lx, ly, lz, &dm)); in main()
|
| H A D | ex1.c | 40 PetscInt lx[4] = {1, 2, 3}, ranksx = 3, mx = 6; in main() local 48 …(DMStagCreate1d(PETSC_COMM_WORLD, DM_BOUNDARY_NONE, mx, 1, 1, DMSTAG_STENCIL_BOX, 1, lx, &dmstag)); in main() 52 …_NONE, DM_BOUNDARY_NONE, mx, my, ranksx, ranksy, 1, 1, 1, DMSTAG_STENCIL_BOX, 1, lx, ly, &dmstag)); in main() 56 …NONE, mx, my, mz, ranksx, ranksy, ranksz, 1, 1, 1, 1, DMSTAG_STENCIL_BOX, 1, lx, ly, lz, &dmstag)); in main()
|
| /petsc/src/sys/ftn-custom/ |
| H A D | zutils.c | 183 …arAddressFromFortran(PetscObject obj, PetscScalar *base, size_t addr, PetscInt N, PetscScalar **lx) in PetscScalarAddressFromFortran() argument 192 PetscCall(PetscContainerGetPointer(container, lx)); in PetscScalarAddressFromFortran() 195 shift = *(PetscInt *)*lx; in PetscScalarAddressFromFortran() 196 PetscCall(PetscArraycpy(*lx, tlx, N)); in PetscScalarAddressFromFortran() 203 *lx = base + addr; in PetscScalarAddressFromFortran()
|
| /petsc/src/dm/tutorials/ |
| H A D | ex51.c | 12 const PetscInt *lx, *ly; in main() local 27 PetscCall(DMDAGetOwnershipRanges(da, &lx, &ly, NULL)); in main() 40 PetscCall(DMDACreate1d(commX, DM_BOUNDARY_NONE, info.mx, dof, 1, lx, &daX)); in main()
|
| /petsc/src/ksp/pc/impls/asm/ |
| H A D | asm.c | 323 PetscCall(VecCreate(PETSC_COMM_SELF, &osm->lx)); in PCSetUp_ASM() 324 PetscCall(VecSetSizes(osm->lx, m, m)); in PCSetUp_ASM() 325 PetscCall(VecSetType(osm->lx, vtype)); in PCSetUp_ASM() 326 PetscCall(VecDuplicate(osm->lx, &osm->ly)); in PCSetUp_ASM() 327 PetscCall(VecScatterCreate(vec, osm->lis, osm->lx, isl, &osm->restriction)); in PCSetUp_ASM() 442 PetscCall(VecSet(osm->lx, 0.0)); in PCApply_ASM() 452 PetscCall(VecScatterBegin(osm->restriction, x, osm->lx, INSERT_VALUES, forward)); in PCApply_ASM() 453 PetscCall(VecScatterEnd(osm->restriction, x, osm->lx, INSERT_VALUES, forward)); in PCApply_ASM() 456 PetscCall(VecScatterBegin(osm->lrestriction[0], osm->lx, osm->x[0], INSERT_VALUES, forward)); in PCApply_ASM() 457 PetscCall(VecScatterEnd(osm->lrestriction[0], osm->lx, osm->x[0], INSERT_VALUES, forward)); in PCApply_ASM() [all …]
|
| /petsc/src/dm/impls/stag/ |
| H A D | stagintern.c | 63 …dof3, DMStagStencilType stencilType, PetscInt stencilWidth, const PetscInt lx[], const PetscInt ly… in DMStagInitialize() argument 73 PetscCall(DMStagSetOwnershipRanges(dm, lx, ly, lz)); in DMStagInitialize()
|
| /petsc/include/petsc/private/ |
| H A D | pcasmimpl.h | 12 Vec lx, ly; /* work vectors */ member
|