Entry point for the solver executable.
Initializes PETSc, builds the solver runtime, executes the configured workflow, and finalizes runtime resources before exit.
30{
31 PetscErrorCode ierr;
33
34
35 ierr = PetscInitialize(&argc, &argv, (char *)0, "PICurv Simulator"); CHKERRQ(ierr);
37
38
39
41
43
45
46
47
48
49
51
52
54
55
57
58
60
61
64 }
65
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
83
85
86
87
91 }else{
92
96 }
97 }
98 }else{
100 }
101
102
103
104
106
107
110 }else{
112 }
113 }else{
115 }
116
117
118
119
120
121
124 ierr = PetscFinalize();
125
126 return ierr;
127}
PetscErrorCode InitializeParticleSwarm(SimCtx *simCtx)
High-level particle initialization orchestrator for a simulation run.
PetscErrorCode InitializeEulerianState(SimCtx *simCtx)
High-level orchestrator to set the complete initial state of the Eulerian solver.
PetscErrorCode WriteSimulationFields(UserCtx *user)
Writes simulation fields to files.
PetscErrorCode DisplayBanner(SimCtx *simCtx)
Displays a structured banner summarizing the simulation configuration.
#define GLOBAL
Scope for global logging across all processes.
#define LOG_ALLOW(scope, level, fmt,...)
Logging macro that checks both the log level and whether the calling function is in the allowed-funct...
PetscErrorCode ProfilingFinalize(SimCtx *simCtx)
the profiling excercise and build a profiling summary which is then printed to a log file.
@ LOG_INFO
Informational messages about program execution.
PetscErrorCode ProfilingResetTimestepCounters(void)
Resets per-timestep profiling counters for the next solver step.
PetscErrorCode InitializeRuntimeSignalHandlers(void)
Installs lightweight signal handlers for graceful shutdown requests.
PetscErrorCode AdvanceSimulation(SimCtx *simCtx)
Executes the main time-marching loop for the particle simulation.
PetscErrorCode FinalizeRestartState(SimCtx *simCtx)
Performs post-load/post-init consistency checks for a restarted simulation.
PetscErrorCode PerformInitializedParticleSetup(SimCtx *simCtx)
Finalizes the simulation setup at t=0, ensuring a consistent state before time marching.
PetscErrorCode SetupDomainRankInfo(SimCtx *simCtx)
Sets up the full rank communication infrastructure, including neighbor ranks and bounding box exchang...
PetscErrorCode SetupGridAndSolvers(SimCtx *simCtx)
The main orchestrator for setting up all grid-related components.
PetscErrorCode SetupSimulationEnvironment(SimCtx *simCtx)
Verifies and prepares the complete I/O environment for a simulation run.
PetscErrorCode CreateSimulationContext(int argc, char **argv, SimCtx **p_simCtx)
Allocates and populates the master SimulationContext object.
PetscErrorCode SetupBoundaryConditions(SimCtx *simCtx)
(Orchestrator) Sets up all boundary conditions for the simulation.
PetscErrorCode FinalizeSimulation(SimCtx *simCtx)
Main cleanup function for the entire simulation context.
The master context for the entire simulation.
User-defined context containing data specific to a single computational grid level.