PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
// code for simulation loop More...
#include "simulation.h"
Go to the source code of this file.
Macros | |
#define | __FUNCT__ "PerformInitialSetup" |
#define | __FUNCT__ "AdvanceSimulation" |
Functions | |
PetscErrorCode | UpdateSolverHistoryVectors (UserCtx *user) |
Copies the current time step's solution fields into history vectors (e.g., U(t_n) -> U_o, U_o -> U_rm1) for the next time step's calculations. | |
PetscErrorCode | PerformInitialSetup (SimCtx *simCtx) |
Finalizes the simulation setup at t=0, ensuring a consistent state before time marching. | |
PetscErrorCode | AdvanceSimulation (SimCtx *simCtx) |
Executes the main time-marching loop for the coupled Euler-Lagrange simulation. | |
// code for simulation loop
Test program for DMSwarm interpolation using the fdf-curvIB method. Provides the setup to start any simulation with DMSwarm and DMDAs.
Definition in file simulation.c.
#define __FUNCT__ "PerformInitialSetup" |
Definition at line 79 of file simulation.c.
#define __FUNCT__ "AdvanceSimulation" |
Definition at line 79 of file simulation.c.
PetscErrorCode UpdateSolverHistoryVectors | ( | UserCtx * | user | ) |
Copies the current time step's solution fields into history vectors (e.g., U(t_n) -> U_o, U_o -> U_rm1) for the next time step's calculations.
This function is critical for multi-step time integration schemes (like BDF2) used by the legacy solver. It must be called at the end of every time step, after the new solution has been fully computed.
The order of operations is important to avoid overwriting data prematurely.
user | The UserCtx for a single block. The function modifies the history vectors (Ucont_o, Ucont_rm1, etc.) within this context. |
Definition at line 23 of file simulation.c.
PetscErrorCode PerformInitialSetup | ( | SimCtx * | simCtx | ) |
Finalizes the simulation setup at t=0, ensuring a consistent state before time marching.
This function is called from main() after the initial Eulerian and Lagrangian states have been created but before the main time loop begins. Its responsibilities are:
simCtx | Pointer to the main simulation context structure. |
Definition at line 95 of file simulation.c.
PetscErrorCode AdvanceSimulation | ( | SimCtx * | simCtx | ) |
Executes the main time-marching loop for the coupled Euler-Lagrange simulation.
Executes the main time-marching loop for the particle simulation.
This function orchestrates the advancement of the simulation from the configured StartStep to the final step. It does NOT perform the initial t=0 setup, as that is handled by InitializeEulerianState and PerformInitialSetup in main().
For each timestep, it performs the following sequence:
user | Array of UserCtx structures for the finest grid level. |
Definition at line 181 of file simulation.c.