|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
#include "io.h"#include "variables.h"#include "logging.h"#include "ParticleSwarm.h"#include "interpolation.h"#include "grid.h"#include "setup.h"#include "Metric.h"#include "postprocessing_kernels.h"#include "vtk_io.h"#include "particle_statistics.h"Go to the source code of this file.
Functions | |
| PetscErrorCode | SetupPostProcessSwarm (UserCtx *user, PostProcessParams *pps) |
| Creates a new, dedicated DMSwarm for post-processing tasks. | |
| PetscErrorCode | WriteEulerianFile (UserCtx *user, PostProcessParams *pps, PetscInt ti) |
| Orchestrates the writing of a combined, multi-field VTK file for a single time step. | |
| PetscErrorCode | EulerianDataProcessingPipeline (UserCtx *user, PostProcessParams *pps) |
| Parses the processing pipeline string and executes the requested kernels. | |
| PetscErrorCode | ParticleDataProcessingPipeline (UserCtx *user, PostProcessParams *pps) |
| Parses and executes the particle pipeline using a robust two-pass approach. | |
| PetscErrorCode | WriteParticleFile (UserCtx *user, PostProcessParams *pps, PetscInt ti) |
| Writes particle data to a VTP file using the Prepare-Write-Cleanup pattern. | |
| PetscErrorCode | GlobalStatisticsPipeline (UserCtx *user, PostProcessParams *pps, PetscInt ti) |
| Executes the global statistics pipeline, computing aggregate reductions over all particles. | |
| PetscErrorCode | FieldStatisticsPipeline (UserCtx *user, PostProcessParams *pps, PetscInt ti) |
| Derives and writes field statistics for the windows a recipe requests. | |
| PetscErrorCode SetupPostProcessSwarm | ( | UserCtx * | user, |
| PostProcessParams * | pps | ||
| ) |
Creates a new, dedicated DMSwarm for post-processing tasks.
This function is called once at startup. It creates an empty DMSwarm and associates it with the same grid DM as the primary swarm and registers all the required fields.
| user | The UserCtx where user->post_swarm will be created. |
| pps | The PostProcessParams containing the particle_pipeline string for field registration. |
Creates a new, dedicated DMSwarm for post-processing tasks.
Local to this translation unit.
Definition at line 21 of file postprocessor.c.
| PetscErrorCode WriteEulerianFile | ( | UserCtx * | user, |
| PostProcessParams * | pps, | ||
| PetscInt | ti | ||
| ) |
Orchestrates the writing of a combined, multi-field VTK file for a single time step.
This function is the primary driver for generating output. It performs these steps:
| user | The UserCtx for the finest grid level. |
| pps | The post-processing configuration struct. |
| ti | The current time step index. |
Orchestrates the writing of a combined, multi-field VTK file for a single time step.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/postprocessor.h.
Definition at line 201 of file postprocessor.c.
| PetscErrorCode EulerianDataProcessingPipeline | ( | UserCtx * | user, |
| PostProcessParams * | pps | ||
| ) |
Parses the processing pipeline string and executes the requested kernels.
| user | The UserCtx containing the data to be transformed. |
| pps | The PostProcessParams containing the pipeline string. |
Parses the processing pipeline string and executes the requested kernels.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/postprocessor.h.
Definition at line 107 of file postprocessor.c.
| PetscErrorCode ParticleDataProcessingPipeline | ( | UserCtx * | user, |
| PostProcessParams * | pps | ||
| ) |
Parses and executes the particle pipeline using a robust two-pass approach.
This function ensures correctness and efficiency by separating field registration from kernel execution.
PASS 1 (Registration): The pipeline string is parsed to identify all new fields that will be created. These fields are registered with the DMSwarm.
Finalize: After Pass 1, DMSwarmFinalizeFieldRegister is called exactly once if any new fields were added, preparing the swarm's memory layout.
PASS 2 (Execution): The pipeline string is parsed again, and this time the actual compute kernels are executed, filling the now-valid fields.
| user | The UserCtx containing the DMSwarm. |
| pps | The PostProcessParams struct containing the particle_pipeline string. |
Parses and executes the particle pipeline using a robust two-pass approach.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/postprocessor.h.
Definition at line 626 of file postprocessor.c.
| PetscErrorCode WriteParticleFile | ( | UserCtx * | user, |
| PostProcessParams * | pps, | ||
| PetscInt | ti | ||
| ) |
Writes particle data to a VTP file using the Prepare-Write-Cleanup pattern.
| user | Primary UserCtx input for the operation. |
| pps | Post-processing configuration for the operation. |
| ti | Source timestep written into the VTP filename and metadata. |
Writes particle data to a VTP file using the Prepare-Write-Cleanup pattern.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/postprocessor.h.
Definition at line 749 of file postprocessor.c.
| PetscErrorCode GlobalStatisticsPipeline | ( | UserCtx * | user, |
| PostProcessParams * | pps, | ||
| PetscInt | ti | ||
| ) |
Executes the global statistics pipeline, computing aggregate reductions over all particles.
Parses the semicolon-delimited pps->statistics_pipeline string and dispatches to the appropriate kernel (e.g. ComputeParticleMSD). Each kernel appends one row to its own CSV file and logs a summary via LOG_INFO. All MPI reductions happen inside each kernel. This pipeline is independent of the per-particle VTK pipeline; it produces no .vtp output.
| user | The UserCtx containing the primary DMSwarm (user->swarm). |
| pps | The PostProcessParams containing statistics_pipeline and statistics_output_prefix. |
| ti | Current time-step index (passed through to kernels for time computation). |
Executes the global statistics pipeline, computing aggregate reductions over all particles.
Local to this translation unit.
Definition at line 698 of file postprocessor.c.
| PetscErrorCode FieldStatisticsPipeline | ( | UserCtx * | user, |
| PostProcessParams * | pps, | ||
| PetscInt | ti | ||
| ) |
Derives and writes field statistics for the windows a recipe requests.
Runs once per processed step, beside the particle statistics pipeline, because a window's accumulated state is a property of the bundle at that step. A recipe spanning several steps therefore produces a convergence history rather than the same picture repeated; pinning field_statistics_source_step collapses it back to a single bundle.
Each window is written to its own file. The VTK point-data cap is per file, and one window carrying every output already fills most of it.
Does nothing when no window is requested. A window the run does not configure is fatal; a window that has not yet accumulated a sample is skipped with a note, since a recipe covering a whole run legitimately reaches bundles from before it began.
| [in] | user | Finest-level block context holding accumulators and staging fields. |
| [in] | pps | Post-processing recipe naming the windows, outputs, and formats. |
| [in] | ti | Step being processed; names the output and selects the bundle. |
Derives and writes field statistics for the windows a recipe requests.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/postprocessor.h.
Definition at line 485 of file postprocessor.c.