PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
 
Loading...
Searching...
No Matches
Functions
initialcondition.c File Reference

Sets the Eulerian state the run starts from: a fresh start from the initial-condition source or staged field, a restart from checkpoints, or the analytical field, and the solver history vectors that follow from it. More...

#include "initialcondition.h"
#include "expression.h"
#include "Metric.h"
#include "poisson.h"
Include dependency graph for initialcondition.c:

Go to the source code of this file.

Functions

static PetscErrorCode UcontFromInteriorUcat (UserCtx *user)
 Derive Ucont from a Ucat whose interior cells are set: sync the periodic and ghost cells, then interpolate to the faces.
 
static PetscErrorCode ReadStagedInitialField (UserCtx *user, const char *name, Vec target)
 Read one staged initial field (ufield00000_0 or vfield00000_0) from the initial-condition directory into target.
 
PetscErrorCode PopulateInitialUcont (UserCtx *user)
 Implementation of PopulateInitialUcont().
 
static PetscErrorCode FinalizeBlockState (UserCtx *user)
 Complete one initial-condition block after its interior values are assigned.
 
static PetscErrorCode ProjectInitialVelocity (SimCtx *simCtx)
 Make the fresh-start velocity divergence-free with the time step's own projection: solve the pressure Poisson equation for the initial Ucont, whose boundary fluxes are already set, and correct the interior faces.
 
static PetscErrorCode SetInitialFluidState_FreshStart (SimCtx *simCtx)
 Initialize Eulerian fields for a new simulation without restart data.
 
static PetscErrorCode SetInitialFluidState_Load (SimCtx *simCtx)
 Restore Eulerian fields from checkpoint files for a restart simulation.
 
PetscErrorCode InitializeEulerianState (SimCtx *simCtx)
 Implementation of InitializeEulerianState().
 

Detailed Description

Sets the Eulerian state the run starts from: a fresh start from the initial-condition source or staged field, a restart from checkpoints, or the analytical field, and the solver history vectors that follow from it.

Definition in file initialcondition.c.

Function Documentation

◆ UcontFromInteriorUcat()

static PetscErrorCode UcontFromInteriorUcat ( UserCtx *  user)
static

Derive Ucont from a Ucat whose interior cells are set: sync the periodic and ghost cells, then interpolate to the faces.

Definition at line 17 of file initialcondition.c.

18{
19 const FieldId cell_fields[] = {FIELD_ID_UCAT};
20
21 PetscFunctionBeginUser;
23 PetscCall(SynchronizePeriodicCellFields(user, 1, cell_fields));
24 PetscCall(UpdateLocalGhosts(user, FIELD_ID_UCAT));
25 PetscCall(Cart2Contra(user));
27 PetscFunctionReturn(0);
28}
PetscErrorCode SynchronizePeriodicCellFields(UserCtx *user, PetscInt num_fields, const FieldId field_ids[])
Synchronizes periodic endpoint cells for a list of cell-centered fields.
FieldId
Compile-time identity for a catalogued Eulerian field.
@ FIELD_ID_UCAT
#define PROFILE_FUNCTION_END
Marks the end of a profiled code block.
Definition logging.h:1029
#define PROFILE_FUNCTION_BEGIN
Marks the beginning of a profiled function: an always-on aggregate timer.
Definition logging.h:1000
PetscErrorCode UpdateLocalGhosts(UserCtx *user, FieldId field_id)
Updates the local vector (including ghost points) from its corresponding global vector.
Definition setup.c:2593
PetscErrorCode Cart2Contra(UserCtx *user)
Convert the ghosted Cartesian velocity field to contravariant face fluxes.
Definition setup.c:3396
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadStagedInitialField()

static PetscErrorCode ReadStagedInitialField ( UserCtx *  user,
const char *  name,
Vec  target 
)
static

Read one staged initial field (ufield00000_0 or vfield00000_0) from the initial-condition directory into target.

Definition at line 34 of file initialcondition.c.

