|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
Implementation of data input/output routines, focusing on grid configuration. More...
#include "io.h"#include "checksum.h"#include "field_catalog.h"#include "particle_field_catalog.h"#include "statistics_accumulator.h"#include <errno.h>#include <stdlib.h>#include <sys/stat.h>#include <unistd.h>Go to the source code of this file.
Macros | |
| #define | PICURV_CHECKPOINT_FORMAT "picurv-checkpoint" |
| #define | PICURV_CHECKPOINT_VERSION 1 |
| #define | PICURV_CHECKPOINTS_DIRECTORY "checkpoints" |
| #define | PICURV_EULERIAN_DIRECTORY "eulerian" |
| #define | PICURV_PARTICLE_DIRECTORY "particles" |
| #define | PICURV_STATISTICS_DIRECTORY "statistics" |
| #define | PICURV_CHECKPOINT_STEP_WIDTH 12 |
| #define | __FUNCT__ "ReadGridGenerationInputs" |
| #define | __FUNCT__ "ReadGridFile" |
| #define | __FUNCT__ "GetDrivenSeamFluxFlag" |
| #define | __FUNCT__ "ParseAllBoundaryConditions" |
| #define | __FUNCT__ "DeterminePeriodicity" |
| #define | __FUNCT__ "ReadFieldData" |
| #define | __FUNCT__ "RestoreDrivenFluxTarget" |
| #define | __FUNCT__ "ReadStatisticsWindowState" |
| #define | PICURV_STATISTICS_REQUIRE(suffix, getter, target) |
| #define | __FUNCT__ "RestoreFieldStatisticsState" |
| #define | __FUNCT__ "WriteFieldData" |
| #define | __FUNCT__ "WriteStatisticsFields" |
| #define | __FUNCT__ "ParsePostProcessingSettings" |
| #define | __FUNCT__ "ParseScalingInformation" |
Functions | |
| static PetscErrorCode | CopyOwnedLocalScalarToGlobal (DM dm, Vec local_vec, Vec global_vec) |
| Copies the owned entries of a ghosted scalar DMDA vector to its global vector. | |
| static PetscBool | CheckpointFieldIsEnabled (const SimCtx *simCtx, const FieldDescriptor *descriptor) |
| Return whether a catalogued field belongs in the current checkpoint. | |
| static PetscErrorCode | FormatStatisticsPath (const char *root, PetscInt window, PetscInt block, const char *payload_name, char *path, size_t path_size) |
| Format any level of the statistics subtree, from the root down to one payload. | |
| static PetscErrorCode | GatherVectorToRankZero (Vec field_vec, Vec *sequential_vec) |
| Gather a vector in decomposition-independent natural ordering onto rank zero. | |
| static PetscErrorCode | ComputeCheckpointGeometrySHA256 (SimCtx *simCtx, UserCtx *user, char digest_hex[65]) |
| Compute and cache a rank-count-independent hash of the active grid geometry. | |
| static PetscErrorCode | FormatCheckpointStepDirectory (const char *root, PetscInt step, char *path, size_t path_size) |
| Format the canonical directory name for one completed step. | |
| static PetscErrorCode | ResolveCheckpointStepDirectory (const char *source_root, PetscInt step, char *path, size_t path_size) |
| Resolve either an exact bundle or a run/output root to one step bundle. | |
| static PetscErrorCode | CreateCheckpointDirectoryCollective (const SimCtx *simCtx, const char *path) |
| Create one directory on rank zero and report failures collectively. | |
| static PetscErrorCode | ValidateCheckpointBundle (SimCtx *simCtx, UserCtx *user, const char *checkpoint_directory, PetscInt expected_step, PetscReal *physical_time, PetscInt *particle_count, PetscBool *particles_saved, PetscBool *les_saved, PetscBool *rans_saved) |
| Validate a committed bundle and return selected authoritative metadata. | |
| void | TrimWhitespace (char *str) |
| Implementation of TrimWhitespace(). | |
| PetscBool | ShouldWriteDataOutput (const SimCtx *simCtx, PetscInt completed_step) |
| Implementation of ShouldWriteDataOutput(). | |
| PetscErrorCode | ReadGridGenerationInputs (UserCtx *user) |
Internal helper implementation: ReadGridGenerationInputs(). | |
| PetscErrorCode | PopulateFinestUserGridResolutionFromOptions (UserCtx *finest_users, PetscInt nblk) |
Internal helper implementation: PopulateFinestUserGridResolutionFromOptions(). | |
| PetscErrorCode | ReadGridFile (UserCtx *user) |
Internal helper implementation: ReadGridFile(). | |
| void | FreeBC_ParamList (BC_Param *head) |
| Implementation of FreeBC_ParamList(). | |
| PetscErrorCode | StringToBCFace (const char *str, BCFace *face_out) |
Internal helper implementation: StringToBCFace(). | |
| PetscErrorCode | StringToBCType (const char *str, BCType *type_out) |
Internal helper implementation: StringToBCType(). | |
| PetscErrorCode | StringToBCHandlerType (const char *str, BCHandlerType *handler_out) |
Internal helper implementation: StringToBCHandlerType(). | |
| PetscErrorCode | ValidateBCHandlerForBCType (BCType type, BCHandlerType handler) |
Internal helper implementation: ValidateBCHandlerForBCType(). | |
| PetscErrorCode | GetBCParamReal (BC_Param *params, const char *key, PetscReal *value_out, PetscBool *found) |
Internal helper implementation: GetBCParamReal(). | |
| PetscErrorCode | GetBCParamBool (BC_Param *params, const char *key, PetscBool *value_out, PetscBool *found) |
Internal helper implementation: GetBCParamBool(). | |
| PetscErrorCode | GetDrivenSeamFluxFlag (BC_Param *params, PetscBool *value_out, PetscBool *found) |
| Implementation of GetDrivenSeamFluxFlag(). | |
| PetscErrorCode | ParseAllBoundaryConditions (UserCtx *user, const char *bcs_input_filename) |
Internal helper implementation: ParseAllBoundaryConditions(). | |
| PetscErrorCode | DeterminePeriodicity (SimCtx *simCtx) |
Internal helper implementation: DeterminePeriodicity(). | |
| PetscErrorCode | VerifyPathExistence (const char *path, PetscBool is_dir, PetscBool is_optional, const char *description, PetscBool *exists) |
Internal helper implementation: VerifyPathExistence(). | |
| PetscErrorCode | ReadFieldData (UserCtx *user, const char *field_name, Vec field_vec, const char *ext) |
Internal helper implementation: ReadFieldData(). | |
| static PetscErrorCode | RestoreDrivenFluxTarget (SimCtx *simCtx, UserCtx *user, const char *checkpoint_directory) |
| Restore a latched driven-flow flux target from a checkpoint manifest. | |
| PetscErrorCode | ReadSimulationFields (UserCtx *user, PetscInt ti) |
Internal helper implementation: ReadSimulationFields(). | |
| static PetscErrorCode | ReadStatisticsWindowState (PetscOptions options, PetscInt window, const char *metadata_path, PetscReal checkpoint_time, PetscReal step_size, ExecutionMode exec_mode, PicurvWindow *state) |
| Restore one window's scalar bookkeeping from a validated manifest. | |
| PetscErrorCode | RestoreFieldStatisticsState (SimCtx *simCtx, PetscInt ti) |
| Implementation of RestoreFieldStatisticsState(). | |
| PetscErrorCode | ReadSwarmField (UserCtx *user, const char *field_name, const char *ext) |
Internal helper implementation: ReadSwarmField(). | |
| PetscErrorCode | ReadSwarmIntField (UserCtx *user, const char *field_name, const char *ext) |
Internal helper implementation: ReadSwarmIntField(). | |
| PetscErrorCode | ReadAllSwarmFields (UserCtx *user, PetscInt ti) |
Internal helper implementation: ReadAllSwarmFields(). | |
| PetscErrorCode | ReadCheckpointParticleCount (UserCtx *user, PetscInt ti, PetscInt *particle_count) |
| Implementation of ReadCheckpointParticleCount(). | |
| PetscErrorCode | WriteFieldData (UserCtx *user, const char *field_name, Vec field_vec, const char *ext) |
Internal helper implementation: WriteFieldData(). | |
| PetscErrorCode | WriteSimulationFields (UserCtx *user, const char *checkpoint_directory) |
| Implementation of WriteSimulationFields(). | |
| static PetscErrorCode | WriteStatisticsFields (UserCtx *user, const char *checkpoint_directory) |
| Write every window's accumulator payloads for one block into a bundle. | |
| PetscErrorCode | WriteSwarmField (UserCtx *user, const char *field_name, const char *ext) |
| Implementation of WriteSwarmField(). | |
| PetscErrorCode | WriteSwarmIntField (UserCtx *user, const char *field_name, const char *ext) |
Internal helper implementation: WriteSwarmIntField(). | |
| PetscErrorCode | WriteAllSwarmFields (UserCtx *user, const char *checkpoint_directory) |
Internal helper implementation: WriteAllSwarmFields(). | |
| static PetscErrorCode | WriteCheckpointPayloadEntry (FILE *manifest, const char *checkpoint_directory, PetscInt payload_index, const char *relative_path, const char *kind, const char *field_name, PetscInt block, const char *layout, PetscInt components, const char *logical_type, PetscInt global_size, const char *encoding) |
| Append one payload inventory entry to a checkpoint manifest. | |
| static PetscErrorCode | WriteCheckpointManifest (SimCtx *simCtx, UserCtx *user, const char *checkpoint_directory, const char *reason, const char *geometry_digest, PetscInt particle_count, char manifest_digest[65]) |
| Write the complete manifest after every payload has closed successfully. | |
| PetscErrorCode | WriteCheckpointBundle (SimCtx *simCtx, const char *reason) |
| Implementation of the transactional full-state checkpoint coordinator. | |
| PetscErrorCode | VecToArrayOnRank0 (Vec inVec, PetscInt *N, double **arrayOut) |
Internal helper implementation: VecToArrayOnRank0(). | |
| PetscErrorCode | SwarmFieldToArrayOnRank0 (DM swarm, const char *field_name, PetscInt *n_total_particles, PetscInt *n_components, PetscDataType *field_type_out, void **gathered_array) |
Internal helper implementation: SwarmFieldToArrayOnRank0(). | |
| PetscErrorCode | DisplayBanner (SimCtx *simCtx) |
| Emit the rank-zero startup summary from the effective simulation context. | |
| PetscErrorCode | ParsePostProcessingSettings (SimCtx *simCtx) |
Internal helper implementation: ParsePostProcessingSettings(). | |
| PetscErrorCode | ParseScalingInformation (SimCtx *simCtx) |
| Implementation of ParseScalingInformation(). | |
| PetscInt | ReadDataFileToArray (const char *filename, double **data_out, PetscInt *Nout, MPI_Comm comm) |
| Implementation of ReadDataFileToArray(). | |
| PetscErrorCode | ReadPositionsFromFile (PetscInt timeIndex, UserCtx *user, double **coordsArray, PetscInt *Ncoords) |
Internal helper implementation: ReadPositionsFromFile(). | |
| PetscErrorCode | ReadFieldDataToRank0 (PetscInt timeIndex, const char *fieldName, UserCtx *user, double **scalarArray, PetscInt *Nscalars) |
Internal helper implementation: ReadFieldDataToRank0(). | |
Variables | |
| static PetscInt | g_nblk_from_file = 0 |
| Stores the number of blocks read from the grid file. | |
| static PetscInt * | g_IMs_from_file = NULL |
| Caches the IM dimensions for all blocks read from the grid file. | |
| static PetscInt * | g_JMs_from_file = NULL |
| Caches the JM dimensions for all blocks read from the grid file. | |
| static PetscInt * | g_KMs_from_file = NULL |
| Caches the KM dimensions for all blocks read from the grid file. | |
| static PetscBool | g_file_has_been_read = PETSC_FALSE |
| A flag to ensure the grid file is read only once. | |
Implementation of data input/output routines, focusing on grid configuration.
This module provides functions to parse grid geometry information, either from command-line options for programmatically generated grids or by reading the header of a grid definition file.
Definition in file io.c.
| #define PICURV_STATISTICS_REQUIRE | ( | suffix, | |
| getter, | |||
| target | |||
| ) |
|
static |
Copies the owned entries of a ghosted scalar DMDA vector to its global vector.
DMLocalToGlobal with INSERT_VALUES is unsupported for multidirection-periodic DMDAs in PETSc. Explicitly copying only the uniquely owned region preserves INSERT semantics without reducing duplicate periodic ghost entries.
Definition at line 51 of file io.c.
|
static |
Return whether a catalogued field belongs in the current checkpoint.
Definition at line 72 of file io.c.
|
static |
Format any level of the statistics subtree, from the root down to one payload.
This is the only place the statistics layout is written down. The directory creator, the payload writer, the manifest inventory, and the restart reader all ask for the level they need, so a path cannot be built one way and looked for another.
Statistics payloads are block scoped exactly as Eulerian payloads are, with a window level above the block level, so a multiblock run keeps one accumulator tree per block under each window.
Pass root NULL for a bundle-relative path, and stop early by passing a negative window or block, or a NULL payload_name.
Definition at line 99 of file io.c.
|
static |
Gather a vector in decomposition-independent natural ordering onto rank zero.
Definition at line 124 of file io.c.
|
static |
Compute and cache a rank-count-independent hash of the active grid geometry.
Definition at line 155 of file io.c.
|
static |
Format the canonical directory name for one completed step.
Definition at line 204 of file io.c.
|
static |
Resolve either an exact bundle or a run/output root to one step bundle.
Definition at line 215 of file io.c.
|
static |
Create one directory on rank zero and report failures collectively.
Definition at line 232 of file io.c.
|
static |
Validate a committed bundle and return selected authoritative metadata.
Definition at line 252 of file io.c.
| void TrimWhitespace | ( | char * | str | ) |
Implementation of TrimWhitespace().
Removes leading and trailing ASCII whitespace from a mutable string.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/io.h.
Definition at line 399 of file io.c.
| PetscBool ShouldWriteDataOutput | ( | const SimCtx * | simCtx, |
| PetscInt | completed_step | ||
| ) |
Implementation of ShouldWriteDataOutput().
Returns whether full field/restart output should be written for the.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/io.h.
Definition at line 432 of file io.c.
| PetscErrorCode ReadGridGenerationInputs | ( | UserCtx * | user | ) |
Internal helper implementation: ReadGridGenerationInputs().
Parses command-line options for a programmatically generated grid for a SINGLE block.
Local to this translation unit.
Definition at line 447 of file io.c.
| PetscErrorCode PopulateFinestUserGridResolutionFromOptions | ( | UserCtx * | finest_users, |
| PetscInt | nblk | ||
| ) |
Internal helper implementation: PopulateFinestUserGridResolutionFromOptions().
Parses grid resolution arrays (-im, -jm, -km) once and applies them to all finest-grid blocks.
Local to this translation unit.
Definition at line 532 of file io.c.
| PetscErrorCode ReadGridFile | ( | UserCtx * | user | ) |
Internal helper implementation: ReadGridFile().
Sets grid dimensions from a file for a SINGLE block using a one-time read cache.
Local to this translation unit.
Definition at line 581 of file io.c.
| void FreeBC_ParamList | ( | BC_Param * | head | ) |
Implementation of FreeBC_ParamList().
Frees an entire linked list of boundary-condition parameters.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/io.h.
Definition at line 664 of file io.c.
| PetscErrorCode StringToBCFace | ( | const char * | str, |
| BCFace * | face_out | ||
| ) |
Internal helper implementation: StringToBCFace().
Converts a face-token string (e.g., "-Xi", "+Eta") to the internal BCFace enum.
Local to this translation unit.
Definition at line 679 of file io.c.
| PetscErrorCode StringToBCType | ( | const char * | str, |
| BCType * | type_out | ||
| ) |
Internal helper implementation: StringToBCType().
Converts a mathematical BC type string (e.g., "PERIODIC", "WALL") to BCType.
Local to this translation unit.
Definition at line 694 of file io.c.
| PetscErrorCode StringToBCHandlerType | ( | const char * | str, |
| BCHandlerType * | handler_out | ||
| ) |
Internal helper implementation: StringToBCHandlerType().
Converts a BC handler token (implementation strategy) to BCHandlerType.
Local to this translation unit.
Definition at line 709 of file io.c.
| PetscErrorCode ValidateBCHandlerForBCType | ( | BCType | type, |
| BCHandlerType | handler | ||
| ) |
Internal helper implementation: ValidateBCHandlerForBCType().
Validates that a selected handler is compatible with a mathematical BC type.
Local to this translation unit.
Definition at line 727 of file io.c.
| PetscErrorCode GetBCParamReal | ( | BC_Param * | params, |
| const char * | key, | ||
| PetscReal * | value_out, | ||
| PetscBool * | found | ||
| ) |
Internal helper implementation: GetBCParamReal().
Searches a BC_Param linked list for a key and returns its value as a double.
Local to this translation unit.
Definition at line 752 of file io.c.
| PetscErrorCode GetBCParamBool | ( | BC_Param * | params, |
| const char * | key, | ||
| PetscBool * | value_out, | ||
| PetscBool * | found | ||
| ) |
Internal helper implementation: GetBCParamBool().
Searches a BC_Param linked list for a key and returns its value as a bool.
Local to this translation unit.
Definition at line 773 of file io.c.
| PetscErrorCode GetDrivenSeamFluxFlag | ( | BC_Param * | params, |
| PetscBool * | value_out, | ||
| PetscBool * | found | ||
| ) |
Implementation of GetDrivenSeamFluxFlag().
Read the driven-flow seam-flux flag, accepting its deprecated apply_trim spelling.
The option was originally spelled apply_trim, which said that something was trimmed but not what or why. The canonical name is now enforce_seam_flux. Generated bcs.run files carry the canonical name, but a hand-written or archived one may still use the old spelling, so both are accepted here and the canonical name wins. The argument contract lives with the header declaration in include/io.h.
Definition at line 814 of file io.c.
| PetscErrorCode ParseAllBoundaryConditions | ( | UserCtx * | user, |
| const char * | bcs_input_filename | ||
| ) |
Internal helper implementation: ParseAllBoundaryConditions().
Parses the boundary conditions file to configure the type, handler, and any associated parameters for all 6 global faces of the domain.
Local to this translation unit.
Definition at line 837 of file io.c.
| PetscErrorCode DeterminePeriodicity | ( | SimCtx * | simCtx | ) |
Internal helper implementation: DeterminePeriodicity().
Scans all block-specific boundary condition files to determine a globally consistent periodicity for each dimension, reusing the core type parser.
Local to this translation unit.
Definition at line 1024 of file io.c.
| PetscErrorCode VerifyPathExistence | ( | const char * | path, |
| PetscBool | is_dir, | ||
| PetscBool | is_optional, | ||
| const char * | description, | ||
| PetscBool * | exists | ||
| ) |
Internal helper implementation: VerifyPathExistence().
A parallel-safe helper to verify the existence of a generic file or directory path.
Local to this translation unit.
Definition at line 1128 of file io.c.
| PetscErrorCode ReadFieldData | ( | UserCtx * | user, |
| const char * | field_name, | ||
| Vec | field_vec, | ||
| const char * | ext | ||
| ) |
Internal helper implementation: ReadFieldData().
Reads data for a specific field from a file into the provided vector.
Local to this translation unit.
Definition at line 1174 of file io.c.
|
static |
Restore a latched driven-flow flux target from a checkpoint manifest.
Only initial_flux needs this. Its target is derived from the field the run originally started with, so re-measuring it after a restart would silently retarget the controller at whatever the flux had drifted to. constant_flux reads its target from the bcs file on every run and is deliberately left alone, so that editing target_flux between segments still takes effect.
Checkpoints written before this metadata existed simply have no entry; the controller then falls back to re-measuring and says so.
| [in,out] | simCtx | Simulation context receiving the target. |
| [in] | user | Block context, for its boundary handler types. |
| [in] | checkpoint_directory | Directory holding the validated manifest. |
Definition at line 1412 of file io.c.
| PetscErrorCode ReadSimulationFields | ( | UserCtx * | user, |
| PetscInt | ti | ||
| ) |
Internal helper implementation: ReadSimulationFields().
Reads binary field data for velocity, pressure, and other required vectors.
Local to this translation unit.
Definition at line 1463 of file io.c.
|
static |
Restore one window's scalar bookkeeping from a validated manifest.
Definition at line 1533 of file io.c.
| PetscErrorCode RestoreFieldStatisticsState | ( | SimCtx * | simCtx, |
| PetscInt | ti | ||
| ) |
Implementation of RestoreFieldStatisticsState().
Restores field-statistics window state and accumulators from a checkpoint.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/io.h.
Definition at line 1667 of file io.c.
| PetscErrorCode ReadSwarmField | ( | UserCtx * | user, |
| const char * | field_name, | ||
| const char * | ext | ||
| ) |
Internal helper implementation: ReadSwarmField().
Reads data from a file into a specified field of a PETSc DMSwarm.
Local to this translation unit.
Definition at line 1767 of file io.c.
| PetscErrorCode ReadSwarmIntField | ( | UserCtx * | user, |
| const char * | field_name, | ||
| const char * | ext | ||
| ) |
Internal helper implementation: ReadSwarmIntField().
Reads integer swarm data by using ReadFieldData and casting the result.
Local to this translation unit.
Definition at line 1797 of file io.c.
| PetscErrorCode ReadAllSwarmFields | ( | UserCtx * | user, |
| PetscInt | ti | ||
| ) |
Internal helper implementation: ReadAllSwarmFields().
Reads multiple fields (positions, velocity, CellID, and weight) into a DMSwarm.
Local to this translation unit.
Definition at line 1864 of file io.c.
| PetscErrorCode ReadCheckpointParticleCount | ( | UserCtx * | user, |
| PetscInt | ti, | ||
| PetscInt * | particle_count | ||
| ) |
Implementation of ReadCheckpointParticleCount().
Read the particle count from a validated committed checkpoint.
Definition at line 1914 of file io.c.
| PetscErrorCode WriteFieldData | ( | UserCtx * | user, |
| const char * | field_name, | ||
| Vec | field_vec, | ||
| const char * | ext | ||
| ) |
Internal helper implementation: WriteFieldData().
Writes data from a specific PETSc vector to a file.
Local to this translation unit.
Definition at line 1947 of file io.c.
| PetscErrorCode WriteSimulationFields | ( | UserCtx * | user, |
| const char * | checkpoint_directory | ||
| ) |
Implementation of WriteSimulationFields().
Writes simulation fields to files.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/io.h.
Definition at line 2002 of file io.c.
|
static |
Write every window's accumulator payloads for one block into a bundle.
Definition at line 2034 of file io.c.
| PetscErrorCode WriteSwarmField | ( | UserCtx * | user, |
| const char * | field_name, | ||
| const char * | ext | ||
| ) |
Implementation of WriteSwarmField().
Writes data from a specific field in a PETSc Swarm to a file.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/io.h.
Definition at line 2076 of file io.c.
| PetscErrorCode WriteSwarmIntField | ( | UserCtx * | user, |
| const char * | field_name, | ||
| const char * | ext | ||
| ) |
Internal helper implementation: WriteSwarmIntField().
Writes integer data from a specific PETSc Swarm field to a file.
Local to this translation unit.
Definition at line 2131 of file io.c.
| PetscErrorCode WriteAllSwarmFields | ( | UserCtx * | user, |
| const char * | checkpoint_directory | ||
| ) |
Internal helper implementation: WriteAllSwarmFields().
Writes a predefined set of PETSc Swarm fields to files.
Local to this translation unit.
Definition at line 2196 of file io.c.
|
static |
Append one payload inventory entry to a checkpoint manifest.
Definition at line 2231 of file io.c.
|
static |
Write the complete manifest after every payload has closed successfully.
Definition at line 2282 of file io.c.
| PetscErrorCode WriteCheckpointBundle | ( | SimCtx * | simCtx, |
| const char * | reason | ||
| ) |
Implementation of the transactional full-state checkpoint coordinator.
Write and atomically publish one complete checkpoint bundle.
Definition at line 2530 of file io.c.
| PetscErrorCode VecToArrayOnRank0 | ( | Vec | inVec, |
| PetscInt * | N, | ||
| double ** | arrayOut | ||
| ) |
Internal helper implementation: VecToArrayOnRank0().
Gathers the contents of a distributed PETSc Vec into a single array on rank 0.
Local to this translation unit.
Definition at line 2650 of file io.c.
| PetscErrorCode SwarmFieldToArrayOnRank0 | ( | DM | swarm, |
| const char * | field_name, | ||
| PetscInt * | n_total_particles, | ||
| PetscInt * | n_components, | ||
| PetscDataType * | field_type_out, | ||
| void ** | gathered_array | ||
| ) |
Internal helper implementation: SwarmFieldToArrayOnRank0().
Gathers any DMSwarm field from all ranks to a single, contiguous array on rank 0.
Local to this translation unit.
Definition at line 2686 of file io.c.
| PetscErrorCode DisplayBanner | ( | SimCtx * | simCtx | ) |
Emit the rank-zero startup summary from the effective simulation context.
Displays a structured banner summarizing the simulation configuration.
Reports only configuration that applies to the selected run mode. In particular, pseudo-CFL is a Dual Time Picard–Jameson RK control and is deliberately omitted for explicit and Newton–Krylov momentum solves.
Definition at line 2776 of file io.c.
| PetscErrorCode ParsePostProcessingSettings | ( | SimCtx * | simCtx | ) |
Internal helper implementation: ParsePostProcessingSettings().
Initializes post-processing settings from a config file and command-line overrides.
Local to this translation unit.
Definition at line 3076 of file io.c.
| PetscErrorCode ParseScalingInformation | ( | SimCtx * | simCtx | ) |
Implementation of ParseScalingInformation().
Parses physical scaling parameters from command-line options.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/io.h.
Definition at line 3242 of file io.c.
| PetscInt ReadDataFileToArray | ( | const char * | filename, |
| double ** | data_out, | ||
| PetscInt * | Nout, | ||
| MPI_Comm | comm | ||
| ) |
Implementation of ReadDataFileToArray().
Reads a simple ASCII data file containing one numeric value per line.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/io.h.
Definition at line 3286 of file io.c.
| PetscErrorCode ReadPositionsFromFile | ( | PetscInt | timeIndex, |
| UserCtx * | user, | ||
| double ** | coordsArray, | ||
| PetscInt * | Ncoords | ||
| ) |
Internal helper implementation: ReadPositionsFromFile().
Reads coordinate data (for particles) from file into a PETSc Vec, then gathers it to rank 0.
Local to this translation unit.
Definition at line 3418 of file io.c.
| PetscErrorCode ReadFieldDataToRank0 | ( | PetscInt | timeIndex, |
| const char * | fieldName, | ||
| UserCtx * | user, | ||
| double ** | scalarArray, | ||
| PetscInt * | Nscalars | ||
| ) |
Internal helper implementation: ReadFieldDataToRank0().
Reads a named field from file into a PETSc Vec, then gathers it to rank 0.
Local to this translation unit.
Definition at line 3456 of file io.c.
|
static |
|
static |
|
static |
|
static |