| /petsc/src/dm/impls/swarm/tutorials/ |
| H A D | ex1.c | 19 PetscReal *wq, *coords; in main() local 59 PetscCall(DMSwarmGetField(sw, "w_q", &bs, &dtype, (void **)&wq)); in main() 64 wq[p] = 1.0; in main() 65 energy_0 += wq[p] * (PetscSqr(coords[p * 2 + 0]) + PetscSqr(coords[p * 2 + 1])); in main() 68 PetscCall(DMSwarmRestoreField(sw, "w_q", &bs, &dtype, (void **)&wq)); in main() 80 PetscCall(DMSwarmGetField(sw, "w_q", &bs, &dtype, (void **)&wq)); in main() 82 …for (PetscInt p = 0; p < Np; ++p) energy_1 += wq[p] * (PetscSqr(coords[p * 2 + 0]) + PetscSqr(coor… in main() 84 PetscCall(DMSwarmRestoreField(sw, "w_q", &bs, &dtype, (void **)&wq)); in main()
|
| H A D | ex1f90.F90 | 22 PetscScalar, pointer :: wq(:) 48 PetscCallA(DMSwarmGetField(sw, 'w_q', bs, dtype, wq, ierr)) 53 wq(p) = 1.0 56 PetscCallA(DMSwarmRestoreField(sw, 'w_q', bs, dtype, wq, ierr))
|
| /petsc/src/dm/impls/swarm/tests/ |
| H A D | ex7.c | 144 PetscReal *wq, *coords; in gridToParticles() local 146 PetscCall(DMSwarmGetField(sw, "w_q", &bs, &dtype, (void **)&wq)); in gridToParticles() 150 moments[0] += wq[p]; in gridToParticles() 151 moments[1] += wq[p] * coords[p * 2 + 0]; // x-momentum in gridToParticles() 152 moments[2] += wq[p] * (PetscSqr(coords[p * 2 + 0]) + PetscSqr(coords[p * 2 + 1])); in gridToParticles() 155 PetscCall(DMSwarmRestoreField(sw, "w_q", &bs, &dtype, (void **)&wq)); in gridToParticles() 164 PetscReal *wq, *coords; in particlesToGrid() local 172 PetscCall(DMSwarmGetField(sw, "w_q", &bs, &dtype, (void **)&wq)); in particlesToGrid() 177 wq[p] = a_wp[p]; in particlesToGrid() 180 PetscCall(DMSwarmRestoreField(sw, "w_q", &bs, &dtype, (void **)&wq)); in particlesToGrid()
|
| /petsc/src/ts/tests/ |
| H A D | ex28.c | 232 PetscReal *xq, *wq; in CheckDistribution() local 255 PetscCall(PetscMalloc2(Nq, &xq, Nq, &wq)); in CheckDistribution() 256 PetscCall(PetscDTGaussQuadrature(100, vmin, vmax, xq, wq)); in CheckDistribution() 258 for (q = 0; q < Nq; ++q) neq += ComputePDF(m, n, T, &xq[q]) * wq[q]; in CheckDistribution() 262 for (q = 0; q < Nq; ++q) veq += xq[q] * ComputePDF(m, n, T, &xq[q]) * wq[q]; in CheckDistribution() 266 for (q = 0; q < Nq; ++q) Teq += PetscSqr(xq[q]) * ComputePDF(m, n, T, &xq[q]) * wq[q]; in CheckDistribution() 269 PetscCall(PetscFree2(xq, wq)); in CheckDistribution()
|
| H A D | ex30.c | 138 PetscReal *wq; in particlesToGrid() local 144 PetscCall(DMSwarmGetField(sw, "w_q", &bs, &dtype, (void **)&wq)); in particlesToGrid() 146 for (p = 0; p < Np; p++) wq[p] = a_wp[p]; in particlesToGrid() 147 PetscCall(DMSwarmRestoreField(sw, "w_q", &bs, &dtype, (void **)&wq)); in particlesToGrid()
|
| /petsc/src/ts/impls/implicit/discgrad/ |
| H A D | tsdiscgrad.c | 338 const PetscReal *wq, *xq; in SNESTSFormFunction_DiscGrad() local 348 PetscCall(PetscQuadratureGetData(quad, NULL, NULL, &Nq, &xq, &wq)); in SNESTSFormFunction_DiscGrad() 354 PetscCall(VecAXPY(G, wq[q], den)); in SNESTSFormFunction_DiscGrad()
|
| /petsc/src/dm/impls/swarm/ |
| H A D | swarmpic.c | 987 const PetscReal *xq, *wq; in DMSwarmComputeLocalSize() local 1005 PetscCall(PetscQuadratureGetData(quad, NULL, NULL, &Nq, &xq, &wq)); in DMSwarmComputeLocalSize() 1023 n_int[s] += (detJp * den) * (detJ * wq[q]) / (PetscReal)Ns; in DMSwarmComputeLocalSize()
|
| /petsc/src/dm/impls/plex/transform/interface/ |
| H A D | plextransform.c | 827 PetscReal *xq, *wq; in DMPlexTransformGetCoordinateFE() local 833 PetscCall(PetscMalloc1(Nq, &wq)); in DMPlexTransformGetCoordinateFE() 834 for (q = 0; q < Nq; ++q) wq[q] = 1.0; in DMPlexTransformGetCoordinateFE() 836 PetscCall(PetscQuadratureSetData(quad, dim, 1, Nq, xq, wq)); in DMPlexTransformGetCoordinateFE()
|
| /petsc/src/dm/dt/interface/ |
| H A D | dt.c | 3378 const PetscReal *xq, *wq; in PetscQuadratureComputePermutations() local 3382 PetscCall(PetscQuadratureGetData(quad, &qdim, NULL, &Nq, &xq, &wq)); in PetscQuadratureComputePermutations()
|