| /petsc/src/snes/tests/ |
| H A D | ex8.c | 149 PetscErrorCode constant(PetscInt dim, PetscReal time, const PetscReal coords[], PetscInt Nc, PetscS… in constant() argument 161 PetscErrorCode constantDer(PetscInt dim, PetscReal time, const PetscReal coords[], const PetscReal … in constantDer() argument 175 PetscErrorCode linear(PetscInt dim, PetscReal time, const PetscReal coords[], PetscInt Nc, PetscSca… in linear() argument 181 for (d = 0; d < Nc; ++d) u[d] = coords[d]; in linear() 183 u[0] = coords[d]; in linear() 187 PetscErrorCode linearDer(PetscInt dim, PetscReal time, const PetscReal coords[], const PetscReal n[… in linearDer() argument 205 PetscErrorCode quadratic(PetscInt dim, PetscReal time, const PetscReal coords[], PetscInt Nc, Petsc… in quadratic() argument 212 u[0] = coords[0] * coords[1]; in quadratic() 213 u[1] = coords[1] * coords[2]; in quadratic() 214 u[2] = coords[2] * coords[0]; in quadratic() [all …]
|
| /petsc/src/dm/impls/plex/tests/ |
| H A D | ex3.c | 40 PetscErrorCode constant(PetscInt dim, PetscReal time, const PetscReal coords[], PetscInt Nf, PetscS… in constant() argument 47 PetscErrorCode constantDer(PetscInt dim, PetscReal time, const PetscReal coords[], const PetscReal … in constantDer() argument 55 PetscErrorCode rt0(PetscInt dim, PetscReal time, const PetscReal coords[], PetscInt Nf, PetscScalar… in rt0() argument 58 for (d = 0; d < dim; ++d) u[d] = 1.0 + coords[d]; in rt0() 62 PetscErrorCode rt0Der(PetscInt dim, PetscReal time, const PetscReal coords[], const PetscReal n[], … in rt0Der() argument 73 PetscErrorCode linear(PetscInt dim, PetscReal time, const PetscReal coords[], PetscInt Nf, PetscSca… in linear() argument 76 for (d = 0; d < dim; ++d) u[d] = coords[d] + coords[dim - d - 1]; in linear() 79 PetscErrorCode linearDer(PetscInt dim, PetscReal time, const PetscReal coords[], const PetscReal n[… in linearDer() argument 90 PetscErrorCode rt1(PetscInt dim, PetscReal time, const PetscReal coords[], PetscInt Nf, PetscScalar… in rt1() argument 93 …u[0] = 1.0 + coords[0] + coords[1] + coords[2] + coords[0] * coords[0] + coords[0] * coords[1] + c… in rt1() [all …]
|
| H A D | ex18.c | 209 PetscScalar coords[128]; member 281 …ts corresponding to vertices with given coordinates", "ex18.c", options->coords, &options->ncoords… in ProcessOptions() 322 PetscReal *coords; in CreateMesh_1D() local 335 PetscCall(PetscMalloc2(2 * numCells, &cells, 2 * numVertices, &coords)); in CreateMesh_1D() 339 coords[2 * i] = i; in CreateMesh_1D() 340 coords[2 * i + 1] = i + 1; in CreateMesh_1D() 343 …sc(comm, user->dim, numCells, numVertices, numCorners, PETSC_FALSE, cells, user->dim, coords, dm)); in CreateMesh_1D() 344 PetscCall(PetscFree2(cells, coords)); in CreateMesh_1D() 355 PetscCall(PetscMalloc2(2 * numCells, &cells, 2 * numCells, &coords)); in CreateMesh_1D() 360 coords[0] = 0.; in CreateMesh_1D() [all …]
|
| /petsc/src/dm/impls/moab/ |
| H A D | dmmbfem.cxx | 110 …mpute_Lagrange_Basis_1D_Internal(const PetscInt nverts, const PetscReal *coords, const PetscInt np… in Compute_Lagrange_Basis_1D_Internal() argument 135 const PetscReal *vertices = coords + i * 3; in Compute_Lagrange_Basis_1D_Internal() 164 const PetscReal *vertices = coords + i * 3; in Compute_Lagrange_Basis_1D_Internal() 220 …mpute_Lagrange_Basis_2D_Internal(const PetscInt nverts, const PetscReal *coords, const PetscInt np… in Compute_Lagrange_Basis_2D_Internal() argument 252 const PetscReal *vertices = coords + i * 3; in Compute_Lagrange_Basis_2D_Internal() 281 const PetscReal x2 = coords[2 * 3 + 0], y2 = coords[2 * 3 + 1]; in Compute_Lagrange_Basis_2D_Internal() 287 jacobian[0] = (coords[0 * 3 + 0] - x2); in Compute_Lagrange_Basis_2D_Internal() 288 jacobian[1] = (coords[1 * 3 + 0] - x2); in Compute_Lagrange_Basis_2D_Internal() 289 jacobian[2] = (coords[0 * 3 + 1] - y2); in Compute_Lagrange_Basis_2D_Internal() 290 jacobian[3] = (coords[1 * 3 + 1] - y2); in Compute_Lagrange_Basis_2D_Internal() [all …]
|
| /petsc/src/mat/tests/ |
| H A D | ex246.cxx | 9 PetscReal diff = 0.0, *coords = (PetscReal *)(ctx); in GenEntries() local 15 … (d = 0; d < sdim; d++) diff += (coords[J[j] * sdim + d] - coords[K[k] * sdim + d]) * (coords[J[j]… in GenEntries() 23 PetscReal *coords; member in MyIMatrix 27 …MyIMatrix(PetscInt spacedim, PetscReal *gcoords) : htool::VirtualGenerator<PetscScalar>(), coords(… in MyIMatrix() 37 …t d = 0; d < sdim; d++) diff += (coords[J[j] * sdim + d] - coords[K[k] * sdim + d]) * (coords[J[j]… in copy_submatrix() 49 PetscReal *coords, *gcoords, norm, epsilon, relative; in main() local 64 PetscCall(PetscMalloc1(m * dim, &coords)); in main() 66 PetscCall(PetscRandomGetValuesReal(rdm, m * dim, coords)); in main() 69 PetscCall(PetscArraycpy(gcoords + begin * dim, coords, m * dim)); in main() 72 …PetscCall(MatCreateHtoolFromKernel(PETSC_COMM_WORLD, m, m, M, M, dim, coords, coords, NULL, imatri… in main() [all …]
|
| H A D | ex268.c | 8 PetscReal diff = 0.0, *coords = (PetscReal *)(ctx); in GenEntries() local 14 … (d = 0; d < sdim; d++) diff += (coords[J[j] * sdim + d] - coords[K[k] * sdim + d]) * (coords[J[j]… in GenEntries() 27 PetscReal *coords, *gcoords, norm, epsilon; in main() local 44 PetscCall(PetscMalloc1(m * dim, &coords)); in main() 46 PetscCall(PetscRandomGetValuesReal(rdm, m * dim, coords)); in main() 51 PetscCall(PetscArraycpy(gcoords + begin * dim, coords, m * dim)); in main() 53 …PetscCall(MatCreateHtoolFromKernel(PETSC_COMM_WORLD, m, m, M, M, dim, coords, coords, kernel, gcoo… in main() 129 PetscCall(PetscFree(coords)); in main()
|
| H A D | ex241.c | 8 PetscReal diff = 0.0, *coords = (PetscReal *)(ctx); in GenEntries() local 14 … (d = 0; d < sdim; d++) diff += (coords[J[j] * sdim + d] - coords[K[k] * sdim + d]) * (coords[J[j]… in GenEntries() 24 PetscReal diff = 0.0, **coords = (PetscReal **)(ctx); in GenEntriesRectangular() local 30 …= 0; d < sdim; d++) diff += (coords[0][J[j] * sdim + d] - coords[1][K[k] * sdim + d]) * (coords[0]… in GenEntriesRectangular() 43 …PetscReal *coords, *gcoords, *scoords, *gscoords, *ctx[2], norm, epsilon = PetscSqrtReal(PE… in main() local 62 PetscCall(PetscMalloc1(m * dim, &coords)); in main() 64 PetscCall(PetscRandomGetValuesReal(rdm, m * dim, coords)); in main() 69 PetscCall(PetscArraycpy(gcoords + begin * dim, coords, m * dim)); in main() 71 …PetscCall(MatCreateHtoolFromKernel(PETSC_COMM_WORLD, m, m, M, M, dim, coords, coords, kernel, gcoo… in main() 113 …PetscCall(MatCreateHtoolFromKernel(PETSC_COMM_WORLD, m, m, M, M, dim, coords, coords, kernel, gcoo… in main() [all …]
|
| /petsc/src/ksp/ksp/tutorials/ |
| H A D | ex82.c | 8 PetscReal diff = 0.0, *coords = (PetscReal *)(ctx); in GenEntries() local 16 … (d = 0; d < sdim; d++) diff += (coords[J[j] * sdim + d] - coords[K[k] * sdim + d]) * (coords[J[j]… in GenEntries() 35 PetscReal *coords, *gcoords; in main() local 49 PetscCall(PetscMalloc1(m * dim, &coords)); in main() 51 PetscCall(PetscRandomGetValuesReal(rdm, m * dim, coords)); in main() 54 PetscCall(PetscArraycpy(gcoords + begin * dim, coords, m * dim)); in main() 56 …PetscCall(MatCreateHtoolFromKernel(PETSC_COMM_WORLD, m, m, M, M, dim, coords, coords, kernel, gcoo… in main() 94 PetscCall(PetscFree(coords)); in main()
|
| H A D | ex36.cxx | 209 PetscReal ComputeDiffusionCoefficient(PetscReal coords[3], UserContext *user) in ComputeDiffusionCoefficient() 212 …if ((coords[0] > 1.0 / 3.0) && (coords[0] < 2.0 / 3.0) && (coords[1] > 1.0 / 3.0) && (coords[1] < … in ComputeDiffusionCoefficient() 217 PetscReal ComputeReactionCoefficient(PetscReal coords[3], UserContext *user) in ComputeReactionCoefficient() 220 …if ((coords[0] > 1.0 / 3.0) && (coords[0] < 2.0 / 3.0) && (coords[1] > 1.0 / 3.0) && (coords[1] < … in ComputeReactionCoefficient() 225 double ExactSolution(PetscReal coords[3], UserContext *user) in ExactSolution() 228 const PetscScalar xx = (coords[0] - user->xyzref[0]) * (coords[0] - user->xyzref[0]); in ExactSolution() 229 const PetscScalar yy = (coords[1] - user->xyzref[1]) * (coords[1] - user->xyzref[1]); in ExactSolution() 230 const PetscScalar zz = (coords[2] - user->xyzref[2]) * (coords[2] - user->xyzref[2]); in ExactSolution() 232 } else return sin(PETSC_PI * coords[0]) * sin(PETSC_PI * coords[1]) * sin(PETSC_PI * coords[2]); in ExactSolution() 237 PetscReal coords[3] = {x, y, z}; in exact_solution() local [all …]
|
| H A D | ex35.cxx | 222 PetscReal ComputeDiffusionCoefficient(PetscReal coords[3], UserContext *user) in ComputeDiffusionCoefficient() 226 …if ((coords[0] > user->bounds[1] / 3.0) && (coords[0] < 2.0 * user->bounds[1] / 3.0) && (coords[1]… in ComputeDiffusionCoefficient() 238 PetscScalar ExactSolution(PetscReal coords[3], UserContext *user) in ExactSolution() 242 … return sin(PETSC_PI * coords[0] / user->bounds[1]) * sin(PETSC_PI * coords[1] / user->bounds[3]); in ExactSolution() 250 PetscScalar ComputeForcingFunction(PetscReal coords[3], UserContext *user) in ComputeForcingFunction() 254 …return user->nu * sin(PETSC_PI * coords[0] / user->bounds[1]) * sin(PETSC_PI * coords[1] / user->b… in ComputeForcingFunction() 256 …return PetscExpScalar(-((coords[0] - user->xref) * (coords[0] - user->xref) + (coords[1] - user->y… in ComputeForcingFunction() 259 …coords, user) * (1.0 / user->bounds[1] / user->bounds[1] + 1.0 / user->bounds[3] / user->bounds[3]… in ComputeForcingFunction() 266 PetscScalar EvaluateStrongDirichletCondition(PetscReal coords[3], UserContext *user) in EvaluateStrongDirichletCondition() 270 …if (BCHECK(coords[0], user->bounds[0]) || BCHECK(coords[0], user->bounds[1]) || BCHECK(coords[1], … in EvaluateStrongDirichletCondition() [all …]
|
| H A D | ex21.c | 31 PetscReal norm, *coords, eta, scale = 0.5; in main() local 55 PetscCall(PetscMalloc1(sdim * n, &coords)); in main() 56 PetscCall(PetscRandomGetValuesReal(r, sdim * n, coords)); in main() 73 …for (j = 0; j < n; j++) PetscCall(MatSetValue(Ad, i, j, RBF(sdim, coords + i * sdim, coords + j * … in main() 80 …OpusFromKernel(PETSC_COMM_WORLD, n, n, PETSC_DECIDE, PETSC_DECIDE, sdim, coords, PETSC_FALSE, RBF,… in main() 117 PetscCall(PCSetCoordinates(pc, sdim, n, coords)); in main() 153 PetscCall(PetscFree(coords)); in main()
|
| H A D | ex43.c | 143 …Scalar GNi[][NODES_PER_EL], PetscScalar GNx[][NODES_PER_EL], PetscScalar coords[], PetscScalar *de… in ConstructQ12D_GNx() argument 151 PetscScalar cx = coords[2 * i]; in ConstructQ12D_GNx() 152 PetscScalar cy = coords[2 * i + 1]; in ConstructQ12D_GNx() 316 Vec coords; in DMDACoordViewGnuplot2d() local 332 PetscCall(DMGetCoordinatesLocal(da, &coords)); in DMDACoordViewGnuplot2d() 333 PetscCall(DMDAVecGetArrayRead(cda, coords, &_coords)); in DMDACoordViewGnuplot2d() 344 PetscCall(DMDAVecRestoreArrayRead(cda, coords, &_coords)); in DMDACoordViewGnuplot2d() 353 Vec coords, local_fields; in DMDAViewGnuplot2d() local 379 PetscCall(DMGetCoordinatesLocal(da, &coords)); in DMDAViewGnuplot2d() 380 PetscCall(DMDAVecGetArray(cda, coords, &_coords)); in DMDAViewGnuplot2d() [all …]
|
| /petsc/src/dm/impls/swarm/tutorials/ |
| H A D | ex1.c | 19 PetscReal *wq, *coords; in main() local 60 PetscCall(DMSwarmGetField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in main() 62 coords[p * 2 + 0] = -PetscCosReal((PetscReal)(p + 1) / (PetscReal)(Np + 1) * PETSC_PI); in main() 63 coords[p * 2 + 1] = PetscSinReal((PetscReal)(p + 1) / (PetscReal)(Np + 1) * PETSC_PI); in main() 65 energy_0 += wq[p] * (PetscSqr(coords[p * 2 + 0]) + PetscSqr(coords[p * 2 + 1])); in main() 67 PetscCall(DMSwarmRestoreField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in main() 81 PetscCall(DMSwarmGetField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in main() 82 …etscInt p = 0; p < Np; ++p) energy_1 += wq[p] * (PetscSqr(coords[p * 2 + 0]) + PetscSqr(coords[p *… in main() 83 PetscCall(DMSwarmRestoreField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in main()
|
| /petsc/src/dm/impls/plex/ |
| H A D | plexgeometry.c | 205 …on_Coords_Internal(DM dm, PetscInt dim, PetscInt cdim, const PetscScalar coords[], const PetscReal… in DMPlexGetPlaneSimplexIntersection_Coords_Internal() argument 224 for (PetscInt i = 0; i < cdim; ++i) c[i] = PetscRealPart(coords[v * cdim + i]); in DMPlexGetPlaneSimplexIntersection_Coords_Internal() 227 d[v] = DMPlex_DotRealD_Internal(cdim, normal, &coords[v * cdim]); in DMPlexGetPlaneSimplexIntersection_Coords_Internal() 249 … for (PetscInt i = 0; i < cdim; ++i) intPoints[n * cdim + i] = PetscRealPart(coords[v * cdim + i]); in DMPlexGetPlaneSimplexIntersection_Coords_Internal() 258 …i) intPoints[n * cdim + i] = (d[v] * PetscRealPart(coords[w * cdim + i]) - d[w] * PetscRealPart(co… in DMPlexGetPlaneSimplexIntersection_Coords_Internal() 272 PetscScalar *coords = NULL; in DMPlexGetPlaneSimplexIntersection_Internal() local 280 PetscCall(DMPlexGetCellCoordinates(dm, c, &isDG, &numCoords, &array, &coords)); in DMPlexGetPlaneSimplexIntersection_Internal() 284 …PetscCall(DMPlexGetPlaneSimplexIntersection_Coords_Internal(dm, dim, cdim, coords, p, normal, pos,… in DMPlexGetPlaneSimplexIntersection_Internal() 286 PetscCall(DMPlexRestoreCellCoordinates(dm, c, &isDG, &numCoords, &array, &coords)); in DMPlexGetPlaneSimplexIntersection_Internal() 293 PetscScalar *coords = NULL; in DMPlexGetPlaneQuadIntersection_Internal() local [all …]
|
| /petsc/src/dm/tests/ |
| H A D | ex32.c | 25 Vec coords, gcoords, gcoords2; in TestQ2Q1DA() local 35 PetscCall(DMGetCoordinates(Q2_da, &coords)); in TestQ2Q1DA() 39 PetscCall(DMSetCoordinates(Q1_da, coords)); in TestQ2Q1DA() 45 PetscCall(DMGetCoordinates(Q1_da, &coords)); in TestQ2Q1DA() 48 PetscCall(DMGlobalToLocalBegin(cda, coords, INSERT_VALUES, gcoords2)); in TestQ2Q1DA() 49 PetscCall(DMGlobalToLocalEnd(cda, coords, INSERT_VALUES, gcoords2)); in TestQ2Q1DA() 54 PetscCall(VecScale(coords, 10.0)); in TestQ2Q1DA()
|
| H A D | ex27.c | 26 Vec coords, x, y, z, xx, yy, zz; in main() local 55 PetscCall(DMGetGlobalVector(coordsda, &coords)); in main() 56 PetscCall(PetscObjectSetName((PetscObject)coords, "Grid coordinates")); in main() 60 PetscCall(VecGetArray(coords, &a)); in main() 70 PetscCall(VecRestoreArray(coords, &a)); in main() 72 PetscCall(DMSetCoordinates(da, coords)); in main() 121 PetscCall(MatCreateSeqUSFFT(coords, da, &A)); in main() 185 PetscCall(VecDestroy(&coords)); in main()
|
| /petsc/src/snes/utils/dm/ |
| H A D | dminterpolatesnes.c | 37 (*ctx)->coords = NULL; in DMInterpolationCreate() 251 PetscCall(VecCreate(comm, &ctx->coords)); in DMInterpolationSetUp() 252 PetscCall(VecSetSizes(ctx->coords, ctx->n * ctx->dim, PETSC_DECIDE)); in DMInterpolationSetUp() 253 PetscCall(VecSetBlockSize(ctx->coords, ctx->dim)); in DMInterpolationSetUp() 254 PetscCall(VecSetType(ctx->coords, VECSTANDARD)); in DMInterpolationSetUp() 255 PetscCall(VecGetArray(ctx->coords, &a)); in DMInterpolationSetUp() 272 PetscCall(VecRestoreArray(ctx->coords, &a)); in DMInterpolationSetUp() 309 …PetscCheck(ctx->coords, ctx->comm, PETSC_ERR_ARG_WRONGSTATE, "The interpolation context has not be… in DMInterpolationGetCoordinates() 310 *coordinates = ctx->coords; in DMInterpolationGetCoordinates() 336 …PetscCheck(ctx->coords, ctx->comm, PETSC_ERR_ARG_WRONGSTATE, "The interpolation context has not be… in DMInterpolationGetVector() [all …]
|
| /petsc/src/ksp/pc/impls/mg/ |
| H A D | mgadapt.c | 4 static PetscErrorCode xfunc(PetscInt dim, PetscReal time, const PetscReal coords[], PetscInt Nc, Pe… in xfunc() argument 8 for (c = 0; c < Nc; ++c) u[c] = PetscPowRealInt(coords[0], k); in xfunc() 11 static PetscErrorCode yfunc(PetscInt dim, PetscReal time, const PetscReal coords[], PetscInt Nc, Pe… in yfunc() argument 15 for (c = 0; c < Nc; ++c) u[c] = PetscPowRealInt(coords[1], k); in yfunc() 18 static PetscErrorCode zfunc(PetscInt dim, PetscReal time, const PetscReal coords[], PetscInt Nc, Pe… in zfunc() argument 22 for (c = 0; c < Nc; ++c) u[c] = PetscPowRealInt(coords[2], k); in zfunc() 25 static PetscErrorCode xsin(PetscInt dim, PetscReal time, const PetscReal coords[], PetscInt Nc, Pet… in xsin() argument 29 for (c = 0; c < Nc; ++c) u[c] = PetscSinReal(PETSC_PI * (k + 1) * coords[0]); in xsin() 32 static PetscErrorCode ysin(PetscInt dim, PetscReal time, const PetscReal coords[], PetscInt Nc, Pet… in ysin() argument 36 for (c = 0; c < Nc; ++c) u[c] = PetscSinReal(PETSC_PI * (k + 1) * coords[1]); in ysin() [all …]
|
| /petsc/src/vec/is/utils/tests/ |
| H A D | ex1.c | 17 PetscReal *coords; in main() local 43 PetscCall(PetscMalloc1(coords_size, &coords)); in main() 47 PetscCall(PetscRandomGetValuesReal(random, coords_size, coords)); in main() 49 PetscCall(PetscKDTreeCreate(num_coords, dim, coords, copy_mode, bucket_size, &tree)); in main() 59 …PetscCall(PetscKDTreeQueryPointsNearestNeighbor(tree, num_coords, coords, PETSC_MACHINE_EPSILON * … in main() 82 PetscReal dist = Distance(dim, rand_point, &coords[dim * j]); in main() 110 if (copy_mode != PETSC_OWN_POINTER) PetscCall(PetscFree(coords)); in main()
|
| /petsc/src/vec/is/utils/ |
| H A D | kdtree.c | 29 const PetscReal *coords, *coords_owned; // Only free owned on Destroy member 93 const PetscReal *coords = tree->coords; in PetscKDTreeSortFunc() local 97 PetscReal diff = coords[left * dim + axis] - coords[right * dim + axis]; in PetscKDTreeSortFunc() 165 …for (PetscInt d = 0; d < dim; d++) bucket_coords[d * leaf->count + i] = tree->coords[bucket_indice… in PetscKDTreeBuildStemAndLeaves() 183 …stem->split = (tree->coords[tree->dim * median_idx + axis] + tree->coords[tree->dim * medianp1_idx… in PetscKDTreeBuildStemAndLeaves() 236 PetscErrorCode PetscKDTreeCreate(PetscCount num_coords, PetscInt dim, const PetscReal coords[], Pet… in PetscKDTreeCreate() argument 250 PetscAssertPointer(coords, 3); in PetscKDTreeCreate() 259 tree->coords_owned = coords; // fallthrough in PetscKDTreeCreate() 261 tree->coords = coords; in PetscKDTreeCreate() 265 PetscCall(PetscArraycpy((PetscReal *)tree->coords_owned, coords, num_coords * dim)); in PetscKDTreeCreate() [all …]
|
| /petsc/src/ts/tests/ |
| H A D | ex28.c | 64 PetscReal *centroid, *coords, *xi0, *v0, *J, *invJ, detJ, *vals; in SetInitialCoordinates() local 82 PetscCall(DMSwarmGetField(sw, DMSwarmPICField_coor, NULL, NULL, (void **)&coords)); in SetInitialCoordinates() 88 coords[c * dim + d] = centroid[d]; in SetInitialCoordinates() 89 if ((coords[c * dim + d] >= -1) && (coords[c * dim + d] <= 1)) { in SetInitialCoordinates() 108 PetscCall(DMPlexReferenceToCoordinates(dm, c, 1, refcoords, &coords[n * dim])); in SetInitialCoordinates() 112 PetscCall(DMSwarmRestoreField(sw, DMSwarmPICField_coor, NULL, NULL, (void **)&coords)); in SetInitialCoordinates() 278 PetscScalar *r, *coords; in RHSFunctionParticles() local 296 PetscCall(DMSwarmGetField(dmSw, DMSwarmPICField_coor, NULL, NULL, (void **)&coords)); in RHSFunctionParticles() 301 m1 += PetscRealPart(coords[p * dim + d]); in RHSFunctionParticles() 302 m2 += PetscSqr(PetscRealPart(coords[p * dim + d])); in RHSFunctionParticles() [all …]
|
| /petsc/src/dm/impls/swarm/tests/ |
| H A D | ex1.c | 54 PetscReal *coords, upper[3], lower[3]; in CreateSwarm() local 78 PetscCall(DMSwarmGetField(*sw, coordFields[0], NULL, NULL, (void **)&coords)); in CreateSwarm() 82 for (PetscInt d = 0; d < dim; ++d) coords[p * dim + d] = 0.5 * (upper[d] - lower[d]); in CreateSwarm() 83 coords[p * dim + 1] = (upper[1] - lower[1]) / particleInitSize * p + lower[1]; in CreateSwarm() 86 PetscCall(DMSwarmRestoreField(*sw, coordFields[0], NULL, NULL, (void **)&coords)); in CreateSwarm() 171 PetscReal *coords; in CheckPointInsertion_Boundary() local 181 PetscCall(DMSwarmGetField(sw, DMSwarmPICField_coor, NULL, NULL, (void **)&coords)); in CheckPointInsertion_Boundary() 182 …for (PetscInt d = 0; d < dim; ++d) coords[(Np - 1) * dim + d] = 0.5 * (lbox_high[d] - lbox_low[d]); in CheckPointInsertion_Boundary() 183 coords[(Np - 1) * dim + adjacentdim] = lbox_high[adjacentdim]; in CheckPointInsertion_Boundary() 184 PetscCall(DMSwarmRestoreField(sw, DMSwarmPICField_coor, NULL, NULL, (void **)&coords)); in CheckPointInsertion_Boundary()
|
| /petsc/src/dm/interface/ |
| H A D | dmcoordinates.c | 9 Vec coords, ccoords; in DMRestrictHook_Coordinates() local 15 PetscCall(DMGetCoordinates(dm, &coords)); in DMRestrictHook_Coordinates() 17 if (coords && !ccoords) { in DMRestrictHook_Coordinates() 21 PetscCall(MatRestrict(inject, coords, ccoords)); in DMRestrictHook_Coordinates() 32 Vec coords, ccoords, clcoords; in DMSubDomainHook_Coordinates() local 38 PetscCall(DMGetCoordinates(dm, &coords)); in DMSubDomainHook_Coordinates() 40 if (coords && !ccoords) { in DMSubDomainHook_Coordinates() 46 PetscCall(VecScatterBegin(scat_i[0], coords, ccoords, INSERT_VALUES, SCATTER_FORWARD)); in DMSubDomainHook_Coordinates() 47 PetscCall(VecScatterEnd(scat_i[0], coords, ccoords, INSERT_VALUES, SCATTER_FORWARD)); in DMSubDomainHook_Coordinates() 48 PetscCall(VecScatterBegin(scat_g[0], coords, clcoords, INSERT_VALUES, SCATTER_FORWARD)); in DMSubDomainHook_Coordinates() [all …]
|
| /petsc/src/dm/impls/da/tests/ |
| H A D | ex1.c | 40 PetscReal *coords, r, dr; in main() local 65 PetscCall(DMSwarmGetField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in main() 71 coords[p * 2 + 0] = r * PetscCosReal(th); in main() 72 coords[p * 2 + 1] = r * PetscSinReal(th); in main() 74 PetscCall(DMSwarmRestoreField(sw, "DMSwarmPIC_coor", &bs, &dtype, (void **)&coords)); in main()
|
| /petsc/src/ksp/pc/impls/gamg/ |
| H A D | geo.c | 34 static PetscErrorCode PCSetCoordinates_GEO(PC pc, PetscInt ndm, PetscInt a_nloc, PetscReal *coords) in PCSetCoordinates_GEO() argument 51 …PetscCheck(coords || (nloc <= 0), PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Need coordinates for pc_g… in PCSetCoordinates_GEO() 66 for (ii = 0; ii < ndm; ii++) pc_gamg->data[ii * nloc + kk] = coords[kk * ndm + ii]; in PCSetCoordinates_GEO() 70 for (ii = 0; ii < ndm; ii++) pc_gamg->data[ii * nloc + kk] = coords[bs * kk * ndm + ii]; in PCSetCoordinates_GEO() 126 static PetscErrorCode triangulateAndFormProl(IS selected_2, PetscInt data_stride, PetscReal coords[… in triangulateAndFormProl() argument 164 in.pointlist[sid] = coords[lid]; in triangulateAndFormProl() 165 in.pointlist[sid + 1] = coords[data_stride + lid]; in triangulateAndFormProl() 258 … if (sel) fprintf(file, "%d %e %e\n", sid++, (double)coords[jj], (double)coords[data_stride + jj]); in triangulateAndFormProl() 301 const PetscReal fcoord[3] = {coords[flid], coords[data_stride + flid], 1.0}; in triangulateAndFormProl() 311 AA[tt][0] = coords[lid2]; in triangulateAndFormProl() [all …]
|