// Setup code for running any simulation More...
#include <ctype.h>#include <errno.h>#include "setup.h"#include "statistics_config.h"#include "statistics_accumulator.h"#include "ParticleInitialConditions.h"#include "verification_sources.h"#include "AnalyticalSolutions.h"#include <unistd.h>#include <limits.h>#include <stdlib.h>Go to the source code of this file.
Macros | |
| #define | PICURV_STRINGIZE_(x) #x |
| #define | PICURV_STRINGIZE(x) PICURV_STRINGIZE_(x) |
| #define | PICURV_PETSC_MODE "optimized" |
| #define | PICURV_PETSC_INDICES "int32" |
| #define | PETSC_ARCH "" |
| #define | PETSC_DIR "" |
| #define | PICURV_PETSC_STAMP_MARKER "PICURV_PETSC_BUILD:" |
| #define | PICURV_BUILD_STAMP_MARKER "PICURV_BUILD:" |
Functions | |
| static const char * | PicurvExecutableName (int argc, char **argv, const char *fallback) |
| The name an executable reports itself by: the basename of argv[0]. | |
| int | PicurvCheckLinkedPetscIndexWidth (int argc, char **argv, const char *executable_name) |
| Implementation of PicurvCheckLinkedPetscIndexWidth(). | |
| PetscErrorCode | PicurvCheckPetscIntRange (MPI_Comm comm, PetscInt64 entries, const char *object) |
| Implementation of PicurvCheckPetscIntRange(). | |
| int | PicurvHandleVersionArgument (int argc, char **argv, const char *executable_name) |
| Implementation of PicurvHandleVersionArgument(). | |
| PetscBool | RuntimeWalltimeGuardParsePositiveSeconds (const char *text, PetscReal *seconds_out) |
| Implementation of RuntimeWalltimeGuardParsePositiveSeconds(). | |
| PetscErrorCode | InitializeSolutionConvergenceState (SimCtx *simCtx) |
| Implementation of InitializeSolutionConvergenceState(). | |
| PetscErrorCode | DestroySolutionConvergenceState (SimCtx *simCtx) |
| Implementation of DestroySolutionConvergenceState(). | |
| PetscErrorCode | LESConfigSetDefaults (LESConfig *config) |
| Implementation of LESConfigSetDefaults(). | |
| static PetscErrorCode | ParseLESConfiguration (SimCtx *simCtx) |
| Reads every LES closure parameter from the generated control file. | |
| PetscErrorCode | CreateSimulationContext (int argc, char **argv, SimCtx **p_simCtx) |
| Implementation of CreateSimulationContext(). | |
| static PetscErrorCode | PetscMkdirRecursive (const char *path) |
| Create a directory path recursively using PETSc-compatible error handling. | |
| static PetscBool | DirectoriesOverlap (const char *first, const char *second) |
| Whether two configured directories denote the same location or nest. | |
| static PetscBool | DirectoryValueIsWellFormed (const char *value) |
| Whether a configured directory name is safe to write to a PETSc options line. | |
| static PetscBool | DirectoryHitsReservedName (const char *value) |
| Whether a directory's first path segment collides with a reserved run directory. | |
| static PetscBool | NormalizePathLexically (const char *value, char *out, size_t size, char *stack) |
| Lexically normalize a path, resolving "." and ".." textually. | |
| static PetscBool | ResolveDirectoryPhysically (const char *value, const char *cwd, char *out, size_t size, char *scratch) |
| Resolve a directory that may not exist yet to an absolute physical path. | |
| static PetscBool | PathContainsOrEquals (const char *ancestor, const char *path) |
Whether ancestor is the same directory as path, or contains it. | |
| static DirectoryVerdict | ClassifyLogDirectory (const char *log_dir, const char *output_dir, const char **reason) |
| Classify a configured log directory against the working directory. | |
| static PetscBool | LogDirectoryIsSafeToWipe (const char *log_dir, const char *output_dir, PetscBool authorized, const char **reason) |
| Final safety guard before the runtime deletes its log directory. | |
| PetscErrorCode | SetupSimulationEnvironment (SimCtx *simCtx) |
| Implementation of SetupSimulationEnvironment(). | |
| static PetscErrorCode | AllocateContextHierarchy (SimCtx *simCtx) |
| Allocate the user-context objects required by every multigrid level. | |
| PetscErrorCode | SetupGridAndSolvers (SimCtx *simCtx) |
| Implementation of SetupGridAndSolvers(). | |
| PetscErrorCode | CreateAndInitializeAllVectors (SimCtx *simCtx) |
| Implementation of CreateAndInitializeAllVectors(). | |
| static PetscErrorCode | RepairPeriodicNormalFaceGhosts (UserCtx *user, DM dm, Vec local_vec, PetscInt dof, char face_direction, PetscBool component_staggered) |
| Repairs the adjacent normal ghost layer for periodic face-staggered data. | |
| PetscErrorCode | RepairPeriodicFieldGhosts (UserCtx *user, const FieldView *view, Vec local_vec) |
| Implementation of RepairPeriodicFieldGhosts(). | |
| PetscErrorCode | UpdateLocalGhosts (UserCtx *user, FieldId field_id) |
| Updates a catalogued field's local ghost representation. | |
| PetscErrorCode | SetupBoundaryConditions (SimCtx *simCtx) |
| Implementation of SetupBoundaryConditions(). | |
| PetscErrorCode | Allocate3DArrayScalar (PetscReal ****array, PetscInt nz, PetscInt ny, PetscInt nx) |
| Implementation of Allocate3DArrayScalar(). | |
| PetscErrorCode | Deallocate3DArrayScalar (PetscReal ***array, PetscInt nz, PetscInt ny) |
| Implementation of Deallocate3DArrayScalar(). | |
| PetscErrorCode | Allocate3DArrayVector (Cmpnts ****array, PetscInt nz, PetscInt ny, PetscInt nx) |
| Implementation of Allocate3DArrayVector(). | |
| PetscErrorCode | Deallocate3DArrayVector (Cmpnts ***array, PetscInt nz, PetscInt ny) |
| Implementation of Deallocate3DArrayVector(). | |
| PetscErrorCode | GetOwnedCellRange (const DMDALocalInfo *info_nodes, PetscInt dim, PetscInt *xs_cell_global_out, PetscInt *xm_cell_local_out) |
| Implementation of GetOwnedCellRange(). | |
| PetscErrorCode | ComputeAndStoreNeighborRanks (UserCtx *user) |
| Implementation of ComputeAndStoreNeighborRanks(). | |
| PetscErrorCode | SetDMDAProcLayout (DM dm, UserCtx *user) |
| Implementation of SetDMDAProcLayout(). | |
| PetscErrorCode | SetupDomainRankInfo (SimCtx *simCtx) |
| Implementation of SetupDomainRankInfo(). | |
| PetscErrorCode | Contra2Cart (UserCtx *user) |
| Implementation of Contra2Cart(). | |
| PetscErrorCode | Cart2Contra (UserCtx *user) |
| Convert a spatially varying Cartesian velocity field to contravariant fluxes. | |
| PetscErrorCode | SetupDomainCellDecompositionMap (UserCtx *user) |
| Implementation of SetupDomainCellDecompositionMap(). | |
| PetscErrorCode | BinarySearchInt64 (PetscInt n, const PetscInt64 arr[], PetscInt64 key, PetscBool *found) |
| Implementation of BinarySearchInt64(). | |
| static PetscInt | Gidx (PetscInt i, PetscInt j, PetscInt k, UserCtx *user) |
| Convert logical indices into the flattened global index used by setup helpers. | |
| PetscErrorCode | ComputeDivergence (UserCtx *user) |
| Implementation of ComputeDivergence(). | |
| void | TransformScalarDerivativesToPhysical (PetscReal jacobian, Cmpnts csi_metrics, Cmpnts eta_metrics, Cmpnts zet_metrics, PetscReal dPhi_dcsi, PetscReal dPhi_deta, PetscReal dPhi_dzet, Cmpnts *gradPhi) |
| Implementation of TransformScalarDerivativesToPhysical(). | |
| static void | TransformDerivativesToPhysical (PetscReal jacobian, Cmpnts csi_metrics, Cmpnts eta_metrics, Cmpnts zet_metrics, Cmpnts deriv_csi, Cmpnts deriv_eta, Cmpnts deriv_zet, Cmpnts *dudx, Cmpnts *dvdx, Cmpnts *dwdx) |
| Transform contravariant vector derivatives into physical Cartesian derivatives. | |
| PetscErrorCode | ComputeScalarFieldDerivatives (UserCtx *user, PetscInt i, PetscInt j, PetscInt k, PetscReal ***field_data, Cmpnts *grad) |
| Implementation of ComputeScalarFieldDerivatives(). | |
| PetscErrorCode | ComputeVectorFieldDerivatives (UserCtx *user, PetscInt i, PetscInt j, PetscInt k, Cmpnts ***field_data, Cmpnts *dudx, Cmpnts *dvdx, Cmpnts *dwdx) |
| Implementation of ComputeVectorFieldDerivatives(). | |
| PetscErrorCode | DestroyUserVectors (UserCtx *user) |
| Implementation of DestroyUserVectors(). | |
| PetscErrorCode | DestroyUserContext (UserCtx *user) |
| Implementation of DestroyUserContext(). | |
| PetscErrorCode | FinalizeSimulation (SimCtx *simCtx) |
| Implementation of FinalizeSimulation(). | |
Variables | |
| static const char | picurv_petsc_build_stamp [] |
| const char | picurv_build_stamp [] |
| static const char * | kReservedRunDirectories [] = {"config", "scheduler", "checkpoints", "visualization", NULL} |
| Directory names the run tree owns; a log directory must never target one. | |
// Setup code for running any simulation
Test program for DMSwarm interpolation using the fdf-curvIB method. Provides the setup to start any simulation with DMSwarm and DMDAs.
Definition in file setup.c.
| #define PICURV_STRINGIZE | ( | x | ) | PICURV_STRINGIZE_(x) |
| enum DirectoryVerdict |
Definition at line 1414 of file setup.c.
|
static |
The name an executable reports itself by: the basename of argv[0].
The conductor stages each executable under its own file name (simulator64, say), so messages and the version line use that name rather than the program's role.
| [in] | argc | Native executable argument count. |
| [in] | argv | Native executable argument vector. |
| [in] | fallback | Name used when argv[0] is absent or empty. |
Definition at line 66 of file setup.c.
| int PicurvCheckLinkedPetscIndexWidth | ( | int | argc, |
| char ** | argv, | ||
| const char * | executable_name | ||
| ) |
Implementation of PicurvCheckLinkedPetscIndexWidth().
Refuse to start when the loaded libpetsc's PetscInt width differs from this build's.
Definition at line 79 of file setup.c.
| PetscErrorCode PicurvCheckPetscIntRange | ( | MPI_Comm | comm, |
| PetscInt64 | entries, | ||
| const char * | object | ||
| ) |
Implementation of PicurvCheckPetscIntRange().
Refuse a PETSc object whose global size this build's PetscInt cannot index.
Definition at line 102 of file setup.c.
| int PicurvHandleVersionArgument | ( | int | argc, |
| char ** | argv, | ||
| const char * | executable_name | ||
| ) |
Implementation of PicurvHandleVersionArgument().
Print the shared native build identity when a version flag is present.
The public argument and return contract is documented in include/setup.h.
Definition at line 119 of file setup.c.
| PetscBool RuntimeWalltimeGuardParsePositiveSeconds | ( | const char * | text, |
| PetscReal * | seconds_out | ||
| ) |
Implementation of RuntimeWalltimeGuardParsePositiveSeconds().
Parse a positive floating-point seconds value from runtime metadata.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/setup.h.
Definition at line 144 of file setup.c.
| PetscErrorCode InitializeSolutionConvergenceState | ( | SimCtx * | simCtx | ) |
Implementation of InitializeSolutionConvergenceState().
Allocates any runtime storage required by solution-convergence logging.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/setup.h.
Definition at line 176 of file setup.c.
| PetscErrorCode DestroySolutionConvergenceState | ( | SimCtx * | simCtx | ) |
Implementation of DestroySolutionConvergenceState().
Frees any runtime storage allocated for solution-convergence logging.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/setup.h.
Definition at line 230 of file setup.c.
| PetscErrorCode LESConfigSetDefaults | ( | LESConfig * | config | ) |
Implementation of LESConfigSetDefaults().
Installs the shipped defaults for every LES closure parameter.
Full API contract is documented with the header declaration in include/setup.h.
Definition at line 288 of file setup.c.
|
static |
Reads every LES closure parameter from the generated control file.
Grouped into one routine because the parameters constrain one another: the averaging directions only mean something under homogeneous averaging, and the clip ceiling only under clamping. Selectors arrive as integers that the Python layer has already normalized from their user-facing names, which is the same contract -les, -pinit, and -interpolation_method follow.
Values that would make the closure ill-defined are rejected here as well as in Python, so a hand-written control file fails with a reason rather than producing a plausible-looking coefficient.
| [in,out] | simCtx | Simulation context whose les_config is populated. |
PETSC_ERR_ARG_OUTOFRANGE for a value outside its admissible range. Definition at line 341 of file setup.c.
| PetscErrorCode CreateSimulationContext | ( | int | argc, |
| char ** | argv, | ||
| SimCtx ** | p_simCtx | ||
| ) |
Implementation of CreateSimulationContext().
Allocates and populates the master SimulationContext object.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/setup.h.
Definition at line 453 of file setup.c.
|
static |
Create a directory path recursively using PETSc-compatible error handling.
Definition at line 1250 of file setup.c.
|
static |
Whether two configured directories denote the same location or nest.
A bare strcmp accepted "output/" against "output", and missed "output/sub" entirely. Comparison is done on normalized segment sequences so trailing slashes, "./" prefixes and repeated separators cannot defeat it.
| [in] | first | First directory value. |
| [in] | second | Second directory value. |
Definition at line 1309 of file setup.c.
|
static |
Whether a configured directory name is safe to write to a PETSc options line.
Whitespace, quotes, and comment markers change how the options file is tokenized, so a value carrying them would be misread rather than merely unsafe. This is never waivable: the user cannot consent to ambiguity.
| [in] | value | Configured directory value. |
Definition at line 1362 of file setup.c.
|
static |
Whether a directory's first path segment collides with a reserved run directory.
| [in] | value | Configured directory value. |
Definition at line 1382 of file setup.c.
|
static |
Lexically normalize a path, resolving "." and ".." textually.
Used only when the target does not exist yet, so realpath cannot resolve it. Resolving ".." textually is correct here precisely because there is no file to be a symlink; the existing prefix is resolved separately with realpath, which does follow symlinks.
| [in] | value | Path to normalize. |
| [out] | out | Buffer receiving the normalized path. |
| [in] | size | Size of the output buffer. |
| [out] | stack | Caller-provided scratch of at least PETSC_MAX_PATH_LEN bytes. |
Definition at line 1441 of file setup.c.
|
static |
Resolve a directory that may not exist yet to an absolute physical path.
realpath fails on a path whose final components have not been created, which is the normal case for a log directory. The longest existing prefix is resolved with realpath, so symlinked ancestors are followed, and the remainder is appended lexically.
| [in] | value | Configured directory value. |
| [in] | cwd | Current working directory, for relative values. |
| [out] | out | Buffer receiving the resolved absolute path. |
| [in] | size | Size of the output buffer. |
| [out] | scratch | Caller-provided scratch of at least 5*PETSC_MAX_PATH_LEN bytes. |
Definition at line 1503 of file setup.c.
|
static |
Whether ancestor is the same directory as path, or contains it.
| [in] | ancestor | Candidate containing directory, absolute and normalized. |
| [in] | path | Candidate contained directory, absolute and normalized. |
ancestor equals or contains path. Definition at line 1557 of file setup.c.
|
static |
Classify a configured log directory against the working directory.
Every non-waivable check - lexical and physical alike - runs before the caller is allowed to consider an authorization. An earlier version returned safe as soon as it saw an absolute path with authorization set, which let an authorized run delete its own run directory, an ancestor of it, or the filesystem root. Classification is now total and the waiver is applied once, to exactly one verdict.
| [in] | log_dir | Configured log directory. |
| [in] | output_dir | Configured output directory, for the overlap check. |
| [out] | reason | Set to a short explanation of the verdict. |
Definition at line 1583 of file setup.c.
|
static |
Final safety guard before the runtime deletes its log directory.
picurv validates run directories and re-checks them at submission, but the solver can be launched directly on a hand-written control file, and a directory can be replaced with a symlink between validation and launch. This is the last check before an irreversible recursive delete, so it is deliberately independent of anything the launcher did, which is what eliminates the validation-to-execution race.
An explicit -allow_unsafe_log_dir authorization waives exactly one verdict: an absolute location outside the working directory that neither is nor contains it. It never waives the working directory itself, an ancestor of it, a reserved run directory, an overlap with the output directory, a relative traversal, a relative symlink escape, or a malformed value. Those destroy the run itself or corrupt the options file, and no user consent makes them correct.
| [in] | log_dir | Configured log directory. |
| [in] | output_dir | Configured output directory, for the overlap check. |
| [in] | authorized | Whether an explicit unsafe-path authorization was supplied. |
| [out] | reason | Set to a short explanation when the directory is refused. |
Definition at line 1712 of file setup.c.
| PetscErrorCode SetupSimulationEnvironment | ( | SimCtx * | simCtx | ) |
Implementation of SetupSimulationEnvironment().
Verifies and prepares the complete I/O environment for a simulation run.
Definition at line 1728 of file setup.c.
|
static |
Allocate the user-context objects required by every multigrid level.
Definition at line 1964 of file setup.c.
| PetscErrorCode SetupGridAndSolvers | ( | SimCtx * | simCtx | ) |
Implementation of SetupGridAndSolvers().
The main orchestrator for setting up all grid-related components.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/setup.h.
Definition at line 2066 of file setup.c.
| PetscErrorCode CreateAndInitializeAllVectors | ( | SimCtx * | simCtx | ) |
Implementation of CreateAndInitializeAllVectors().
Creates and initializes all PETSc Vec objects for all fields.
Definition at line 2099 of file setup.c.
|
static |
Repairs the adjacent normal ghost layer for periodic face-staggered data.
PETSc wraps every component with cell-style indexing. A face family instead needs its adjacent normal ghost shifted by one additional physical face. With the width-three periodic DMDA, the required value is available in the deeper PETSc ghost at -3 or n+2. Tangential ghosts retain PETSc's native wraparound.
Definition at line 2386 of file setup.c.
Implementation of RepairPeriodicFieldGhosts().
Applies a catalogued field's periodic normal-face ghost repair to a local vector.
Definition at line 2556 of file setup.c.
Updates a catalogued field's local ghost representation.
Updates the local vector (including ghost points) from its corresponding global vector.
Resolves the typed field view, performs the existing PETSc scatter, and applies the established periodic normal-face repair when needed.
Definition at line 2593 of file setup.c.
| PetscErrorCode SetupBoundaryConditions | ( | SimCtx * | simCtx | ) |
Implementation of SetupBoundaryConditions().
(Orchestrator) Sets up all boundary conditions for the simulation.
Definition at line 2755 of file setup.c.
| PetscErrorCode Allocate3DArrayScalar | ( | PetscReal **** | array, |
| PetscInt | nz, | ||
| PetscInt | ny, | ||
| PetscInt | nx | ||
| ) |
Implementation of Allocate3DArrayScalar().
Allocates a 3D array of PetscReal values using PetscCalloc.
Definition at line 2819 of file setup.c.
| PetscErrorCode Deallocate3DArrayScalar | ( | PetscReal *** | array, |
| PetscInt | nz, | ||
| PetscInt | ny | ||
| ) |
Implementation of Deallocate3DArrayScalar().
Deallocates a 3D array of PetscReal values allocated by Allocate3DArrayScalar.
Definition at line 2856 of file setup.c.
| PetscErrorCode Allocate3DArrayVector | ( | Cmpnts **** | array, |
| PetscInt | nz, | ||
| PetscInt | ny, | ||
| PetscInt | nx | ||
| ) |
Implementation of Allocate3DArrayVector().
Allocates a contiguous 3D array of Cmpnts values.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/setup.h.
Definition at line 2902 of file setup.c.
| PetscErrorCode Deallocate3DArrayVector | ( | Cmpnts *** | array, |
| PetscInt | nz, | ||
| PetscInt | ny | ||
| ) |
Implementation of Deallocate3DArrayVector().
Deallocates a 3D array of Cmpnts structures allocated by Allocate3DArrayVector.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/setup.h.
Definition at line 2954 of file setup.c.
| PetscErrorCode GetOwnedCellRange | ( | const DMDALocalInfo * | info_nodes, |
| PetscInt | dim, | ||
| PetscInt * | xs_cell_global_out, | ||
| PetscInt * | xm_cell_local_out | ||
| ) |
Implementation of GetOwnedCellRange().
Determines the global starting index and number of CELLS owned by the current processor in a specified dimension.
Definition at line 3021 of file setup.c.
| PetscErrorCode ComputeAndStoreNeighborRanks | ( | UserCtx * | user | ) |
Implementation of ComputeAndStoreNeighborRanks().
Computes and stores the Cartesian neighbor ranks for the DMDA decomposition.
Definition at line 3116 of file setup.c.
| PetscErrorCode SetDMDAProcLayout | ( | DM | dm, |
| UserCtx * | user | ||
| ) |
Implementation of SetDMDAProcLayout().
Sets the processor layout for a given DMDA based on PETSc options.
Definition at line 3166 of file setup.c.
| PetscErrorCode SetupDomainRankInfo | ( | SimCtx * | simCtx | ) |
Implementation of SetupDomainRankInfo().
Sets up the full rank communication infrastructure, including neighbor ranks and bounding box exchange.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/setup.h.
Definition at line 3242 of file setup.c.
| PetscErrorCode Contra2Cart | ( | UserCtx * | user | ) |
Implementation of Contra2Cart().
Reconstructs Cartesian velocity (Ucat) at cell centers from contravariant velocity (Ucont) defined on cell faces.
Definition at line 3313 of file setup.c.
| PetscErrorCode Cart2Contra | ( | UserCtx * | user | ) |
Convert a spatially varying Cartesian velocity field to contravariant fluxes.
Convert the ghosted Cartesian velocity field to contravariant face fluxes.
Definition at line 3396 of file setup.c.
| PetscErrorCode SetupDomainCellDecompositionMap | ( | UserCtx * | user | ) |
Implementation of SetupDomainCellDecompositionMap().
Creates and distributes a map of the domain's cell decomposition to all ranks.
Definition at line 3467 of file setup.c.
| PetscErrorCode BinarySearchInt64 | ( | PetscInt | n, |
| const PetscInt64 | arr[], | ||
| PetscInt64 | key, | ||
| PetscBool * | found | ||
| ) |
Implementation of BinarySearchInt64().
Performs a binary search for a key in a sorted array of PetscInt64.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/setup.h.
Definition at line 3532 of file setup.c.
|
static |
Convert logical indices into the flattened global index used by setup helpers.
Definition at line 3575 of file setup.c.
| PetscErrorCode ComputeDivergence | ( | UserCtx * | user | ) |
Implementation of ComputeDivergence().
Computes the discrete divergence of the contravariant velocity field.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/setup.h.
Definition at line 3599 of file setup.c.
| void TransformScalarDerivativesToPhysical | ( | PetscReal | jacobian, |
| Cmpnts | csi_metrics, | ||
| Cmpnts | eta_metrics, | ||
| Cmpnts | zet_metrics, | ||
| PetscReal | dPhi_dcsi, | ||
| PetscReal | dPhi_deta, | ||
| PetscReal | dPhi_dzet, | ||
| Cmpnts * | gradPhi | ||
| ) |
Implementation of TransformScalarDerivativesToPhysical().
Transforms scalar derivatives from computational space to physical space.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/setup.h.
Definition at line 3753 of file setup.c.
|
static |
Transform contravariant vector derivatives into physical Cartesian derivatives.
Definition at line 3777 of file setup.c.
| PetscErrorCode ComputeScalarFieldDerivatives | ( | UserCtx * | user, |
| PetscInt | i, | ||
| PetscInt | j, | ||
| PetscInt | k, | ||
| PetscReal *** | field_data, | ||
| Cmpnts * | grad | ||
| ) |
Implementation of ComputeScalarFieldDerivatives().
Computes the gradient of a cell-centered SCALAR field at a specific grid point.
Definition at line 3799 of file setup.c.
| PetscErrorCode ComputeVectorFieldDerivatives | ( | UserCtx * | user, |
| PetscInt | i, | ||
| PetscInt | j, | ||
| PetscInt | k, | ||
| Cmpnts *** | field_data, | ||
| Cmpnts * | dudx, | ||
| Cmpnts * | dvdx, | ||
| Cmpnts * | dwdx | ||
| ) |
Implementation of ComputeVectorFieldDerivatives().
Computes the derivatives of a cell-centered vector field at a specific grid point.
Definition at line 3842 of file setup.c.
| PetscErrorCode DestroyUserVectors | ( | UserCtx * | user | ) |
Implementation of DestroyUserVectors().
Destroys all PETSc Vec objects within a single UserCtx structure.
Definition at line 3894 of file setup.c.
| PetscErrorCode DestroyUserContext | ( | UserCtx * | user | ) |
Implementation of DestroyUserContext().
Destroys all resources allocated within a single UserCtx structure.
Definition at line 4046 of file setup.c.
| PetscErrorCode FinalizeSimulation | ( | SimCtx * | simCtx | ) |
Implementation of FinalizeSimulation().
Main cleanup function for the entire simulation context.
Full API contract (arguments, ownership, side effects) is documented with the header declaration in include/setup.h.
Definition at line 4137 of file setup.c.
|
static |
| const char picurv_build_stamp[] |