|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
A4a focused convective-candidate study (states A-C only). More...
#include "test_support.h"#include "momentumsolvers.h"#include "rhs.h"#include "setup.h"#include "Boundaries.h"#include <petscblaslapack.h>#include <math.h>#include <stdio.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | DofMap |
| struct | SeamDiagnostics |
| struct | GlobalVecStats |
| struct | StableCFLResult |
Macros | |
| #define | HAVE_I(ii) InGhostRange((ii), info.gxs, info.gxm) |
| #define | HAVE_J(jj) InGhostRange((jj), info.gys, info.gym) |
| #define | HAVE_K(kk) InGhostRange((kk), info.gzs, info.gzm) |
| #define | HAVE_I(ii) InGhostRange((ii), info.gxs, info.gxm) |
| #define | HAVE_J(jj) InGhostRange((jj), info.gys, info.gym) |
| #define | HAVE_K(kk) InGhostRange((kk), info.gzs, info.gzm) |
| #define | ROWSUM(cmp) |
Enumerations | |
| enum | StableCFLStatus { STABLE_CFL_NONE , STABLE_CFL_FINITE , STABLE_CFL_EXCEEDS_SCAN } |
| enum | CandState { STATE_A , STATE_A_X , STATE_A_Y , STATE_B , STATE_C } |
| enum | PMetric { METRIC_RHO , METRIC_NORM } |
| enum | ResidualStage { STAGE_UCAT = 0 , STAGE_CART_RESID = 1 , STAGE_RCT = 2 , STAGE_FINAL = 3 } |
Functions | |
| static PetscInt | PeriodicRepCount (PetscInt npts) |
| Returns the number of independent periodic representatives in one direction. | |
| static PetscInt | DofMapExpectedCount (DMDALocalInfo info) |
| Counts all independent component-staggered representatives used by ComputeRHS. | |
| static PetscErrorCode | DofMapBuild (UserCtx *user, DofMap *map) |
| Builds the serial periodic independent face-DOF map used by dense Jacobians. | |
| static PetscErrorCode | DofMapBuildOwned (UserCtx *user, DofMap *map) |
| Builds the rank-owned periodic independent face-DOF map for MPI checks. | |
| static PetscErrorCode | DofMapDestroy (DofMap *map) |
| Releases storage owned by an active-DOF map. | |
| static PetscReal | CmpGet (Cmpnts c, PetscInt comp) |
| static PetscErrorCode | EvalConvResidual (UserCtx *user, Vec Ucont_in, Vec Rhs, const DofMap *map, PetscReal *Ract) |
| static PetscErrorCode | PerturbDof (UserCtx *user, Vec Ucont, const DofMap *map, PetscInt m, PetscReal delta) |
| static PetscErrorCode | GetDof (UserCtx *user, Vec Ucont, const DofMap *map, PetscInt m, PetscReal *val) |
| Reads one active contravariant component from a global vector. | |
| static PetscReal | PeriodicCellAngle (PetscInt idx, PetscInt npts) |
| Returns the cell-centered periodic angle using duplicated endpoint planes. | |
| static PetscReal | PeriodicFaceAngle (PetscInt idx, PetscInt npts) |
| Returns a face-representative periodic angle for component-staggered Ucont. | |
| static Cmpnts | AnalyticVelocity (CandState st, PetscInt i, PetscInt j, PetscInt k, PetscInt mx, PetscInt my, PetscInt mz) |
| Evaluates one of the three analytic Cartesian candidate states. | |
| static Cmpnts | DirectUcontVelocity (CandState st, PetscInt i, PetscInt j, PetscInt k, PetscInt mx, PetscInt my, PetscInt mz) |
| Evaluates the declared direct component-staggered State B Ucont field. | |
| static PetscReal | CmpDiffInf (Cmpnts a, Cmpnts b) |
| Computes the componentwise infinity norm of the difference between two vectors. | |
| static PetscErrorCode | ComputeDeclaredSeamMismatch (CandState st, DMDALocalInfo info, PetscReal seam[3]) |
| Computes analytic periodic seam mismatches for each coordinate direction. | |
| static PetscBool | InGhostRange (PetscInt idx, PetscInt lo, PetscInt n) |
| Reports whether a global index is present in a rank's local ghosted range. | |
| static PetscErrorCode | ComputeLocalDuplicateMismatch (UserCtx *user, Vec local, PetscReal seam[3]) |
| Computes duplicate-plane mismatch in a local vector view. | |
| static PetscErrorCode | ComputeLocalOuterGhostMismatch (UserCtx *user, Vec local, PetscReal seam[3]) |
| Computes outer periodic ghost mismatch for local Ucat. | |
| static PetscErrorCode | ConfigureCandidateFixture (SimCtx *simCtx, UserCtx *user) |
| Configures the minimal context for centered inviscid periodic convection tests. | |
| static PetscErrorCode | SetUcatField (UserCtx *user, CandState st) |
| static PetscErrorCode | SetDirectUcontField (UserCtx *user, CandState st) |
| Sets the direct State B component-staggered Ucont field on owned entries. | |
| static PetscErrorCode | ComputeMaxDiscreteDivergence (UserCtx *user, PetscReal *maxdiv) |
| Computes max discrete divergence of the current local Ucont field. | |
| static PetscErrorCode | BuildBaseState (UserCtx *user, CandState st, Vec Ubase, PetscReal *repeat_inf, PetscReal *maxdiv, SeamDiagnostics *seam) |
| static PetscErrorCode | ComputeMaxGradientContribution (UserCtx *user, PetscReal *gradmax) |
| Computes the global maximum Cartesian velocity-gradient row-sum used by Candidate D. | |
| static PetscErrorCode | DenseSpectralRadius (const PetscReal *A, PetscInt n, PetscReal *rho, PetscReal *maxRealPart) |
| static PetscErrorCode | DenseMaxRealRightEigenpair (const PetscReal *A, PetscInt n, PetscReal *lamr, PetscReal *lami, PetscReal *vr_out, PetscReal *vi_out) |
| Extracts the right eigenpair whose eigenvalue has largest real part. | |
| static PetscErrorCode | DenseRKPolynomialSpectralRadius (const PetscReal *J, PetscInt n, PetscReal dtau, PetscReal *rho) |
| Computes the spectral radius of the RK polynomial by applying it to eig(J). | |
| static PetscErrorCode | DenseSigmaMax (const PetscReal *A, PetscInt n, PetscReal *smax, PetscReal *v1) |
| static PetscReal | DenseNonNormality (const PetscReal *A, PetscInt n) |
| static PetscReal | DenseSkewnessDefect (const PetscReal *A, PetscInt n) |
| Computes the normalized Frobenius defect from skew symmetry. | |
| static PetscErrorCode | PrintSpectrumSummary (const char *name, const PetscReal *J, PetscInt n) |
| Prints eigenvalue and norm summary for one dense operator. | |
| static void | DenseMatVec (const PetscReal *J, const PetscReal *x, PetscReal *y, PetscInt n) |
| Applies a dense column-major matrix to an active-space vector. | |
| static void | FillAuditDirection (const DofMap *map, PetscInt kind, PetscReal *x) |
| Fills one deterministic active-space vector used by dense/matrix-free checks. | |
| static PetscErrorCode | AddActiveVector (UserCtx *user, Vec U, const DofMap *map, const PetscReal *x, PetscReal scale) |
| Adds a dense active-space vector into a global contravariant vector. | |
| static PetscErrorCode | DenseShiftIdentity (const PetscReal *A, PetscInt n, PetscReal shift, PetscReal *B) |
| Copies a dense matrix and adds a scalar shift to its diagonal. | |
| static void | MatMul (const PetscReal *A, const PetscReal *B, PetscReal *out, PetscInt n) |
| static PetscErrorCode | RKPolynomial (const PetscReal *J, PetscReal dtau, PetscInt n, PetscReal *P) |
| static PetscErrorCode | AmplificationMetric (const PetscReal *J, PetscInt n, PetscReal dtau, PMetric which, PetscReal *metric) |
| Evaluates either spectral-radius or 2-norm amplification for one pseudo-time step. | |
| static PetscErrorCode | StableCFL (const PetscReal *J, PetscInt n, PetscReal lam, PMetric which, StableCFLResult *result) |
| static const char * | StableCFLStatusText (StableCFLResult r) |
| Returns human-readable text for a stable-CFL search result. | |
| static PetscErrorCode | PrintStableCFLLine (const char *candidate, StableCFLResult eig, StableCFLResult norm) |
| Prints one candidate's eigenvalue and norm stable-CFL statuses. | |
| static void | ApplyP (const PetscReal *P, const PetscReal *x, PetscReal *out, PetscInt n) |
| static PetscErrorCode | PrintFrozenAmplificationTable (const char *title, const PetscReal *J, PetscInt n, const PetscReal lams[3], const char *cn[3]) |
| Prints frozen RK amplification tables for the supplied operator and candidates. | |
| static PetscReal | VecNorm2Array (const PetscReal *x, PetscInt n) |
| Computes the Euclidean norm of a dense vector. | |
| static PetscReal | VecNormInfArray (const PetscReal *x, PetscInt n) |
| Computes the infinity norm of a dense vector. | |
| static PetscReal | DenseFrobenius (const PetscReal *A, PetscInt n) |
| Computes the Frobenius norm of a dense column-major matrix. | |
| static PetscBool | DofTouchesPeriodicRepresentative (const DofMap *map, PetscInt m, DMDALocalInfo info) |
| True if an active representative lies on a plane adjacent to periodic duplicates. | |
| static PetscErrorCode | PrintPeriodicSpaceAudit (UserCtx *user, const DofMap *map) |
| Prints the component-wise periodic storage count actually used by the active map. | |
| static PetscErrorCode | PrintBlockAndSymmetricLocalization (UserCtx *user, const DofMap *map, const PetscReal *J) |
| Prints 3x3 component block norms and localized symmetric rows. | |
| static void | FillStaggeredFourierBasis (const DofMap *map, PetscInt wx, PetscInt wy, PetscInt wz, PetscReal *Q) |
| Fills the six real basis vectors for one staggered same-wavevector subspace. | |
| static PetscErrorCode | StaggeredFourierSymbol (const DofMap *map, const PetscReal *J, PetscInt wx, PetscInt wy, PetscInt wz, PetscReal A6[36], PetscReal *leak) |
| Builds the 6x6 projected real symbol and leakage for one wavevector. | |
| static PetscErrorCode | SymbolEigenSummary (const PetscReal A6[36], PetscReal *maxre, PetscReal wr_out[6], PetscReal wi_out[6]) |
| Eigenvalue summary for a 6x6 real symbol. | |
| static PetscErrorCode | PrintFourierChecks (const DofMap *map, const PetscReal *J) |
| Projects production J on full staggered six-dimensional Fourier subspaces. | |
| static PetscErrorCode | TraceStateAResidualStages (UserCtx *user, Vec Ubase, Vec Rhs, const DofMap *map, const PetscReal *J) |
| Trace observable production residual stages for one deterministic perturbation. | |
| static PetscReal | DenseRelativeDiff (const PetscReal *A, const PetscReal *B, PetscInt n, PetscReal denom_ref) |
| Computes a normalized Frobenius difference between two dense matrices. | |
| static PetscErrorCode | ExtractActiveVector (UserCtx *user, Vec U, const DofMap *map, PetscReal *x) |
| Extracts active-space entries from a global contravariant vector. | |
| static PetscReal | DofWeight (const DofMap *map, PetscInt m) |
| Returns a deterministic checksum weight for an active DOF. | |
| static PetscErrorCode | ActiveStats (const DofMap *map, const PetscReal *x, GlobalVecStats *stats) |
| Computes global active-vector norms and checksum. | |
| static PetscErrorCode | FillDeterministicDirection (UserCtx *user, Vec V, const DofMap *map, PetscReal *x) |
| Fills a globally normalized deterministic active-space perturbation direction. | |
| static PetscErrorCode | FourStage (UserCtx *user, Vec U0full, PetscReal dtau, Vec Rhs, const DofMap *map, PetscReal *Rscratch, Vec Uwork, Vec Uout) |
| static PetscErrorCode | SetAnchoredStage (UserCtx *user, Vec U0full, PetscReal scale, const DofMap *map, const PetscReal *Ract, Vec Ustage) |
| Forms one anchored RK stage state from the base state and active residual. | |
| static PetscErrorCode | BuildStageStates (UserCtx *user, Vec U0full, PetscReal dtau, Vec Rhs, const DofMap *map, PetscReal *Rscratch, Vec Y1, Vec Y2, Vec Y3) |
| Builds the first three anchored RK stage states for a base vector. | |
| static PetscErrorCode | BuildFDJacobian (UserCtx *user, Vec Ucenter, PetscReal epsrel, Vec Rhs, const DofMap *map, PetscReal *Rp, PetscReal *Rm, Vec Uwork, PetscReal *J) |
| Builds a centered finite-difference Jacobian of the production convective residual. | |
| static PetscErrorCode | CheckDenseJacobianAction (UserCtx *user, Vec Ubase, Vec Rhs, Vec Uwork, const DofMap *map, const PetscReal *J, PetscReal epsrel) |
| Verifies that the assembled dense Jacobian has the same action as production FD Jv. | |
| static PetscErrorCode | MatrixFreeJv (UserCtx *user, Vec Ubase, Vec Rhs, const DofMap *map, const PetscReal *v, PetscReal eps, PetscReal *jv) |
| Matrix-free production Jacobian-vector product on the active space. | |
| static PetscReal | DenseAdditivityError (const PetscReal *A, const PetscReal *B, const PetscReal *C, PetscInt n) |
| Normalized Frobenius norm of A - (B+C). | |
| static PetscReal | DenseCommutatorNorm (const PetscReal *A, const PetscReal *B, PetscInt n) |
| Computes C = A*B - B*A and returns its normalized Frobenius norm. | |
| static PetscErrorCode | RunStateADirectionalMechanismAudit (const PetscReal *Jxy, UserCtx *user_xy, Vec Ubase_xy, Vec Rhs_xy, const DofMap *map_xy, PetscReal epsrel) |
| Builds Jx, Jy, Jxy and prints additivity/commutator/eigenpair diagnostics. | |
| static PetscErrorCode | ExtractLocalActiveVector (UserCtx *user, Vec local, const DofMap *map, PetscReal *x) |
| Extract active-space entries from a local vector. | |
| static PetscErrorCode | MapCartesianResidualToRct (UserCtx *user, Vec Rc, Vec Rct) |
| Mirrors ComputeRHS's Cartesian residual -> contravariant local Rct mapping. | |
| static PetscErrorCode | AverageRctToFinalActive (UserCtx *user, Vec Rct, const DofMap *map, PetscReal *out) |
| Mirrors ComputeRHS's final Rct face averaging and active cleanup for P=0/no body force. | |
| static PetscErrorCode | EvalResidualStage (UserCtx *user, Vec Ucont_in, Vec Rhs, const DofMap *map, ResidualStage stage, PetscReal *out) |
| Evaluates one observable/mirrored residual-path stage for a Ucont input. | |
| static PetscErrorCode | BuildStageJacobian (UserCtx *user, Vec Ucenter, PetscReal epsrel, Vec Rhs, const DofMap *map, ResidualStage stage, PetscReal *Rp, PetscReal *Rm, Vec Uwork, PetscReal *J) |
| Builds a finite-difference Jacobian for one residual-path stage. | |
| static PetscErrorCode | RunStateAResidualPathIsolation (UserCtx *user, Vec Ubase, Vec Rhs, Vec Uwork, const DofMap *map, PetscReal epsrel) |
| Prints the stage where positive-real spectrum first appears. | |
| static PetscErrorCode | BuildStageTangent (const PetscReal *J0, const PetscReal *J1, const PetscReal *J2, const PetscReal *J3, PetscReal dtau, PetscInt n, PetscReal *T4) |
| Builds the exact four-stage tangent from stage-dependent Jacobians. | |
| static PetscErrorCode | BuildPhiJacobian (UserCtx *user, Vec Ucenter, PetscReal dtau, Vec Rhs, const DofMap *map, PetscReal *Rscratch, Vec Upert, Vec Ustage, Vec PhiP, Vec PhiM, PetscReal *xp, PetscReal *xm, PetscReal epsrel, PetscReal *JPhi) |
| Builds a finite-difference Jacobian of the complete nonlinear four-stage map. | |
| static PetscErrorCode | RunRKTangentDiagnostics (UserCtx *user, CandState st, Vec Ubase, Vec Rhs, const DofMap *map, PetscReal epsrel, const PetscReal lams[3], const char *cn[3], const PetscReal *J0) |
| Runs stage-dependent RK tangent and direct nonlinear perturbation diagnostics. | |
| static PetscErrorCode | RunState (CandState st, const char *name) |
| static PetscErrorCode | TestStateA (void) |
| Runs the State A candidate harness. | |
| static PetscErrorCode | TestStateB (void) |
| Runs the State B candidate harness. | |
| static PetscErrorCode | TestStateC (void) |
| Runs the State C candidate harness. | |
| static PetscErrorCode | RunStateAGridAuditOne (PetscInt N) |
| Runs one State A grid-size audit case. | |
| static PetscErrorCode | RunStateASplitOne (CandState st, const char *label) |
| Runs one State A transport-direction split. | |
| static PetscErrorCode | TestStateAGridAudit (void) |
| Runs the State A grid-dependence and active-space audit. | |
| static PetscErrorCode | WriteStateADecompReference (GlobalVecStats r0, GlobalVecStats jv, GlobalVecStats phi, const MomStabilityReport *rep) |
| Writes the one-rank State A matrix-free decomposition reference. | |
| static PetscErrorCode | ReadAndCompareStateADecompReference (GlobalVecStats r0, GlobalVecStats jv, GlobalVecStats phi, const MomStabilityReport *rep) |
| Compares a distributed State A matrix-free check against the one-rank reference. | |
| static PetscErrorCode | StateADecompDirectionalCheck (UserCtx *user, Vec Ubase, Vec Rhs, PetscReal lcC, const MomStabilityReport *rep) |
| Runs State A matrix-free residual, Jv, and four-stage MPI decomposition checks. | |
| static PetscErrorCode | RunDecompBaseline (CandState st, const char *name, PetscReal expB, PetscReal expC, PetscReal expD) |
| Runs one decomp baseline and compares scalar estimates with regenerated references. | |
| static PetscErrorCode | TestDecompA (void) |
| Runs the State A decomposition baseline. | |
| static PetscErrorCode | TestDecompB (void) |
| Runs the State B decomposition baseline. | |
| static PetscErrorCode | TestDecompC (void) |
| Runs the State C decomposition baseline. | |
| static PetscErrorCode | ConfigureMPIReferenceOptions (void) |
| Reads optional paired-run MPI reference path and token. | |
| int | main (int argc, char **argv) |
| PETSc entry point for the focused convective-candidate harness. | |
Variables | |
| static char | g_ref_path [PETSC_MAX_PATH_LEN] = "" |
| static char | g_ref_token [128] = "" |
| static PetscBool | g_ref_path_set = PETSC_FALSE |
| static PetscBool | g_ref_token_set = PETSC_FALSE |
A4a focused convective-candidate study (states A-C only).
Builds the finite-difference Jacobian of the ACTUAL production convection-only residual (ComputeRHS with inviscid, P=0, centered, periodic, single block) on a tiny periodic Cartesian grid, then compares the B/C/D estimator candidates against rho(J), sigma_max(J), the exact 4-stage RK matrix polynomial P(z)=1+z+z^2/2+z^3/6+z^4/24, and a direct anchored 4-stage perturbation cross-check. Shadow-only: changes no production default.
States: A uniform divergence-free; B nonzero discrete divergence; C divergence-free shear.
Definition in file test_momentum_convective_candidates.c.
| struct DofMap |
| struct SeamDiagnostics |
Definition at line 28 of file test_momentum_convective_candidates.c.
| Data Fields | ||
|---|---|---|
| PetscReal | declared[3] | |
| PetscReal | ucat_global[3] | |
| PetscReal | ucat_ghost[3] | |
| PetscReal | ucont_global[3] | |
| struct GlobalVecStats |
Definition at line 34 of file test_momentum_convective_candidates.c.
| Data Fields | ||
|---|---|---|
| PetscReal | n2 | |
| PetscReal | ninf | |
| PetscReal | checksum | |
| struct StableCFLResult |
Definition at line 48 of file test_momentum_convective_candidates.c.
| Data Fields | ||
|---|---|---|
| StableCFLStatus | status | |
| PetscReal | cfl | |
| #define HAVE_I | ( | ii | ) | InGhostRange((ii), info.gxs, info.gxm) |
| #define HAVE_J | ( | jj | ) | InGhostRange((jj), info.gys, info.gym) |
| #define HAVE_K | ( | kk | ) | InGhostRange((kk), info.gzs, info.gzm) |
| #define HAVE_I | ( | ii | ) | InGhostRange((ii), info.gxs, info.gxm) |
| #define HAVE_J | ( | jj | ) | InGhostRange((jj), info.gys, info.gym) |
| #define HAVE_K | ( | kk | ) | InGhostRange((kk), info.gzs, info.gzm) |
| #define ROWSUM | ( | cmp | ) |
| enum StableCFLStatus |
| Enumerator | |
|---|---|
| STABLE_CFL_NONE | |
| STABLE_CFL_FINITE | |
| STABLE_CFL_EXCEEDS_SCAN | |
Definition at line 41 of file test_momentum_convective_candidates.c.
| enum CandState |
| Enumerator | |
|---|---|
| STATE_A | |
| STATE_A_X | |
| STATE_A_Y | |
| STATE_B | |
| STATE_C | |
Definition at line 179 of file test_momentum_convective_candidates.c.
| enum PMetric |
| Enumerator | |
|---|---|
| METRIC_RHO | |
| METRIC_NORM | |
Definition at line 801 of file test_momentum_convective_candidates.c.
| enum ResidualStage |
| Enumerator | |
|---|---|
| STAGE_UCAT | |
| STAGE_CART_RESID | |
| STAGE_RCT | |
| STAGE_FINAL | |
Definition at line 1650 of file test_momentum_convective_candidates.c.
|
inlinestatic |
Returns the number of independent periodic representatives in one direction.
Definition at line 56 of file test_momentum_convective_candidates.c.
|
inlinestatic |
Counts all independent component-staggered representatives used by ComputeRHS.
Definition at line 61 of file test_momentum_convective_candidates.c.
Builds the serial periodic independent face-DOF map used by dense Jacobians.
Production periodic synchronization copies global plane 0 from mx-2 and plane mx-1 from 1 (and analogously in y/z), so representatives 1..m-2 contain each independent component-staggered Ucont face DOF exactly once. Perturbations only touch these reps; EvalConvResidual() then calls SynchronizePeriodicStaggeredFields() to update duplicates.
Definition at line 74 of file test_momentum_convective_candidates.c.
Builds the rank-owned periodic independent face-DOF map for MPI checks.
Definition at line 99 of file test_momentum_convective_candidates.c.
|
static |
|
inlinestatic |
Definition at line 130 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 135 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 153 of file test_momentum_convective_candidates.c.
|
static |
Reads one active contravariant component from a global vector.
Definition at line 166 of file test_momentum_convective_candidates.c.
|
inlinestatic |
Returns the cell-centered periodic angle using duplicated endpoint planes.
Definition at line 184 of file test_momentum_convective_candidates.c.
|
inlinestatic |
Returns a face-representative periodic angle for component-staggered Ucont.
Definition at line 194 of file test_momentum_convective_candidates.c.
|
inlinestatic |
Evaluates one of the three analytic Cartesian candidate states.
Definition at line 206 of file test_momentum_convective_candidates.c.
|
inlinestatic |
Evaluates the declared direct component-staggered State B Ucont field.
Definition at line 230 of file test_momentum_convective_candidates.c.
Computes the componentwise infinity norm of the difference between two vectors.
Definition at line 242 of file test_momentum_convective_candidates.c.
|
static |
Computes analytic periodic seam mismatches for each coordinate direction.
Definition at line 250 of file test_momentum_convective_candidates.c.
|
inlinestatic |
Reports whether a global index is present in a rank's local ghosted range.
Definition at line 299 of file test_momentum_convective_candidates.c.
|
static |
Computes duplicate-plane mismatch in a local vector view.
Definition at line 305 of file test_momentum_convective_candidates.c.
|
static |
Computes outer periodic ghost mismatch for local Ucat.
Definition at line 352 of file test_momentum_convective_candidates.c.
Configures the minimal context for centered inviscid periodic convection tests.
Definition at line 399 of file test_momentum_convective_candidates.c.
Definition at line 414 of file test_momentum_convective_candidates.c.
Sets the direct State B component-staggered Ucont field on owned entries.
Definition at line 434 of file test_momentum_convective_candidates.c.
|
static |
Computes max discrete divergence of the current local Ucont field.
Definition at line 453 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 479 of file test_momentum_convective_candidates.c.
|
static |
Computes the global maximum Cartesian velocity-gradient row-sum used by Candidate D.
Definition at line 550 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 600 of file test_momentum_convective_candidates.c.
|
static |
Extracts the right eigenpair whose eigenvalue has largest real part.
For a complex pair, LAPACK stores real and imaginary parts in adjacent columns of VR.
Definition at line 628 of file test_momentum_convective_candidates.c.
|
static |
Computes the spectral radius of the RK polynomial by applying it to eig(J).
Definition at line 660 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 689 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 709 of file test_momentum_convective_candidates.c.
|
static |
Computes the normalized Frobenius defect from skew symmetry.
Definition at line 725 of file test_momentum_convective_candidates.c.
|
static |
Prints eigenvalue and norm summary for one dense operator.
Definition at line 740 of file test_momentum_convective_candidates.c.
|
static |
Applies a dense column-major matrix to an active-space vector.
Definition at line 1440 of file test_momentum_convective_candidates.c.
|
static |
Fills one deterministic active-space vector used by dense/matrix-free checks.
Definition at line 1452 of file test_momentum_convective_candidates.c.
|
static |
Adds a dense active-space vector into a global contravariant vector.
Definition at line 1276 of file test_momentum_convective_candidates.c.
|
static |
Copies a dense matrix and adds a scalar shift to its diagonal.
Definition at line 761 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 770 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 781 of file test_momentum_convective_candidates.c.
|
static |
Evaluates either spectral-radius or 2-norm amplification for one pseudo-time step.
Definition at line 806 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 823 of file test_momentum_convective_candidates.c.
|
static |
Returns human-readable text for a stable-CFL search result.
Definition at line 866 of file test_momentum_convective_candidates.c.
|
static |
Prints one candidate's eigenvalue and norm stable-CFL statuses.
Definition at line 876 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 890 of file test_momentum_convective_candidates.c.
|
static |
Prints frozen RK amplification tables for the supplied operator and candidates.
Definition at line 898 of file test_momentum_convective_candidates.c.
|
static |
Computes the Euclidean norm of a dense vector.
Definition at line 929 of file test_momentum_convective_candidates.c.
|
static |
Computes the infinity norm of a dense vector.
Definition at line 939 of file test_momentum_convective_candidates.c.
|
static |
Computes the Frobenius norm of a dense column-major matrix.
Definition at line 949 of file test_momentum_convective_candidates.c.
|
static |
True if an active representative lies on a plane adjacent to periodic duplicates.
Definition at line 959 of file test_momentum_convective_candidates.c.
Prints the component-wise periodic storage count actually used by the active map.
Definition at line 969 of file test_momentum_convective_candidates.c.
|
static |
Prints 3x3 component block norms and localized symmetric rows.
Definition at line 1006 of file test_momentum_convective_candidates.c.
|
static |
Fills the six real basis vectors for one staggered same-wavevector subspace.
Definition at line 1079 of file test_momentum_convective_candidates.c.
|
static |
Builds the 6x6 projected real symbol and leakage for one wavevector.
Definition at line 1105 of file test_momentum_convective_candidates.c.
|
static |
Eigenvalue summary for a 6x6 real symbol.
Definition at line 1138 of file test_momentum_convective_candidates.c.
|
static |
Projects production J on full staggered six-dimensional Fourier subspaces.
Definition at line 1158 of file test_momentum_convective_candidates.c.
|
static |
Trace observable production residual stages for one deterministic perturbation.
Definition at line 1200 of file test_momentum_convective_candidates.c.
|
static |
Computes a normalized Frobenius difference between two dense matrices.
Definition at line 1263 of file test_momentum_convective_candidates.c.
|
static |
Extracts active-space entries from a global contravariant vector.
Definition at line 1293 of file test_momentum_convective_candidates.c.
|
static |
Returns a deterministic checksum weight for an active DOF.
Definition at line 1309 of file test_momentum_convective_candidates.c.
|
static |
Computes global active-vector norms and checksum.
Definition at line 1320 of file test_momentum_convective_candidates.c.
|
static |
Fills a globally normalized deterministic active-space perturbation direction.
Definition at line 1340 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 1363 of file test_momentum_convective_candidates.c.
|
static |
Forms one anchored RK stage state from the base state and active residual.
Definition at line 1387 of file test_momentum_convective_candidates.c.
|
static |
Builds the first three anchored RK stage states for a base vector.
Definition at line 1399 of file test_momentum_convective_candidates.c.
|
static |
Builds a centered finite-difference Jacobian of the production convective residual.
Definition at line 1417 of file test_momentum_convective_candidates.c.
|
static |
Verifies that the assembled dense Jacobian has the same action as production FD Jv.
Definition at line 1472 of file test_momentum_convective_candidates.c.
|
static |
Matrix-free production Jacobian-vector product on the active space.
Definition at line 1518 of file test_momentum_convective_candidates.c.
|
static |
Normalized Frobenius norm of A - (B+C).
Definition at line 1543 of file test_momentum_convective_candidates.c.
|
static |
Computes C = A*B - B*A and returns its normalized Frobenius norm.
Definition at line 1557 of file test_momentum_convective_candidates.c.
|
static |
Builds Jx, Jy, Jxy and prints additivity/commutator/eigenpair diagnostics.
Definition at line 1578 of file test_momentum_convective_candidates.c.
|
static |
Extract active-space entries from a local vector.
Definition at line 1660 of file test_momentum_convective_candidates.c.
|
static |
Mirrors ComputeRHS's Cartesian residual -> contravariant local Rct mapping.
Definition at line 1676 of file test_momentum_convective_candidates.c.
|
static |
Mirrors ComputeRHS's final Rct face averaging and active cleanup for P=0/no body force.
Definition at line 1724 of file test_momentum_convective_candidates.c.
|
static |
Evaluates one observable/mirrored residual-path stage for a Ucont input.
Definition at line 1742 of file test_momentum_convective_candidates.c.
|
static |
Builds a finite-difference Jacobian for one residual-path stage.
Definition at line 1783 of file test_momentum_convective_candidates.c.
|
static |
Prints the stage where positive-real spectrum first appears.
Definition at line 1806 of file test_momentum_convective_candidates.c.
|
static |
Builds the exact four-stage tangent from stage-dependent Jacobians.
Definition at line 1833 of file test_momentum_convective_candidates.c.
|
static |
Builds a finite-difference Jacobian of the complete nonlinear four-stage map.
Definition at line 1864 of file test_momentum_convective_candidates.c.
|
static |
Runs stage-dependent RK tangent and direct nonlinear perturbation diagnostics.
Definition at line 1891 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 2022 of file test_momentum_convective_candidates.c.
|
static |
Runs the State A candidate harness.
Definition at line 2259 of file test_momentum_convective_candidates.c.
|
static |
Runs the State B candidate harness.
Definition at line 2264 of file test_momentum_convective_candidates.c.
|
static |
Runs the State C candidate harness.
Definition at line 2269 of file test_momentum_convective_candidates.c.
|
static |
Runs one State A grid-size audit case.
Definition at line 2274 of file test_momentum_convective_candidates.c.
|
static |
Runs one State A transport-direction split.
Definition at line 2326 of file test_momentum_convective_candidates.c.
|
static |
Runs the State A grid-dependence and active-space audit.
Definition at line 2361 of file test_momentum_convective_candidates.c.
|
static |
Writes the one-rank State A matrix-free decomposition reference.
Definition at line 2382 of file test_momentum_convective_candidates.c.
|
static |
Compares a distributed State A matrix-free check against the one-rank reference.
Definition at line 2411 of file test_momentum_convective_candidates.c.
|
static |
Runs State A matrix-free residual, Jv, and four-stage MPI decomposition checks.
Definition at line 2462 of file test_momentum_convective_candidates.c.
|
static |
Runs one decomp baseline and compares scalar estimates with regenerated references.
Definition at line 2517 of file test_momentum_convective_candidates.c.
|
static |
Runs the State A decomposition baseline.
Definition at line 2571 of file test_momentum_convective_candidates.c.
|
static |
Runs the State B decomposition baseline.
Definition at line 2576 of file test_momentum_convective_candidates.c.
|
static |
Runs the State C decomposition baseline.
Definition at line 2581 of file test_momentum_convective_candidates.c.
|
static |
Reads optional paired-run MPI reference path and token.
Definition at line 2586 of file test_momentum_convective_candidates.c.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
PETSc entry point for the focused convective-candidate harness.
Definition at line 2603 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 36 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 37 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 38 of file test_momentum_convective_candidates.c.
|
static |
Definition at line 39 of file test_momentum_convective_candidates.c.