35{
36 SimCtx *simCtx = user->simCtx;
37
38 PetscFunctionBeginUser;
40 PetscCall(PetscStrncpy(simCtx->_io_context_buffer, simCtx->initialConditionDirectory,
41 sizeof(simCtx->_io_context_buffer)));
43 PetscCall(ReadFieldData(user, name, target, "dat"));
44 simCtx->current_io_directory = NULL;
46 PetscFunctionReturn(0);
47}
PetscErrorCode ReadFieldData(UserCtx *user, const char *field_name, Vec field_vec, const char *ext)
Reads data for a specific field from a file into the provided vector.
Definition io.c:1248
#define PROFILE_HELPER_BEGIN
Marks the beginning of a profiled helper: timed only when enabled by name.
Definition logging.h:1014
#define PROFILE_HELPER_END
Alias of PROFILE_FUNCTION_END for a function that began with PROFILE_HELPER_BEGIN.
Definition logging.h:1033
SimCtx * simCtx
Back-pointer to the master simulation context.
Definition variables.h:1160
char * current_io_directory
Definition variables.h:944
char initialConditionDirectory[PETSC_MAX_PATH_LEN]
Definition variables.h:979
char _io_context_buffer[PETSC_MAX_PATH_LEN]
Definition variables.h:943
The master context for the entire simulation.
Definition variables.h:916
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PopulateInitialUcont()

PetscErrorCode PopulateInitialUcont ( UserCtx *  user)

Implementation of PopulateInitialUcont().

Populate Ucont for one fresh-start block from the initial source (-ic_source_*).

See also
PopulateInitialUcont()

Definition at line 53 of file initialcondition.c.

54{
55 SimCtx *simCtx = user->simCtx;
56 const PetscBool staged_flux = (PetscBool)(simCtx->initialConditionStaged && simCtx->initialConditionField == IC_FIELD_UCONT);
58 PicurvExpression *pressure = NULL;
59 PetscReal physical_time, weight = 1.0, factor = 1.0;
60 Vec fraction, length;
61
62 PetscFunctionBeginUser;
64 PetscCall(PicurvVelocitySourceCreate("ic_source", PETSC_FALSE, simCtx->initialConditionStaged, PETSC_TRUE, &source));
65 PetscCall(PicurvPhysicalTime(simCtx, simCtx->ti, &physical_time));
66 PetscCall(VecSet(user->Ucat, 0.0));
67 PetscCall(VecSet(user->Ucont, 0.0));
68 if (simCtx->initialConditionStaged) {
69 PetscCall(PetscOptionsGetReal(NULL, NULL, "-ic_source_field_weight", &weight, NULL));
70 PetscCall(ReadStagedInitialField(user, staged_flux ? "vfield00000_0" : "ufield00000_0", staged_flux ? user->Ucont : user->Ucat));
71 if (weight != 1.0) PetscCall(VecScale(staged_flux ? user->Ucont : user->Ucat, weight));
72 if (!staged_flux) PetscCall(UcontFromInteriorUcat(user));
73 }
74 PetscCall(PicurvSourcePressureCreate("ic_source", PETSC_TRUE, &pressure));
75 if (source.count > 0 || pressure) {
76 PetscCall(DMCreateGlobalVector(user->fda, &fraction));
77 PetscCall(DMCreateGlobalVector(user->fda, &length));
78 PetscCall(ComputeGridLineFractions(user, fraction, length));
79 if (source.bulk) PetscCall(PicurvSourceCellBulkFactor(user, &source, fraction, length, physical_time, &factor));
80 if (source.count > 0) PetscCall(PicurvSourceAddFluxes(user, &source, fraction, length, physical_time, factor, PETSC_FALSE));
81 PetscCall(PicurvSourceSetCellFields(user, NULL, 1.0, pressure, fraction, length, physical_time));
82 PetscCall(VecDestroy(&fraction));
83 PetscCall(VecDestroy(&length));
84 }
85 PetscCall(PicurvExpressionDestroy(&pressure));
86 PetscCall(PicurvVelocitySourceDestroy(&source));
88 PetscFunctionReturn(0);
89}
PetscErrorCode ComputeGridLineFractions(UserCtx *user, Vec fraction, Vec length)
Arc-length position of every owned cell centre along its three grid lines.
Definition Metric.c:1362
PicurvExpression * bulk
Target mean speed [m/s] in t, or NULL.
Definition expression.h:192
PetscErrorCode PicurvExpressionDestroy(PicurvExpression **expression)
Free a compiled expression.
Definition expression.c:818
PetscErrorCode PicurvSourceAddFluxes(UserCtx *user, const PicurvVelocitySource *source, Vec fraction, Vec length, PetscReal physical_time, PetscReal factor, PetscBool boundary_faces)
Add a source's flux to every owned face of Ucont, evaluating it at each face centre.
PetscErrorCode PicurvVelocitySourceCreate(const char *prefix, PetscBool on_face, PetscBool has_data, PetscBool allow_draws, PicurvVelocitySource *source)
Read and compile a velocity source from the options database.
Definition expression.c:872
PetscErrorCode PicurvSourceCellBulkFactor(UserCtx *user, const PicurvVelocitySource *source, Vec fraction, Vec length, PetscReal physical_time, PetscReal *factor)
Factor on a source's expressions that makes the volume mean of the whole field, along the source's ow...
PetscErrorCode PicurvVelocitySourceDestroy(PicurvVelocitySource *source)
Free a source's compiled expressions and bulk velocity.
PetscErrorCode PicurvSourcePressureCreate(const char *prefix, PetscBool allow_draws, PicurvExpression **pressure)
Read and compile a source's optional pressure, -<prefix>_pressure, an expression in Pa over the cell ...
Definition expression.c:925
PetscErrorCode PicurvSourceSetCellFields(UserCtx *user, const PicurvVelocitySource *velocity, PetscReal factor, const PicurvExpression *pressure, Vec fraction, Vec length, PetscReal physical_time)
Set a block's Ucat, its P, or both at every interior cell centre this rank owns, from a source evalua...
PetscInt count
1 for the normal frame, otherwise 3; 0 for staged data alone.
Definition expression.h:189
A prescribed velocity, for any target: one compiled expression per value, the frame they are in,...
Definition expression.h:187
static PetscErrorCode UcontFromInteriorUcat(UserCtx *user)
Derive Ucont from a Ucat whose interior cells are set: sync the periodic and ghost cells,...
static PetscErrorCode ReadStagedInitialField(UserCtx *user, const char *name, Vec target)
Read one staged initial field (ufield00000_0 or vfield00000_0) from the initial-condition directory i...
PetscErrorCode PicurvPhysicalTime(const SimCtx *simCtx, PetscReal solver_time, PetscReal *physical)
Convert a solver time to physical seconds, t * L_ref / U_ref.
Definition io.c:2986
Vec Ucont
Definition variables.h:1197
PetscBool initialConditionStaged
Definition variables.h:977
@ IC_FIELD_UCONT
Definition variables.h:203
InitialConditionField initialConditionField
Definition variables.h:978
PetscReal ti
Definition variables.h:925
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FinalizeBlockState()

