Skip to content
This repository was archived by the owner on Jun 24, 2026. It is now read-only.

Commit 8e9b7b1

Browse files
Document the unit test hierarchy in here.
1 parent a00afb2 commit 8e9b7b1

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

TEST_HIERARCHY.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
This is the order in which new units tests for VMEC++ shall be implemented.
2+
When running them, progress in a depth-first manner - make sure all minor steps of a given major step pass before progressing towards the next major step.
3+
4+
1. `//vmecpp/common/vmec_indata` - parsing of input file
5+
2. `//vmecpp/common/sizes` - sizes of arrays
6+
3. `//vmecpp/common/fourier_basis_fast_poloidal` - Fourier basis functions for (inv-)DFTs
7+
4. `//vmecpp/common/fourier_basis_fast_toroidal` - Fourier basis functions for (inv-)DFTs
8+
5. `//vmecpp/vmec/boundaries` - convert the INDATA rbc, …, zbc boundary representation into the VMEC-internal rbcc, …, zbcc format (Ptolemy’s identity)
9+
6. `//vmecpp/vmec/ideal_mhd_model` - go through the forward model step by step
10+
1. `CheckSpectralConstraint` - static computation of the arrays related to the spectral constraint
11+
7. `//vmecpp/vmec/radial_profiles` - evaluation of static radial profiles
12+
8. `//vmecpp/vmec/fourier_geometry` - get an initial guess for the geometry of the flux surfaces by interpolation between the axis and the boundary from the INDATA
13+
9. `//vmecpp/vmec/ideal_mhd_model` - go through the forward model step by step
14+
1. `CheckFourierGeometryToStartWith` - check inputs to inv-DFT - first iteration
15+
2. `CheckInverseFourierTransformGeometry` - checks output of inv-DFT - first iteration
16+
3. `CheckJacobian` - Jacobian calculation - first iteration
17+
4. `CheckMetric` - metric coefficients - first iteration
18+
5. `CheckVolume` - plasma volume (differential and total) - first iteration
19+
6. `CheckContravariantMagneticField` - toroidal current constraint and contravariant B - first iteration
20+
7. `CheckCovariantMagneticField` - covariant magnetic field components - first iteration
21+
8. `CheckTotalPressureAndEnergies` - total pressure, thermal energy, magnetic energy - first iteration
22+
9. `CheckRadialForceBalance` - radial force balance - first iteration
23+
10. `CheckHybridLambdaForce` - hybrid lambda force (covariant B on full-grid) - first iteration
24+
11. `CheckUpdateRadialPreconditioner` - compute preconditioning matrix elements - first iteration
25+
12. `CheckForceNorms` - force normalization - first iteration
26+
13. `CheckConstraintForceMultiplier` - constraint force re-scaling - first iteration
27+
14. All the Nestor tests have to be run here in case of a free-boundary case, since Nestor is executed at this point along the forward model evaluation. - (likely) not in first iteration
28+
1. `//vmecpp/nestor/nestor`
29+
1. `CheckInputsToNestorCall`
30+
2. `//vmecpp/nestor/surface_geometry`
31+
1. `CheckSurfaceGeometry`
32+
3. `//vmecpp/nestor/mgrid_provider`
33+
1. `CheckLoadMGrid`
34+
4. `//vmecpp/nestor/external_magnetic_field`
35+
1. `CheckExternalMagneticField`
36+
5. `//vmecpp/nestor/singular_integrals`
37+
1. `CheckConstants`
38+
2. `CheckCmns`
39+
3. `CheckAnalyt`
40+
This maybe requires swapping `slp`/`slm` and `tlp`/`tlm` in `analyt` when passed to `analysum2`.
41+
6. `//vmecpp/nestor/regularized_integrals`
42+
1. `CheckTanuTanv`
43+
2. `CheckGreenF`
44+
7. `//vmecpp/nestor/laplace_solver`
45+
1. `CheckFourP`
46+
2. `CheckFourISymm`
47+
3. `CheckFourIAccumulateGrpmn`
48+
4. `CheckFourIKvDft`
49+
5. `CheckFourIKuDft`
50+
6. `CheckSolverInputs`
51+
7. `CheckLinearSolver`
52+
8. `//vmecpp/nestor/nestor`
53+
1. `CheckBsqVac`
54+
15. `CheckRBsq` - free-boundary force contribution
55+
16. `CheckAlias` - de-alias constraint force - first iteration
56+
17. `CheckRealspaceForces` - MHD forces on R and Z - first iteration
57+
18. `CheckForwardTransformForces` - forward DFT of forces - first iteration
58+
19. `CheckPhysicalForces` - re-scaled force coefficients - first iteration
59+
20. `CheckInvariantResiduals` - invariant force residuals - first iteration
60+
21. `CheckApplyM1Preconditioner` - apply the m=1 preconditioner - first iteration
61+
22. `CheckAssembleRZPreconditioner` - assemble preconditioning matrix for R and Z - first iteration
62+
23. `CheckApplyPreconditioner` - tri-diagonal solver used to apply radial preconditioner for R and Z - first iteration
63+
24. `CheckPreconditionedResiduals` - preconditioned force residuals - first iteration
64+
10. `//vmecpp/vmec/vmec` - iterative solver
65+
1. `CheckPrintout` - check screen printout quantities, like <M> etc.
66+
2. `CheckEvolve` - evolve Fourier coefficients to next iteration - first iteration
67+
11. `//vmecpp/vmec/ideal_mhd_model` - go through the forward model step by step all tests as above again, but now for second iteration
68+
12. `//vmecpp/vmec/vmec` - iterative solver
69+
1. `CheckEvolve` - evolve Fourier coefficients to next iteration - second iteration
70+
2. `CheckMultigridResult` - run a multi-grid step until convergence - first multi-grid step
71+
3. `CheckInterp` - interpolation to next multi-grid resolution - first to second multi-grid step
72+
13. `//vmecpp/vmec/output_quantities` - final output quantities computation
73+
1. `CheckGatherDataFromThreads` - gather data from multiple threads
74+
2. `CheckBSSRoutineOutputs` - compute remaining metric elements, B_s and cylindrical components of B
75+
3. `CheckLowpassFilterBSubsS` low-pass filtering in tangential Fourier space of covariant B components
76+
4. `CheckExtrapolateBSubsS` - extrapolate B_s onto axis and boundary
77+
5. `CheckJxBOutputContents` - compute quantities that normally end up in the jxbout file
78+
6. `CheckMercierStability` - compute ideal-MHD Mercier stability→ mercier output file
79+
7. `CheckThreed1FirstTable` - first table that appears in the threed1 output file
80+
8. `CheckThreed1GeometricMagneticQuantities` - table on “more geometric and magnetic quantities” in threed1 output file
81+
9. `CheckThreed1Volumetrics` - volumetric quantities that appear in the threed1 file
82+
10. `CheckThreed1Axis` - Fourier coefficients of magnetic axis, as they appear in the threed1 output file
83+
11. `CheckThreed1Betas` - table of beta values in threed1 file
84+
12. `CheckThreed1ShafranovIntegrals` - Shafranov integrals in threed1 output file
85+
13. `CheckWOutFileContents` - main VMEC output file wout

0 commit comments

Comments
 (0)