PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
 
Loading...
Searching...
No Matches
ParticleMotion.h
Go to the documentation of this file.
1/**
2 * @file ParticleMotion.h
3 * @brief Header file for Particle Motion and migration related functions.
4 *
5 * This file contains declarations of functions responsible for moving and migrating particle swarms within a simulation using PETSc's DMSwarm.
6 */
7
8 #ifndef PARTICLE_MOTION_H
9 #define PARTICLE_MOTION_H
10
11// Include necessary headers
12#include <petsc.h> // PETSc library header
13#include <petscdmswarm.h> // PETSc DMSwarm header
14#include <stdbool.h>
15#include <petscsys.h> // For PetscRealloc
16#include <math.h>
17#include "variables.h" // Common type definitions
18#include "logging.h" // Logging macros and definitions
19#include "walkingsearch.h" // Walking search function for particle migration
20#include "expression.h" // PicurvMix64, PicurvUnitFromHash, PicurvNormalPairFromHash
21
22/**
23 * @brief Whether a position lies in an axis-aligned bounding box, faces included.
24 *
25 * @param[in] bbox The box.
26 * @param[in] pos The position.
27 * @return PETSC_TRUE when `pos` is inside `bbox` or on its boundary.
28 */
29static inline PetscBool IsParticleInBox(const BoundingBox *bbox, const Cmpnts *pos)
30{
31 return (PetscBool)(pos->x >= bbox->min_coords.x && pos->x <= bbox->max_coords.x &&
32 pos->y >= bbox->min_coords.y && pos->y <= bbox->max_coords.y &&
33 pos->z >= bbox->min_coords.z && pos->z <= bbox->max_coords.z);
34}
35
36/**
37 * @brief Four uniforms in [0,1) from one keyed draw hash.
38 * @details Draw `w` mixes the running hash with `w` and maps it with PicurvUnitFromHash(), so
39 * the four values depend only on the hash.
40 *
41 * @param[in] hash A hash from PicurvDrawHash().
42 * @param[out] u The four uniforms.
43 */
44static inline void ParticleUniformsFromHash(uint64_t hash, PetscReal u[4])
45{
46 for (int w = 0; w < 4; ++w) u[w] = PicurvUnitFromHash(hash = PicurvMix64(hash ^ (uint64_t)w));
47}
48
49/**
50 * @brief Calculates the stochastic displacement vector (Brownian motion) for a single particle.
51 * Equation: dX_stoch = sqrt(2 * Gamma_eff * dt) * N(0,1)
52 *
53 * The normals come from PicurvDrawHash() in the Brownian key space with the step
54 * as salt, so a particle's increment at a step is a function of `particleRandomSeed`, its
55 * PID and the step alone: independent of the rank layout, of the particle's position in
56 * the local swarm, and of whether the run was restarted.
57 *
58 * @param[in] user Pointer to UserCtx (access to dt, step and the seed).
59 * @param[in] pid The particle's global ID.
60 * @param[in] diff_eff The effective diffusivity (Gamma + Gamma_t) at the particle's location.
61 * @param[out] displacement Pointer to a Cmpnts struct to store the resulting (dx, dy, dz).
62 *
63 * @return PetscErrorCode
64 */
65PetscErrorCode CalculateBrownianDisplacement(UserCtx *user, PetscInt64 pid, PetscReal diff_eff, Cmpnts *displacement);
66
67/**
68 * @brief Updates a particle's position based on its velocity and the timestep dt (stored in user->dt).
69 *
70 * @param[in] user Pointer to your UserCtx (must contain user->dt).
71 * @param[in,out] particle Pointer to the particle struct (contains, pos,vel,diffusivity etc).
72 *
73 * @return PetscErrorCode Returns 0 on success, or an error code on failure.
74 */
75PetscErrorCode UpdateParticlePosition(UserCtx *user, Particle *particle);
76
77/**
78 * @brief Loops over all local particles in the DMSwarm, updating their positions
79 * based on velocity and the global timestep user->dt.
80 * @param[in,out] user Pointer to UserCtx (must contain dt).
81 *
82 * @return PetscErrorCode Returns 0 on success, or an error code on failure.
83 */
84 PetscErrorCode UpdateAllParticlePositions(UserCtx *user);
85
86/**
87 * @brief Removes particles that the location algorithm flagged as LOST or EXITED.
88 *
89 * This function is the designated cleanup utility. It should be called after the
90 * `LocateAllParticlesInGrid` orchestrator has run and every particle's status
91 * has been definitively determined.
92 *
93 * It iterates through all locally owned particles and checks their `DMSwarm_location_status`
94 * field. Particles whose status is `LOST` (the search failed) or `EXITED` (the particle left
95 * through a removing boundary face) are flagged in a backward scan and permanently removed
96 * together by `RemoveFlaggedParticles`. The two kinds are counted and summed separately.
97 *
98 * This approach centralizes the removal logic, making the `DMSwarm_location_status`
99 * the single source of truth for a particle's validity, which is more robust than
100 * relying on secondary geometric checks (like bounding boxes).
101 *
102 * @param[in,out] user Pointer to the UserCtx structure containing the swarm.
103 * @param[out] removedCountLocal Pointer to store the number of LOST particles removed on this rank.
104 * @param[out] removedCountGlobal Optional, may be NULL: the number of LOST particles removed across all ranks.
105 * @param[out] removedScalarSumGlobal Optional, may be NULL: the sum of `Psi` over every
106 * LOST particle removed on any rank. With a 0/1 label and micromixing off, it
107 * counts the removed particles that carried the label.
108 * @param[out] exitedCountGlobal Optional, may be NULL: the number of EXITED particles removed across all ranks.
109 * @param[out] exitedScalarSumGlobal Optional, may be NULL: the sum of `Psi` over every EXITED particle removed.
110 *
111 * @return PetscErrorCode 0 on success, or a non-zero PETSc error code on failure.
112 */
113PetscErrorCode CheckAndRemoveLostParticles(UserCtx *user,
114 PetscInt *removedCountLocal,
115 PetscInt *removedCountGlobal,
116 PetscReal *removedScalarSumGlobal,
117 PetscInt *exitedCountGlobal,
118 PetscReal *exitedScalarSumGlobal);
119
120/**
121 * @brief Writes migration destinations into the DMSwarm rank field for marked particles.
122 *
123 * This helper consumes the migration list built with AddToMigrationList() by the settlement
124 * loop (LocateAllParticlesInGrid()) or the restart path (MigrateRestartParticlesUsingCellID())
125 * and updates each selected particle's destination rank so that a subsequent
126 * `PerformMigration` call can transfer ownership correctly.
127 *
128 * @param[in,out] user Context containing the swarm and migration rank field.
129 * @param[in] migrationList Array of migration directives (local index + destination rank).
130 * @param[in] migrationCount Number of valid entries in `migrationList`.
131 * @return PetscErrorCode 0 on success.
132 */
133PetscErrorCode SetMigrationRanks(UserCtx* user, const MigrationInfo *migrationList, PetscInt migrationCount);
134
135/**
136 * @brief Performs particle migration based on the pre-populated DMSwarmPICField_rank field.
137 *
138 * Assumes SetMigrationRanks has already been called to mark particles with their target ranks.
139 * Calls DMSwarmMigrate to execute the communication while keeping the sent particles, then
140 * removes them in one pass with `RemoveFlaggedParticles`. The resulting local order is the
141 * one DMSwarmMigrate's own removal produces: the particles that stayed occupy the first
142 * `*n_survivors` entries and the received ones follow them.
143 *
144 * @param user Pointer to the UserCtx structure containing the swarm.
145 * @param[out] n_survivors Number of local particles that stayed, or NULL when not wanted.
146 *
147 * @return PetscErrorCode 0 on success, non-zero on failure.
148 */
149PetscErrorCode PerformMigration(UserCtx *user, PetscInt *n_survivors);
150
151/**
152 * @brief Removes flagged swarm points in one pass, preserving the one-at-a-time removal order.
153 *
154 * Each flagged slot in `[0, n_scan)` is filled with the last kept point of that range,
155 * exactly as `DMSwarmRemovePointAtIndex` would when the points are removed in scan order,
156 * so the survivors end in the same order. Points after `n_scan` are kept and moved down
157 * behind the survivors. The swarm is resized once, instead of once per removed point,
158 * since each resize re-zeroes the whole swarm buffer.
159 *
160 * @param[in,out] swarm The DMSwarm. No field may be held (DMSwarmGetField) on entry.
161 * @param[in] n_scan Number of leading local points the flags cover.
162 * @param[in,out] remove Flags for points `[0, n_scan)`; overwritten as points move.
163 * @param[in] scan_backward PETSC_TRUE for removal in descending index order,
164 * PETSC_FALSE for ascending order (DMSwarmMigrate's order).
165 *
166 * @return PetscErrorCode 0 on success, non-zero on failure.
167 */
168PetscErrorCode RemoveFlaggedParticles(DM swarm, PetscInt n_scan, PetscBool remove[], PetscBool scan_backward);
169
170/**
171 * @brief Reorders the local swarm points so that points in the same host cell are contiguous.
172 *
173 * Points are ordered by their `DMSwarm_CellID` with k slowest and i fastest, stably, so points
174 * sharing a cell keep their relative order; points without a valid cell go last. Every field
175 * in the particle field catalog (which lists every field the swarm registers, PETSc's pid and
176 * rank included) is permuted together, so each point keeps all of its values. Interpolation,
177 * location and the other per-point loops then read neighbouring grid data for consecutive
178 * points. Per-point results do not depend on the order; sums over points (the Eulerian
179 * scatter, and the IEM cell means built from it) are taken in the new order and can differ
180 * in rounding.
181 *
182 * @param[in,out] swarm The DMSwarm. No field may be held (DMSwarmGetField) on entry.
183 *
184 * @return PetscErrorCode 0 on success, non-zero on failure.
185 */
186PetscErrorCode SortParticlesByCell(DM swarm);
187
188/**
189 * @brief Counts particles in each cell of the DMDA 'da' and stores the result in user->ParticleCount.
190 *
191 * Assumes user->ParticleCount is a pre-allocated global vector associated with user->da
192 * and initialized to zero before calling this function (though it resets it internally).
193 * Assumes particle 'DMSwarm_CellID' field contains local cell indices.
194 *
195 * @param[in,out] user Pointer to the UserCtx structure containing da, swarm, and ParticleCount.
196 * @return PetscErrorCode Returns 0 on success, non-zero on failure.
197 */
198PetscErrorCode CalculateParticleCountPerCell(UserCtx *user);
199
200/**
201 * @brief Resizes a swarm collectively to a target global particle count.
202 *
203 * The target is divided by quotient and remainder so every rank receives either
204 * `floor(N_target / nranks)` or one additional entry. Resizing establishes the
205 * storage layout; callers initialize or overwrite particle fields afterwards.
206 *
207 * @param[in,out] swarm Swarm object to resize.
208 * @param[in] N_target Target global particle count.
209 * @return PetscErrorCode 0 on success.
210 */
211PetscErrorCode ResizeSwarmGlobally(DM swarm, PetscInt N_target);
212
213/**
214 * @brief Checks particle count in the reference file and resizes the swarm if needed.
215 *
216 * Reads the specified field file (e.g., position) into a temporary Vec to determine
217 * the number of particles (`N_file`) represented in that file for the given timestep.
218 * Compares `N_file` with the current swarm size (`N_current`). If they differ,
219 * resizes the swarm globally (adds or removes particles) to match `N_file`.
220 * The resized population is balanced across the communicator before field input.
221 *
222 * @param[in,out] user Pointer to the UserCtx structure containing the DMSwarm.
223 * @param[in] ti Time index for constructing the file name.
224 * @param[in] ext File extension (e.g., "dat").
225 *
226 * @return PetscErrorCode 0 on success, non-zero on critical failure.
227 */
228PetscErrorCode PreCheckAndResizeSwarm(UserCtx *user, PetscInt ti, const char *ext);
229
230/**
231 * @brief Creates a sorted snapshot of all Particle IDs (PIDs) from a raw data array.
232 * @ingroup ParticleUtils
233 *
234 * This function is a crucial helper for the migration process. It captures the state of
235 * which particles are on the current MPI rank *before* migration occurs by taking a
236 * pointer to the swarm's raw PID data array. The resulting sorted array can then be used
237 * with an efficient binary search to quickly identify newcomer particles after migration.
238 *
239 * This function does NOT call DMSwarmGetField/RestoreField. It is the caller's
240 * responsibility to acquire the `pid_field` pointer before calling and restore it afterward.
241 *
242 * @param[in] pid_field A read-only pointer to the raw array of PIDs for the local swarm.
243 * @param[in] n_local The number of particles currently on the local rank.
244 * @param[out] pids_snapshot_out A pointer to a `PetscInt64*` array. This function will
245 * allocate memory for this array, and the caller is
246 * responsible for freeing it with `PetscFree()` when it
247 * is no longer needed.
248 *
249 * @return PetscErrorCode 0 on success, or a non-zero PETSc error code on failure.
250 */
251PetscErrorCode GetLocalPIDSnapshot(const PetscInt64 pid_field[],
252 PetscInt n_local,
253 PetscInt64 **pids_snapshot_out);
254
255/**
256 * @brief Safely adds a new migration task to a dynamically sized list.
257 *
258 * This utility function manages a dynamic array of MigrationInfo structs. It appends
259 * a new entry to the list and automatically doubles the array's capacity using
260 * `PetscRealloc` if the current capacity is exceeded. This prevents buffer overflows
261 * and avoids the need to know the number of migrating particles in advance.
262 *
263 * @param[in,out] migration_list_p A pointer to the MigrationInfo array pointer. The function
264 * will update this pointer if the array is reallocated.
265 * @param[in,out] capacity_p A pointer to an integer holding the current allocated
266 * capacity of the list (in number of elements). This will be
267 * updated upon reallocation.
268 * @param[in,out] count_p A pointer to an integer holding the current number of
269 * items in the list. This will be incremented by one.
270 * @param[in] particle_local_idx The local index (from 0 to nlocal-1) of the particle
271 * that needs to be migrated.
272 * @param[in] destination_rank The target MPI rank for the particle.
273 *
274 * @return PetscErrorCode 0 on success, or a non-zero PETSc error code on failure (e.g., from memory allocation).
275 */
276PetscErrorCode AddToMigrationList(MigrationInfo **migration_list_p,
277 PetscInt *capacity_p,
278 PetscInt *count_p,
279 PetscInt particle_local_idx,
280 PetscMPIInt destination_rank);
281
282/**
283 * @brief Identifies newly arrived particles after migration and flags them for a location search.
284 * @ingroup ParticleMotion
285 *
286 * This function is a critical component of the iterative migration process managed by
287 * the main particle settlement orchestrator (e.g., `SettleParticles`). After a
288 * `DMSwarmMigrate` call, each rank's local particle list is a new mix of resident
289 * particles and newly received ones. This function's job is to efficiently identify
290 * these "newcomers" and set their `DMSwarm_location_status` field to `NEEDS_LOCATION`.
291 *
292 * This ensures that in the subsequent pass of the migration `do-while` loop, only the
293 * newly arrived particles are processed by the expensive location algorithm, preventing
294 * redundant work on particles that are already settled on the current rank.
295 *
296 * PerformMigration() leaves the particles that stayed first and the received ones after
297 * them, so the newcomers are exactly the entries from `first_newcomer` on: no PID lookup
298 * is needed, whatever order the particles are stored in.
299 *
300 * @param[in] swarm The DMSwarm object, which has just completed a migration.
301 * @param[in] n_local_before Number of local particles before the migration, for the log.
302 * @param[in] first_newcomer Index of the first received particle: the survivor count
303 * PerformMigration() reported.
304 *
305 * @return PetscErrorCode 0 on success, or a non-zero PETSc error code on failure.
306 */
307PetscErrorCode FlagNewcomersForLocation(DM swarm, PetscInt n_local_before, PetscInt first_newcomer);
308
309
310/**
311 * @brief Fast-path migration for restart particles using preloaded Cell IDs.
312 *
313 * This function provides an optimized migration path for particles whose Cell ID is
314 * already known: particles loaded from restart files, and freshly seeded particles,
315 * whose seeding records the cell it placed them in (a point source's cell may belong to
316 * another rank). Unlike the standard `LocateAllParticlesInGrid()`, which performs
317 * walking searches, this function sends each such particle straight to its cell's owner.
318 * Particles without a Cell ID (-1) are left for `LocateAllParticlesInGrid()`.
319 *
320 * **How It Works:**
321 * 1. Iterates through all local particles.
322 * 2. For each particle with a valid Cell ID (ci, cj, ck):
323 * - Calls `FindOwnerOfCell(ci, cj, ck)` to determine the correct rank.
324 * - If owner differs from current rank, adds to migration list.
325 * - If owner matches current rank, the existing `ACTIVE_AND_LOCATED` status is preserved.
326 * 3. Uses existing `SetMigrationRanks()` and `PerformMigration()` infrastructure.
327 * 4. Achieves **single-pass direct migration** (no multi-hop, no walking searches).
328 *
329 * @param[in,out] user Pointer to UserCtx containing the swarm and RankCellInfoMap.
330 * The function updates particle status fields and performs migration.
331 *
332 * @return PetscErrorCode 0 on success, non-zero on failure.
333 *
334 * @note Testing status:
335 * Direct coverage currently focuses on restart fast-path ownership transfer.
336 * Non-restart multi-pass migration behavior remains part of the next
337 * simulation-core test backlog.
338 */
339PetscErrorCode MigrateRestartParticlesUsingCellID(UserCtx *user);
340
341/**
342 * @brief Orchestrates the complete particle location and migration process for one timestep.
343 * @ingroup ParticleLocation
344 *
345 * This function is the master orchestrator for ensuring every particle is on its correct
346 * MPI rank and has a valid host cell index. It is designed to be called once per
347 * timestep after particle positions have been updated.
348 *
349 * The function uses a robust, iterative "Guess and Verify" strategy within a
350 * do-while loop to handle complex particle motion across processor boundaries,
351 * especially on curvilinear grids.
352 *
353 * 1. **State Snapshot:** At the start of each pass, it captures a list of all Particle IDs (PIDs)
354 * on the current rank.
355 * 2. **"Guess" (Heuristic):** For particles that are "lost" (no valid host cell),
356 * it first attempts a fast, bounding-box-based guess to find a potential new owner rank.
357 * 3. **"Verify" (Robust Walk):** For all other particles, or if the guess fails,
358 * it uses a robust cell-walking algorithm (`LocateParticleOrFindMigrationTarget`)
359 * that determines the particle's status: located locally, needs migration, exited the
360 * domain, or lost. A walk from the prior cell that the domain boundary blocked is retried
361 * through the guess path in the same pass.
362 * `LOST` and `EXITED` are final within one call: only pass 1 searches them.
363 * 4. **Migration:** After identifying all migrating particles on a pass, it performs the
364 * MPI communication using the `SetMigrationRanks` and `PerformMigration` helpers.
365 * 5. **Newcomer Flagging:** After migration, it uses the PID snapshot from step 1 to
366 * efficiently identify newly arrived particles and flag them for location on the next pass.
367 * 6. **Iteration:** The process repeats in a `do-while` loop until a pass occurs where
368 * no particles migrate, ensuring the entire swarm is in a stable, consistent state.
369 *
370 * @param[in,out] user Pointer to the UserCtx, containing the swarm and all necessary
371 * domain topology information (bboxlist, RankCellInfoMap, etc.).
372 * @param[in] bboxlist An array of BoundingBox structures for ALL MPI ranks, indexed 0 to (size-1).
373 * This array must be up-to-date and available on all ranks.
374 * @return PetscErrorCode 0 on success, or a non-zero PETSc error code on failure.
375 *
376 * @note Testing status:
377 * Direct unit coverage currently pins the prior-cell fast path, the
378 * local guess-then-verify path, and (two ranks) an exit that stays
379 * classified once across a migration pass. Newcomer flagging and several
380 * lost/migration edge cases are still targeted for future bespoke tests.
381 */
382PetscErrorCode LocateAllParticlesInGrid(UserCtx *user,BoundingBox *bboxlist);
383
384/**
385 * @brief Marks all local particles as `NEEDS_LOCATION` for the next settlement pass.
386 *
387 * This function is designed to be called at the end of a full timestep, after all
388 * particle-based calculations are complete. It prepares the swarm for the next
389 * timestep by ensuring that after the next position update, every particle will be
390 * re-evaluated by the LocateAllParticlesInGrid orchestrator.
391 *
392 * It iterates through all locally owned particles and sets their
393 * `DMSwarm_location_status` field to `NEEDS_LOCATION`.
394 *
395 * @param[in,out] user Pointer to the UserCtx containing the swarm.
396 * @return PetscErrorCode 0 on success, or a non-zero PETSc error code on failure.
397 */
398PetscErrorCode ResetAllParticleStatuses(UserCtx *user);
399
400 #endif // PARTICLE_MOTION_H
PetscErrorCode SortParticlesByCell(DM swarm)
Reorders the local swarm points so that points in the same host cell are contiguous.
PetscErrorCode ResizeSwarmGlobally(DM swarm, PetscInt N_target)
Resizes a swarm collectively to a target global particle count.
PetscErrorCode AddToMigrationList(MigrationInfo **migration_list_p, PetscInt *capacity_p, PetscInt *count_p, PetscInt particle_local_idx, PetscMPIInt destination_rank)
Safely adds a new migration task to a dynamically sized list.
PetscErrorCode SetMigrationRanks(UserCtx *user, const MigrationInfo *migrationList, PetscInt migrationCount)
Writes migration destinations into the DMSwarm rank field for marked particles.
PetscErrorCode RemoveFlaggedParticles(DM swarm, PetscInt n_scan, PetscBool remove[], PetscBool scan_backward)
Removes flagged swarm points in one pass, preserving the one-at-a-time removal order.
PetscErrorCode GetLocalPIDSnapshot(const PetscInt64 pid_field[], PetscInt n_local, PetscInt64 **pids_snapshot_out)
Creates a sorted snapshot of all Particle IDs (PIDs) from a raw data array.
PetscErrorCode PerformMigration(UserCtx *user, PetscInt *n_survivors)
Performs particle migration based on the pre-populated DMSwarmPICField_rank field.
PetscErrorCode MigrateRestartParticlesUsingCellID(UserCtx *user)
Fast-path migration for restart particles using preloaded Cell IDs.
PetscErrorCode UpdateAllParticlePositions(UserCtx *user)
Loops over all local particles in the DMSwarm, updating their positions based on velocity and the glo...
PetscErrorCode CalculateParticleCountPerCell(UserCtx *user)
Counts particles in each cell of the DMDA 'da' and stores the result in user->ParticleCount.
PetscErrorCode LocateAllParticlesInGrid(UserCtx *user, BoundingBox *bboxlist)
Orchestrates the complete particle location and migration process for one timestep.
PetscErrorCode CheckAndRemoveLostParticles(UserCtx *user, PetscInt *removedCountLocal, PetscInt *removedCountGlobal, PetscReal *removedScalarSumGlobal, PetscInt *exitedCountGlobal, PetscReal *exitedScalarSumGlobal)
Removes particles that the location algorithm flagged as LOST or EXITED.
PetscErrorCode UpdateParticlePosition(UserCtx *user, Particle *particle)
Updates a particle's position based on its velocity and the timestep dt (stored in user->dt).
PetscErrorCode ResetAllParticleStatuses(UserCtx *user)
Marks all local particles as NEEDS_LOCATION for the next settlement pass.
PetscErrorCode FlagNewcomersForLocation(DM swarm, PetscInt n_local_before, PetscInt first_newcomer)
Identifies newly arrived particles after migration and flags them for a location search.
static PetscBool IsParticleInBox(const BoundingBox *bbox, const Cmpnts *pos)
Whether a position lies in an axis-aligned bounding box, faces included.
static void ParticleUniformsFromHash(uint64_t hash, PetscReal u[4])
Four uniforms in [0,1) from one keyed draw hash.
PetscErrorCode PreCheckAndResizeSwarm(UserCtx *user, PetscInt ti, const char *ext)
Checks particle count in the reference file and resizes the swarm if needed.
PetscErrorCode CalculateBrownianDisplacement(UserCtx *user, PetscInt64 pid, PetscReal diff_eff, Cmpnts *displacement)
Calculates the stochastic displacement vector (Brownian motion) for a single particle.
The expression language shared by every configured field, the keyed hashes its random draws and other...
uint64_t PicurvMix64(uint64_t z)
splitmix64 finalizer: a bijective mix of 64 bits.
Definition expression.c:589
PetscReal PicurvUnitFromHash(uint64_t hash)
Uniform on [0, 1) from the top 53 bits of a hash.
Definition expression.c:601
Logging utilities and macros for PETSc-based applications.
Main header file for a complex fluid dynamics solver.
Cmpnts max_coords
Maximum x, y, z coordinates of the bounding box.
Definition variables.h:214
Cmpnts min_coords
Minimum x, y, z coordinates of the bounding box.
Definition variables.h:213
PetscScalar x
Definition variables.h:145
PetscScalar z
Definition variables.h:145
PetscScalar y
Definition variables.h:145
Defines a 3D axis-aligned bounding box.
Definition variables.h:212
A 3D point or vector with PetscScalar components.
Definition variables.h:144
Information needed to migrate a single particle between MPI ranks.
Definition variables.h:269
Defines a particle's core properties for Lagrangian tracking.
Definition variables.h:236
User-defined context containing data specific to a single computational grid level.
Definition variables.h:1157
Header file for particle location functions using the walking search algorithm.