static PetscErrorCode FinalizeBlockState ( UserCtx *  user)
static

Complete one initial-condition block after its interior values are assigned.

Definition at line 94 of file initialcondition.c.

95{
96 PetscErrorCode ierr;
97 PetscFunctionBeginUser;
98
100
101 // This sequence ensures a fully consistent state for a single block.
102 ierr = ApplyBoundaryConditions(user); CHKERRQ(ierr);
103 LOG_ALLOW(GLOBAL,LOG_TRACE," Boundary condition applied.\n");
104 // 2. Sync contravariant velocity field.
105 const FieldId staggered_fields[] = {FIELD_ID_UCONT};
106 ierr = SynchronizePeriodicStaggeredFields(user, 1, staggered_fields); CHKERRQ(ierr);
107 LOG_ALLOW(GLOBAL,LOG_TRACE," Ucont field ghosts updated.\n");
108
109 // 3. Convert to Cartesian velocity.
110 ierr = Contra2Cart(user); CHKERRQ(ierr);
111 LOG_ALLOW(GLOBAL,LOG_TRACE," Converted Ucont to Ucat.\n");
112
113 // 4. Finalize periodic endpoint values, then refresh local Cartesian velocity.
114 {
115 const FieldId cell_fields[] = {FIELD_ID_UCAT};
116 ierr = SynchronizePeriodicCellFields(user, 1, cell_fields); CHKERRQ(ierr);
117 }
118 ierr = UpdateLocalGhosts(user, FIELD_ID_UCAT); CHKERRQ(ierr);
119 LOG_ALLOW(GLOBAL,LOG_TRACE," Ucat field ghosts updated.\n");
120
122
123 PetscFunctionReturn(0);
124}
PetscErrorCode SynchronizePeriodicStaggeredFields(UserCtx *user, PetscInt num_fields, const FieldId field_ids[])
Synchronizes persistent component-staggered vector fields.
PetscErrorCode ApplyBoundaryConditions(UserCtx *user)
Main boundary-condition orchestrator executed during solver timestepping.
@ FIELD_ID_UCONT
#define GLOBAL
Scope for global logging across all processes.
Definition logging.h:46
#define LOG_ALLOW(scope, level, fmt,...)
Logging macro that checks both the log level and whether the calling function is in the allowed-funct...
Definition logging.h:214
@ LOG_TRACE
Very fine-grained tracing information for in-depth debugging.
Definition logging.h:33
PetscErrorCode Contra2Cart(UserCtx *user)
Reconstructs Cartesian velocity (Ucat) at cell centers from contravariant velocity (Ucont) defined on...
Definition setup.c:3313
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProjectInitialVelocity()

