Theory & formulation
What is solved, written down.
An open-source program can be read; that is not the same as being documented. This page states the equations behind each analysis type of KATAI 2D and the numerical methods used to solve them, with the verification case that pins each one. The constitutive laws have their own page; the archived Scientific Manual is at its DOI.
1
Effective stress and equilibrium
Soil is treated as a porous skeleton saturated by water. Following Terzaghi, the skeleton deforms in response to the effective stress — the total stress less the pore pressure — and the constitutive law relates effective stress to strain:
The initial state is established either by the K0 procedure, which sets σ′h = K0 σ′v from the weight of the overburden and generates no displacement, or by gravity loading for ground whose surface or layering is not horizontal. For a submerged block the K0 state satisfies equilibrium to a residual of about 5×10−13 kPa (KV-NUM-003); in axisymmetry the identity holds to 8×10−13 on 15-node elements (KV-CST-013).
2
Finite element discretisation
The weak form of equilibrium, with displacements interpolated from nodal values, gives the discrete balance of internal and external forces:
Elements are isoparametric triangles with six nodes (quadratic displacement) or fifteen (quartic). In plane strain the strain vector is [εxx, εyy, γxy] with εzz = 0. In axisymmetry the model is the r–z half-section, the hoop strain is carried and every integral is weighted by the radius:
Meshes are generated by Delaunay refinement (Ruppert 1995) with a minimum-angle bound of 20°, below the ≈20.7° limit for which the algorithm is guaranteed to terminate. Structural elements — plates, anchors, geogrids, embedded beams — are line elements whose nodes coincide with those of the continuum mesh, and interfaces are zero-thickness elements with a Coulomb strength.
The linear systems are solved by sparse direct factorisation. The released binaries use the vendored Eigen library and contain no proprietary component; a build from source can use Intel oneMKL PARDISO instead. Every backend is checked against a dense LU factorisation on a code path that shares nothing with it: 4.4×10−16 (KV-NUM-002).
3
Nonlinear solution
The load of a phase is applied in increments, and each increment is iterated to equilibrium by Newton’s method:
- Stress integration. At every stress point the constitutive law is integrated over the strain increment by return mapping, with the increment subdivided under an error tolerance so that stress-dependent moduli are re-evaluated within the step. The tolerance is a per-phase input and is stored with the result. Before this was done, the Hardening Soil answer moved by 2.9 percentage points with the number of load steps; it now moves by 0.020% (KV-NUM-009).
- Line search. A step that would increase the out-of-balance force is shortened. Where a monotone search stalls on a well-supported model, the increment is retried with a non-monotone window before it is cut back.
- An honest ending. If no step along the Newton direction reduces the residual, the run stops and says stalled line search; it says mechanism only when the stiffness parameter confirms one. The distinction is tested (KV-NUM-012): a stalled search published as a bearing capacity is a wrong answer that looks like a result.
4
Convergence criteria
An increment is accepted when a family of errors is below the tolerated error, not one:
Both are computed, both are applied, and a results file records which were met and how many stress points were inaccurate. With only the global criterion enforced, the two measures differ by a factor of 63 000 on the verification case; with both, settlements agree to 0.0048% (KV-NUM-013).
5
Staged construction
A phase changes the configuration — clusters and members switched on or off, loads, water, prescribed displacements — and the out-of-balance force between the old configuration and the new one is applied in steps:
For a linear material the response must be exactly proportional to the multiplier, and a stage taken in two halves must arrive where the single stage does; both hold to 10−12 (KV-EXC-002). Removing a soil cluster removes its weight and its stress; the heave of an excavated floor matches the closed form to +0.0% (KV-EXC-001).
6
Consolidation and coupled flow–deformation
Equilibrium of the mixture is coupled to continuity of the pore fluid (Biot 1941):
Displacement and pore pressure are discretised in space and the system is integrated in time by the backward Euler scheme, which is unconditionally stable. In semi-discrete form,
The scheme is first-order accurate, and the order is measured rather than assumed: time refinement of the Terzaghi column gives an observed order of 0.985 and 0.992 on two triplets of step sizes, and a grid-convergence band of ±0.25% on the file’s own 120 steps that contains the actual error of 0.20% (KV-NUM-010). A phase may also march until a target is reached; the stop time is then within +1.45% of the closed form, an error that halves with each doubling of the steps per logarithmic level (KV-CON-003).
The fully coupled phase type solves the same pair of equations together with the groundwater flow of the phase; in the saturated limit it reproduces the consolidation phase to +0.00000% (KV-STR-008).
7
Groundwater flow
In unconfined flow the free surface is found as part of the solution. On a potential seepage face the boundary condition is itself unknown — zero pressure where water exits, no flow where it does not — and is resolved iteratively. The check that the result is a solution is the global mass balance: 8×10−14 on the Charny dam, where the discharge is within +1.02% of the exact value (KV-FLW-001).
Wells and drains are line conditions on discharge or head; a barrier across the flow is an interface that is impermeable or carries a hydraulic resistance. Each has its own closed-form check (KV-FLW-002, -003, -004).
8
Strength reduction
The factor is located by a bracketing search on F, each trial being a full elastoplastic equilibrium solve from the same stress state. The search’s own resolution on the verification slope is 6.3×10−4, and within the useful range of tolerated errors the factor is bit-identical: 1.421021 at 10−3, 10−4, 10−6 and 10−8 (KV-NUM-007).
Mesh dependence with non-associated flow. When ψ < φ′ the limit
load of the discrete problem is not unique and the shear band narrows with the
elements. On a nested family of 142, 568 and 2272 elements the factor falls 1.4210 →
1.3867 → 1.3645 (KV-SLP-003). The engine reports this on every such run
(K2D-A005).
9
Dynamics
A uniform layer on rigid rock driven at its fundamental frequency f1 = Vs/4H reaches the closed-form surface amplitude to −0.6% in displacement and −0.2% in acceleration (KV-DYN-002). The response spectrum of a computed or recorded motion is the peak response of a damped single-degree-of-freedom oscillator as a function of its period; for the El Centro 1940 record shipped with the suite the peak spectral amplification is 2.87 at 0.19 s, inside the published band (KV-DYN-003).
10
How far is a computed number from the exact solution of its own equations?
“+1.4% against Davis & Booker on a 0.5 m mesh” hides a question a reviewer is entitled to ask: how much of that 1.4% is the model, and how much is the mesh? A deviation that shrinks under refinement is discretisation; one that does not is the formulation, the domain size or the reference. KATAI 2D separates them with the procedure the verification literature has standardised (Roache 1994; Celik et al. 2008; ASME V&V 20), built into the engine. From three systematically refined solutions φ1 (finest), φ2, φ3 with cell sizes h1 < h2 < h3:
The implementation is verified on triplets manufactured from φ = φexact + C hp: the order and the extrapolated value come back to 10−14 (KV-NUM-004). Applied to the engine, the procedure produced three findings worth stating, because none is flattering by construction:
- On an elastic strip load the triplet is in the asymptotic range and the extrapolated value is closer to the closed form than the finest mesh (KV-NUM-005).
- For consolidation the refinement axis is the time step, the observed order is 0.99, and the band contains the true error (KV-NUM-010).
- For the Hardening Soil oedometer the mesh is not the axis the error is on — refining it changes the answer by round-off — so no band is published for that case, and the record says why (KV-NUM-009).
The full account is numerical-uncertainty.md in the repository.
11
The verification method
Code verification asks whether a program solves the equations it claims to solve. Three kinds of evidence are admitted in KATAI 2D, and a fourth is explicitly excluded:
- A closed-form solution, stated in full inside the test — not called from the code under test.
- An independent computation path that shares no code with the solver: a dense factorisation against the sparse one, a hand-built equivalent model against the feature.
- A published benchmark, with the primary source and its locator cited.
- Not admitted: self-consistency. The code agreeing with an earlier version of itself is a regression test, not verification.
Each of the 69 cases is declared in a machine-readable block inside the test that asserts it — quantity, source, expected value, tolerance band, oracle class — and the verification matrix and its bibliography are generated from those declarations. A gate in the suite fails the build when the document and the tests disagree, so the published record cannot drift from what is actually checked. The tolerance bands are stated together with the measured deviation: “2%, measured +0.6%” says both how tight the test is and how much margin it has.
The record is reproduced, with sources, on the verification page.
The formulation is public. So is the evidence for it.
KATAI 2D is free under Apache‑2.0, installs in one line and ships the input files of the benchmarks it is verified against. The fastest way to judge it is to rerun one.