| /petsc/src/dm/impls/swarm/tests/ |
| H A D | ex7.c | 59 PetscErrorCode gridToParticles(const DM dm, DM sw, PetscReal *moments, Vec rhs, Mat M_p) in gridToParticles() argument 143 if (moments) { in gridToParticles() 148 moments[0] = moments[1] = moments[2] = 0; 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()
|
| H A D | ex11.c | 219 static PetscErrorCode computeParticleMoments(DM sw, Vec u, PetscReal moments[3], AppCtx *user) in computeParticleMoments() 255 …PetscCallMPI(MPIU_Allreduce(mom, moments, 3, MPIU_REAL, MPI_SUM, PetscObjectComm((PetscObject)sw))… in computeParticleMoments() 281 static PetscErrorCode computeFieldMoments(DM dm, Vec u, PetscReal moments[3], AppCtx *user) in computeFieldMoments() 291 moments[0] = PetscRealPart(mom); in computeFieldMoments() 295 moments[1] = PetscRealPart(mom); in computeFieldMoments() 299 moments[2] = PetscRealPart(mom); in computeFieldMoments()
|
| H A D | ex2.c | 322 static PetscErrorCode computeParticleMoments(DM sw, PetscReal moments[3], AppCtx *user) in computeParticleMoments() 355 …PetscCallMPI(MPIU_Allreduce(mom, moments, 3, MPIU_REAL, MPI_SUM, PetscObjectComm((PetscObject)sw))… in computeParticleMoments() 377 static PetscErrorCode computeFEMMoments(DM dm, Vec u, PetscReal moments[3], AppCtx *user) in computeFEMMoments() 386 moments[0] = PetscRealPart(mom); in computeFEMMoments() 389 moments[1] = PetscRealPart(mom); in computeFEMMoments() 392 moments[2] = PetscRealPart(mom); in computeFEMMoments()
|
| /petsc/src/ts/tests/ |
| H A D | ex30.c | 278 …globMpArray[], Mat g_Mass[], Vec t_fhat[][EX30_MAX_NUM_THRDS], PetscReal moments[], Vec globXArray… in gridToParticles_private() argument 315 moments[0] += w; in gridToParticles_private() 316 moments[1] += w * ctx->v_0 * coords[p * dim + 1]; // z-momentum in gridToParticles_private() 317 moments[2] += w * 0.5 * ctx->v_0 * ctx->v_0 * v2; in gridToParticles_private() 322 const PetscReal N_inv = 1 / moments[0]; in gridToParticles_private() 323 …fo(grid_dm[0], "gridToParticles_private [%" PetscInt_FMT "], n = %g\n", v_id, (double)moments[0])); in gridToParticles_private() 335 moments[3] -= ww * PetscLogReal(ww); in gridToParticles_private() 337 } else moments[4] -= w; // keep track of density that is lost in gridToParticles_private() 375 PetscReal moments[5], e_grid[LANDAU_MAX_GRIDS]; in PostStep() local 382 for (PetscInt i = 0; i < 5; i++) moments[i] = 0; in PostStep() [all …]
|
| /petsc/src/binding/petsc4py/src/petsc4py/PETSc/ |
| H A D | DMSwarm.pyx | 1047 """Return the moments defined in the active cell DM. 1067 cdef object moments = oarray_r(empty_r(asInt(cbs) + 2), NULL, &mom) 1069 return moments
|
| /petsc/src/dm/impls/swarm/ |
| H A D | swarm.c | 2638 …ode DMSwarmComputeMoments(DM sw, const char coordinate[], const char weight[], PetscReal moments[]) in DMSwarmComputeMoments() argument 2651 PetscAssertPointer(moments, 4); in DMSwarmComputeMoments() 2673 …PetscCallMPI(MPIU_Allreduce(mom, moments, bsc + 2, MPIU_REAL, MPI_SUM, PetscObjectComm((PetscObjec… in DMSwarmComputeMoments()
|
| /petsc/doc/community/meetings/2025/ |
| H A D | index.md | 98 … can adapt to almost any set of new particle locations and preserves all moments up to the order o…
|
| /petsc/src/ts/tutorials/hamiltonian/ |
| H A D | ex2.c | 453 static PetscErrorCode computeVelocityFEMMoments(DM sw, PetscReal moments[], AppCtx *user) in computeVelocityFEMMoments() argument 500 PetscCall(DMPlexComputeMoments(vdm, u[0], moments)); in computeVelocityFEMMoments()
|
| H A D | ex4.c | 615 static PetscErrorCode computeVelocityFEMMoments(DM sw, PetscReal moments[], AppCtx *ctx) in computeVelocityFEMMoments() argument 628 PetscCall(DMPlexComputeMoments(vdm, u[0], moments)); in computeVelocityFEMMoments()
|
| /petsc/src/dm/impls/plex/ |
| H A D | plexfem.c | 7186 PetscErrorCode DMPlexComputeMoments(DM dm, Vec u, PetscReal moments[]) in DMPlexComputeMoments() argument 7205 moments[0] = PetscRealPart(mom); in DMPlexComputeMoments() 7211 moments[c + 1] = PetscRealPart(mom); in DMPlexComputeMoments() 7215 moments[cdim + 1] = PetscRealPart(mom); in DMPlexComputeMoments()
|
| /petsc/share/petsc/datafiles/meshes/ |
| H A D | testcase3D.cas | 932 (soot/method-of-moments? #f) 1235 (soot-mom/solve-agg-moments? #f) 1236 (soot-mom/n-moments 3) 1252 (soot-mom/allow-max-moments? #f) 6677 (dynamesh/sdof/minimum-cutoff-moments 9.999999999999999e-21)
|