static PetscErrorCode ProjectInitialVelocity ( SimCtx *  simCtx)
static

Make the fresh-start velocity divergence-free with the time step's own projection: solve the pressure Poisson equation for the initial Ucont, whose boundary fluxes are already set, and correct the interior faces.

As after a step's projection, the boundary handlers are not reapplied, so the field stays divergence-free. The potential is discarded, so pressure keeps its initial value. Collective.

Definition at line 134 of file initialcondition.c.

135{
136 UserCtx *user_finest = simCtx->usermg.mgctx[simCtx->usermg.mglevels - 1].user;
137 const FieldId potential[] = {FIELD_ID_PHI};
138
139 PetscFunctionBeginUser;
141 PetscCall(PoissonSolver_Multigrid(&simCtx->usermg));
142 for (PetscInt bi = 0; bi < simCtx->block_number; bi++) {
143 /* UpdatePressure's refresh of Phi, without adding it to the pressure. */
144 PetscCall(SynchronizePeriodicCellFields(&user_finest[bi], 1, potential));
145 PetscCall(UpdateLocalGhosts(&user_finest[bi], FIELD_ID_PHI));
146 PetscCall(ProjectVelocity(&user_finest[bi]));
147 PetscCall(VecSet(user_finest[bi].Phi, 0.0));
148 PetscCall(UpdateLocalGhosts(&user_finest[bi], FIELD_ID_PHI));
149 }
150 LOG_ALLOW(GLOBAL, LOG_INFO, "Initial velocity projected to be divergence-free (Poisson source imbalance %g).\n",
151 (double)simCtx->poissonSourceImbalance);
153 PetscFunctionReturn(0);
154}
@ FIELD_ID_PHI
@ LOG_INFO
Informational messages about program execution.
Definition logging.h:31
PetscErrorCode ProjectVelocity(UserCtx *user)
Corrects the contravariant flux with the gradient of Phi.
Definition poisson.c:425
PetscErrorCode PoissonSolver_Multigrid(UserMG *usermg)
Solves the pressure-correction equation for every block with geometric multigrid.
Definition poisson.c:922
UserCtx * user
Definition variables.h:768
PetscInt block_number
Definition variables.h:1009
UserMG usermg
Definition variables.h:1082
PetscReal poissonSourceImbalance
Definition variables.h:1095
PetscInt mglevels
Definition variables.h:775
MGCtx * mgctx
Definition variables.h:778
User-defined context containing data specific to a single computational grid level.
Definition variables.h:1157
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetInitialFluidState_FreshStart()

static PetscErrorCode SetInitialFluidState_FreshStart ( SimCtx *  simCtx)
static

Initialize Eulerian fields for a new simulation without restart data.

Definition at line 159 of file initialcondition.c.

