|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
#include "ParticleMotion.h"Go to the source code of this file.
Macros | |
| #define | ERROR_MSG_BUFFER_SIZE 256 |
| #define | __FUNCT__ "GenerateGaussianNoise" |
| #define | __FUNCT__ "CalculateBrownianDisplacement" |
| #define | __FUNCT__ "UpdateParticlePosition" |
| #define | __FUNCT__ "UpdateAllParticlePositions" |
| #define | __FUNCT__ "CheckAndRemoveOutOfBoundsParticles" |
| #define | __FUNCT__ "CheckAndRemoveLostParticles" |
| #define | __FUNCT__ "SetMigrationRanks" |
| #define | __FUNCT__ "PerformMigration" |
| #define | __FUNCT__ "CalculateParticleCountPerCell" |
| #define | __FUNCT__ "ResizeSwarmGlobally" |
| #define | __FUNCT__ "PreCheckAndResizeSwarm" |
| #define | __FUNCT__ "ReinitializeParticlesOnInletSurface" |
| #define | __FUNCT__ "GetLocalPIDSnapshot" |
| #define | __FUNCT__ "AddToMigrationList" |
| #define | __FUNCT__ "FlagNewComersForLocation" |
| #define | __FUNCT__ "MigrateRestartParticlesUsingCellID" |
| #define | __FUNCT__ "GuessParticleOwnerWithBBox" |
| #define | __FUNCT__ "LocateAllParticlesInGrid" |
| #define | __FUNCT__ "ResetAllParticleStatuses" |
Functions | |
| PetscErrorCode | GenerateGaussianNoise (PetscRandom rnd, PetscReal *n1, PetscReal *n2) |
Internal helper implementation: GenerateGaussianNoise(). | |
| PetscErrorCode | CalculateBrownianDisplacement (UserCtx *user, PetscReal diff_eff, Cmpnts *displacement) |
Internal helper implementation: CalculateBrownianDisplacement(). | |
| PetscErrorCode | UpdateParticlePosition (UserCtx *user, Particle *particle) |
Internal helper implementation: UpdateParticlePosition(). | |
| PetscErrorCode | UpdateAllParticlePositions (UserCtx *user) |
Internal helper implementation: UpdateAllParticlePositions(). | |
| static PetscBool | IsParticleInBox (const BoundingBox *bbox, const Cmpnts *pos) |
Internal helper implementation: IsParticleInBox(). | |
| PetscErrorCode | CheckAndRemoveOutOfBoundsParticles (UserCtx *user, PetscInt *removedCountLocal, PetscInt *removedCountGlobal, const BoundingBox *bboxlist) |
Internal helper implementation: CheckAndRemoveOutOfBoundsParticles(). | |
| PetscErrorCode | CheckAndRemoveLostParticles (UserCtx *user, PetscInt *removedCountLocal, PetscInt *removedCountGlobal) |
Internal helper implementation: CheckAndRemoveLostParticles(). | |
| PetscErrorCode | SetMigrationRanks (UserCtx *user, const MigrationInfo *migrationList, PetscInt migrationCount) |
Internal helper implementation: SetMigrationRanks(). | |
| PetscErrorCode | PerformMigration (UserCtx *user) |
| Implementation of PerformMigration(). | |
| PetscErrorCode | CalculateParticleCountPerCell (UserCtx *user) |
| Implementation of CalculateParticleCountPerCell(). | |
| PetscErrorCode | ResizeSwarmGlobally (DM swarm, PetscInt N_target) |
| Implementation of ResizeSwarmGlobally(). | |
| PetscErrorCode | PreCheckAndResizeSwarm (UserCtx *user, PetscInt ti, const char *ext) |
Internal helper implementation: PreCheckAndResizeSwarm(). | |
| PetscErrorCode | ReinitializeParticlesOnInletSurface (UserCtx *user, PetscReal currentTime, PetscInt step) |
Internal helper implementation: ReinitializeParticlesOnInletSurface(). | |
| PetscErrorCode | GetLocalPIDSnapshot (const PetscInt64 pid_field[], PetscInt n_local, PetscInt64 **pids_snapshot_out) |
Internal helper implementation: GetLocalPIDSnapshot(). | |
| PetscErrorCode | AddToMigrationList (MigrationInfo **migration_list_p, PetscInt *capacity_p, PetscInt *count_p, PetscInt particle_local_idx, PetscMPIInt destination_rank) |
Internal helper implementation: AddToMigrationList(). | |
| PetscErrorCode | FlagNewcomersForLocation (DM swarm, PetscInt n_local_before, const PetscInt64 pids_before[]) |
Internal helper implementation: FlagNewcomersForLocation(). | |
| PetscErrorCode | MigrateRestartParticlesUsingCellID (UserCtx *user) |
Internal helper implementation: MigrateRestartParticlesUsingCellID(). | |
| static PetscErrorCode | GuessParticleOwnerWithBBox (UserCtx *user, const Particle *particle, const BoundingBox *bboxlist, PetscMPIInt *guess_rank_out) |
Internal helper implementation: GuessParticleOwnerWithBBox(). | |
| PetscErrorCode | LocateAllParticlesInGrid (UserCtx *user, BoundingBox *bboxlist) |
| Implementation of LocateAllParticlesInGrid(). | |
| PetscErrorCode | ResetAllParticleStatuses (UserCtx *user) |
| Implementation of ResetAllParticleStatuses(). | |
| #define ERROR_MSG_BUFFER_SIZE 256 |
Definition at line 7 of file ParticleMotion.c.
| #define __FUNCT__ "GenerateGaussianNoise" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "CalculateBrownianDisplacement" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "UpdateParticlePosition" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "UpdateAllParticlePositions" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "CheckAndRemoveOutOfBoundsParticles" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "CheckAndRemoveLostParticles" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "SetMigrationRanks" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "PerformMigration" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "CalculateParticleCountPerCell" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "ResizeSwarmGlobally" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "PreCheckAndResizeSwarm" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "ReinitializeParticlesOnInletSurface" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "GetLocalPIDSnapshot" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "AddToMigrationList" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "FlagNewComersForLocation" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "MigrateRestartParticlesUsingCellID" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "GuessParticleOwnerWithBBox" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "LocateAllParticlesInGrid" |
Definition at line 11 of file ParticleMotion.c.
| #define __FUNCT__ "ResetAllParticleStatuses" |
Definition at line 11 of file ParticleMotion.c.
| PetscErrorCode GenerateGaussianNoise | ( | PetscRandom | rnd, |
| PetscReal * | n1, | ||
| PetscReal * | n2 | ||
| ) |
Internal helper implementation: GenerateGaussianNoise().
Generates two independent standard normal random variables N(0,1) using the Box-Muller transform.
Local to this translation unit.
Definition at line 16 of file ParticleMotion.c.
| PetscErrorCode CalculateBrownianDisplacement | ( | UserCtx * | user, |
| PetscReal | diff_eff, | ||
| Cmpnts * | displacement | ||
| ) |
Internal helper implementation: CalculateBrownianDisplacement().
Calculates the stochastic displacement vector (Brownian motion) for a single particle.
Local to this translation unit.
Definition at line 56 of file ParticleMotion.c.
Internal helper implementation: UpdateParticlePosition().
Updates a particle's position based on its velocity and the timestep dt (stored in user->dt).
Local to this translation unit.
Definition at line 104 of file ParticleMotion.c.
| PetscErrorCode UpdateAllParticlePositions | ( | UserCtx * | user | ) |
Internal helper implementation: UpdateAllParticlePositions().
Loops over all local particles in the DMSwarm, updating their positions based on velocity and the global timestep user->dt.
Local to this translation unit.
Definition at line 133 of file ParticleMotion.c.
|
inlinestatic |
Internal helper implementation: IsParticleInBox().
Local to this translation unit.
Definition at line 213 of file ParticleMotion.c.
| PetscErrorCode CheckAndRemoveOutOfBoundsParticles | ( | UserCtx * | user, |
| PetscInt * | removedCountLocal, | ||
| PetscInt * | removedCountGlobal, | ||
| const BoundingBox * | bboxlist | ||
| ) |
Internal helper implementation: CheckAndRemoveOutOfBoundsParticles().
Checks for particles outside the physical domain boundaries and removes them using DMSwarmRemovePointAtIndex.
Local to this translation unit.
Definition at line 227 of file ParticleMotion.c.
| PetscErrorCode CheckAndRemoveLostParticles | ( | UserCtx * | user, |
| PetscInt * | removedCountLocal, | ||
| PetscInt * | removedCountGlobal | ||
| ) |
Internal helper implementation: CheckAndRemoveLostParticles().
Removes particles that have been definitively flagged as LOST by the location algorithm.
Local to this translation unit.
Definition at line 335 of file ParticleMotion.c.
| PetscErrorCode SetMigrationRanks | ( | UserCtx * | user, |
| const MigrationInfo * | migrationList, | ||
| PetscInt | migrationCount | ||
| ) |
Internal helper implementation: SetMigrationRanks().
Writes migration destinations into the DMSwarm rank field for marked particles.
Local to this translation unit.
Definition at line 439 of file ParticleMotion.c.
| PetscErrorCode PerformMigration | ( | UserCtx * | user | ) |
Implementation of PerformMigration().
Performs particle migration based on the pre-populated DMSwarmPICField_rank field.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/ParticleMotion.h.
Definition at line 472 of file ParticleMotion.c.
| PetscErrorCode CalculateParticleCountPerCell | ( | UserCtx * | user | ) |
Implementation of CalculateParticleCountPerCell().
Counts particles in each cell of the DMDA 'da' and stores the result in user->ParticleCount.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/logging.h.
Definition at line 504 of file ParticleMotion.c.
| PetscErrorCode ResizeSwarmGlobally | ( | DM | swarm, |
| PetscInt | N_target | ||
| ) |
Implementation of ResizeSwarmGlobally().
Resizes a swarm collectively to a target global particle count.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/ParticleMotion.h.
Definition at line 673 of file ParticleMotion.c.
| PetscErrorCode PreCheckAndResizeSwarm | ( | UserCtx * | user, |
| PetscInt | ti, | ||
| const char * | ext | ||
| ) |
Internal helper implementation: PreCheckAndResizeSwarm().
Checks particle count in the reference file and resizes the swarm if needed.
Local to this translation unit.
Definition at line 762 of file ParticleMotion.c.
| PetscErrorCode ReinitializeParticlesOnInletSurface | ( | UserCtx * | user, |
| PetscReal | currentTime, | ||
| PetscInt | step | ||
| ) |
Internal helper implementation: ReinitializeParticlesOnInletSurface().
Re-initializes the positions of particles currently on this rank if this rank owns part of the designated inlet surface.
Local to this translation unit.
Definition at line 883 of file ParticleMotion.c.
| PetscErrorCode GetLocalPIDSnapshot | ( | const PetscInt64 | pid_field[], |
| PetscInt | n_local, | ||
| PetscInt64 ** | pids_snapshot_out | ||
| ) |
Internal helper implementation: GetLocalPIDSnapshot().
Creates a sorted snapshot of all Particle IDs (PIDs) from a raw data array.
Local to this translation unit.
Definition at line 1097 of file ParticleMotion.c.
| PetscErrorCode AddToMigrationList | ( | MigrationInfo ** | migration_list_p, |
| PetscInt * | capacity_p, | ||
| PetscInt * | count_p, | ||
| PetscInt | particle_local_idx, | ||
| PetscMPIInt | destination_rank | ||
| ) |
Internal helper implementation: AddToMigrationList().
Safely adds a new migration task to a dynamically sized list.
Local to this translation unit.
Definition at line 1152 of file ParticleMotion.c.
| PetscErrorCode FlagNewcomersForLocation | ( | DM | swarm, |
| PetscInt | n_local_before, | ||
| const PetscInt64 | pids_before[] | ||
| ) |
Internal helper implementation: FlagNewcomersForLocation().
Identifies newly arrived particles after migration and flags them for a location search.
Local to this translation unit.
Definition at line 1210 of file ParticleMotion.c.
| PetscErrorCode MigrateRestartParticlesUsingCellID | ( | UserCtx * | user | ) |
Internal helper implementation: MigrateRestartParticlesUsingCellID().
Fast-path migration for restart particles using preloaded Cell IDs.
Local to this translation unit.
Definition at line 1303 of file ParticleMotion.c.
|
static |
Internal helper implementation: GuessParticleOwnerWithBBox().
Local to this translation unit.
Definition at line 1388 of file ParticleMotion.c.
| PetscErrorCode LocateAllParticlesInGrid | ( | UserCtx * | user, |
| BoundingBox * | bboxlist | ||
| ) |
Implementation of LocateAllParticlesInGrid().
Orchestrates the complete particle location and migration process for one timestep.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/ParticleMotion.h.
Definition at line 1506 of file ParticleMotion.c.
| PetscErrorCode ResetAllParticleStatuses | ( | UserCtx * | user | ) |
Implementation of ResetAllParticleStatuses().
Marks all local particles as NEEDS_LOCATION for the next settlement pass.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/ParticleMotion.h.
Definition at line 1740 of file ParticleMotion.c.