This page is the developer-oriented map of the current PICurv C codebase.
src/simulator.csrc/postprocessor.cBoth rely on shared setup/context infrastructure from setup.c, io.c, and variables.h. Persistent Eulerian field identity/runtime DM-Vec binding and separate solver-particle DMSwarm identity are shared through field_catalog.c, particle_field_catalog.c, and their headers; see Field Identity and Layout Catalog.
High-level stages:
PetscInitializeCreateSimulationContext (setup.c) parses control/options and initializes defaultsSetupSimulationEnvironment configures run directories and environment-dependent logging setupSetupGridAndSolversSetupBoundaryConditionsSetupDomainRankInfoInitializeEulerianStateInitializeParticleSwarm (if particles enabled)AdvanceSimulationFinalizeSimulation + PetscFinalizepost.run) into PostProcessParams.vts, .vtp) and statistics CSV outputsAfter successful field processing, the conductor's finalize_post_paraview_series can write .pvd indexes using committed checkpoint times and manifest ancestry. This serial presentation stage belongs to post.pipeline; it does not alter the C field kernels. Caught-up post invocations can refresh collections under the same post writer lock. See Physical-Time ParaView Collections (post.pipeline) for the tested scope.
include/variables.hCreateSimulationContextDM, vectors, metrics, block-local geometry)Observability sits apart from the list above rather than inside one of its rows, because every other module reports through it. logging.c owns the console tier system, the runtime metric emitters, and the lifecycle of the per-run diagnostic files in <run.runtime_logs>. Its dependency direction is one-way and deliberate: it reads SimCtx for the step, physical time, log directory, rank, and continuation state, and it depends on PETSc for collectives and formatted output, but no solver module depends on logging for a numerical result. That is what lets any module report without acquiring a dependency on any other, and it is why a change here can alter what a user sees without altering what the solver computes.
For contributor orientation, the table below lists high-value public entry points per subsystem. Function names come from include/*.h and represent the safest integration seams.
runloop.c, solvers.cCurrent tests cover all src/*.c files at least at module level (unit suites and/or smoke). Coverage depth is intentionally uneven:
setup.c, io.c, runloop.c, postprocessor.c) are mainly covered by smoke and Python orchestration tests.Metric.c, rhs.c, poisson.c, post kernels) are covered by targeted C unit suites plus smoke.walkingsearch.c, wallfunction.c, Filter.c) are covered by specific unit cases but still benefit from deeper function-level API prose.When adding docs, prioritize:
Primary ingestion sites:
setup.c: PETSc option parsing for solver/post shared runtime controlsio.c: grid read/generation inputs, restart/data IO, post recipe parsingLOG_LEVEL)Not all option consumption is explicit PetscOptionsGet*; PETSc dynamic ingestion also occurs through calls like KSPSetFromOptions in poisson.c.
picurv_cli/core.pysetup.c or io.cpostprocessing_kernels.cpicurvParticlePhysics.c/ParticleMotion.c interface