160{
161 PetscErrorCode ierr;
162 UserCtx *user_finest = simCtx->usermg.mgctx[simCtx->usermg.mglevels - 1].user;
163 PetscFunctionBeginUser;
164
166
167 for (PetscInt bi = 0; bi < simCtx->block_number; bi++) {
168 LOG_ALLOW(LOCAL, LOG_INFO, "Rank %d, Block %" PetscInt_FMT ": Setting t=0 state.\n", simCtx->rank, bi);
169
170 // 1. Set an initial guess for the INTERIOR of the domain.
171 // Replaces the legacy `if(InitialGuessOne)` block.
172
173 LOG_ALLOW(GLOBAL,LOG_TRACE," Initializing Interior Ucont field.\n");
174 ierr = PopulateInitialUcont(&user_finest[bi]); CHKERRQ(ierr);
175 LOG_ALLOW(GLOBAL,LOG_TRACE," Interior Ucont field initialized.\n");
176
177 // 2. Apply all boundary conditions, convert to Cartesian, and sync ghosts.
178 LOG_ALLOW(GLOBAL,LOG_TRACE," Boundary condition application and state finalization initiated.\n");
179 ierr = FinalizeBlockState(&user_finest[bi]); CHKERRQ(ierr);
180 LOG_ALLOW(GLOBAL,LOG_TRACE," Boundary condition application and state finalization complete.\n");
181 }
182
183 // If using multiple grid blocks, handle the interface conditions between them.
184 if (simCtx->block_number > 1) {
185 // LOG_ALLOW(GLOBAL, LOG_INFO, "Updating multi-block interfaces for t=0.\n");
186 // ierr = Block_Interface_U(user_finest); CHKERRQ(ierr);
187 // After interface update, ghost regions might be stale. Refresh them.
188 for (PetscInt bi = 0; bi < simCtx->block_number; bi++) {
189 const FieldId staggered_fields[] = {FIELD_ID_UCONT};
190 ierr = SynchronizePeriodicStaggeredFields(&user_finest[bi], 1, staggered_fields); CHKERRQ(ierr);
191 ierr = UpdateLocalGhosts(&user_finest[bi], FIELD_ID_UCAT); CHKERRQ(ierr);
192 }
193 }
194
195 {
196 PetscBool project = PETSC_FALSE;
197 ierr = PetscOptionsGetBool(NULL, NULL, "-ic_source_project", &project, NULL); CHKERRQ(ierr);
198 if (project) { ierr = ProjectInitialVelocity(simCtx); CHKERRQ(ierr); }
199 }
200
202
203 PetscFunctionReturn(0);
204}
static PetscErrorCode ProjectInitialVelocity(SimCtx *simCtx)
Make the fresh-start velocity divergence-free with the time step's own projection: solve the pressure...
PetscErrorCode PopulateInitialUcont(UserCtx *user)
Implementation of PopulateInitialUcont().
static PetscErrorCode FinalizeBlockState(UserCtx *user)
Complete one initial-condition block after its interior values are assigned.
#define LOCAL
Logging scope definitions for controlling message output.
Definition logging.h:45
PetscMPIInt rank
Definition variables.h:919
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetInitialFluidState_Load()

static PetscErrorCode SetInitialFluidState_Load ( SimCtx *  simCtx)
static

Restore Eulerian fields from checkpoint files for a restart simulation.

Definition at line 209 of file initialcondition.c.

210{
211 PetscErrorCode ierr;
212 UserCtx *user_finest = simCtx->usermg.mgctx[simCtx->mglevels - 1].user;
213 PetscFunctionBeginUser;
214
216
217 for (PetscInt bi = 0; bi < simCtx->block_number; bi++) {
218 LOG_ALLOW(LOCAL, LOG_INFO, "Rank %d, Block %" PetscInt_FMT ": Reading restart files for step %" PetscInt_FMT ".\n",
219 simCtx->rank, bi, simCtx->StartStep);
220
221 // ReadSimulationFields handles all file I/O for one block.
222 ierr = ReadSimulationFields(&user_finest[bi], simCtx->StartStep); CHKERRQ(ierr);
223
224 // Apply Boundary Conditions on Read fields
225 ierr = ApplyBoundaryConditions(&user_finest[bi]); CHKERRQ(ierr);
226 // After reading from a file, the local ghost regions MUST be updated
227 // to ensure consistency across process boundaries for the first time step.
228 //ierr = UpdateLocalGhosts(&user_finest[bi], FIELD_ID_UCAT); CHKERRQ(ierr);
229 //ierr = UpdateLocalGhosts(&user_finest[bi], FIELD_ID_P); CHKERRQ(ierr);
230 // ... add ghost updates for any other fields read from file ...
231 }
232
234
235 PetscFunctionReturn(0);
236}
PetscErrorCode ReadSimulationFields(UserCtx *user, PetscInt ti)
Reads binary field data for velocity, pressure, and other required vectors.
Definition io.c:1387
PetscInt StartStep
Definition variables.h:926
PetscInt mglevels
Definition variables.h:961
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializeEulerianState()

PetscErrorCode InitializeEulerianState ( SimCtx *  simCtx)

Implementation of InitializeEulerianState().

High-level orchestrator to set the complete initial state of the Eulerian solver.

See also
InitializeEulerianState()

Definition at line 242 of file initialcondition.c.

243{
244 PetscErrorCode ierr;
245 UserCtx *user_finest = simCtx->usermg.mgctx[simCtx->usermg.mglevels - 1].user;
246
247 PetscFunctionBeginUser;
248
250
251 LOG_ALLOW(GLOBAL, LOG_INFO, "--- Initializing Eulerian State ---\n");
252
253 if (simCtx->StartStep > 0) {
254 if(strcmp(simCtx->eulerianSource,"analytical")==0){
255 LOG_ALLOW(GLOBAL,LOG_INFO,"Initializing analytical field from its source (t=%.4f, step=%" PetscInt_FMT ").\n",simCtx->StartTime,simCtx->StartStep);
256 ierr = AnalyticalSolutionEngine(simCtx); CHKERRQ(ierr);
257 }
258 else{
259 LOG_ALLOW(GLOBAL, LOG_INFO, "Starting from RESTART files (t=%.4f, step=%" PetscInt_FMT ").\n",
260 simCtx->StartTime, simCtx->StartStep);
261 ierr = SetInitialFluidState_Load(simCtx); CHKERRQ(ierr);
262 }
263 /* Statistics resume from the same bundle the flow state came from, and are
264 * restored regardless of the Eulerian source: an analytical restart still
265 * continues a window that was accumulating before it. */
266 ierr = RestoreFieldStatisticsState(simCtx, simCtx->StartStep); CHKERRQ(ierr);
267 } else { // StartStep = 0
268 LOG_ALLOW(GLOBAL, LOG_INFO, "Performing a FRESH START (t=0, step=0).\n");
269 if(strcmp(simCtx->eulerianSource,"solve")==0){
270 ierr = SetInitialFluidState_FreshStart(simCtx); CHKERRQ(ierr);
271 }else if(strcmp(simCtx->eulerianSource,"load")==0){
272 LOG_ALLOW(GLOBAL,LOG_INFO,"FRESH START in LOAD mode. Reading files (t=%.4f,step=%" PetscInt_FMT ").\n",
273 simCtx->StartTime,simCtx->StartStep);
274 ierr=SetInitialFluidState_Load(simCtx);CHKERRQ(ierr);
275 }else if(strcmp(simCtx->eulerianSource,"analytical")==0){
276 LOG_ALLOW(GLOBAL,LOG_INFO,"FRESH START in ANALYTICAL mode (t=%.4f,step=%" PetscInt_FMT ").\n",
277 simCtx->StartTime,simCtx->StartStep);
278 ierr=AnalyticalSolutionEngine(simCtx);CHKERRQ(ierr);
279 }
280 }
281
282 // This crucial step, taken from the end of the legacy setup, ensures
283 // that the history vectors (Ucont_o, Ucont_rm1, etc.) are correctly
284 // populated before the first call to the time-stepping loop.
285 for (PetscInt bi = 0; bi < simCtx->block_number; bi++) {
286 ierr = UpdateSolverHistoryVectors(&user_finest[bi],
287 (PetscBool)(simCtx->StartStep > 0 && simCtx->restartHistoryAvailable)); CHKERRQ(ierr);
288 }
289
290 LOG_ALLOW(GLOBAL, LOG_INFO, "--- Eulerian State Initialized and History Vectors Populated ---\n");
291
293 PetscFunctionReturn(0);
294}
PetscErrorCode AnalyticalSolutionEngine(SimCtx *simCtx)
Sets the Eulerian fields from the case's source (-ic_source_*) at the step's time.
static PetscErrorCode SetInitialFluidState_Load(SimCtx *simCtx)
Restore Eulerian fields from checkpoint files for a restart simulation.
static PetscErrorCode SetInitialFluidState_FreshStart(SimCtx *simCtx)
Initialize Eulerian fields for a new simulation without restart data.
PetscErrorCode RestoreFieldStatisticsState(SimCtx *simCtx, PetscInt ti)
Restores field-statistics window state and accumulators from a checkpoint.
Definition io.c:1604
PetscErrorCode UpdateSolverHistoryVectors(UserCtx *user, PetscBool preserve_previous_state)
Copies the current time step's solution fields into history vectors (e.g., U(t_n) -> U_o,...
Definition runloop.c:376
PetscReal StartTime
Definition variables.h:932
char eulerianSource[PETSC_MAX_PATH_LEN]
Definition variables.h:938
PetscBool restartHistoryAvailable
Definition variables.h:947
Here is the call graph for this function:
Here is the caller graph for this function: