The existing regression tests pass no `coefficientFunctions`, so the
coefficients resolve to a uniform conductivity of 1 and a heat source of 0.
Both are then invisible to the result: multiplying by 1 and adding 0 leaves
the assembled system identical to one that never read them. Nothing in the
suite could distinguish correct coefficient handling from none at all.
These two tests assert closed-form solutions rather than stored reference
values, which for a new feature would only record whatever the code produced
when the test was written. Each case is chosen so the finite element solution
is exact at the nodes, giving a tolerance of 1e-10 instead of 1e-4 and
expected values that never need re-deriving when the mesh or element order
changes.
1D covers a uniform source against T = x(1 - x)/2, whose exact solution lies
outside the finite element space and so pins the quadrature of the source
term; the manufactured solution T = x under k = 1 + x and Q = -1 for both
element orders, which pins the Gauss point as the evaluation point; the
frontal assembler against the matrix assembler; and the coefficient
forwarding in `solveAsync`. 2D covers T = x and its rotation T = y, since the
2D assembler is a separate implementation and the 1D path calls the
coefficients with x alone.
Confirmed to have teeth by mutation: swapping x and y in the 2D assembler
moves both 2D cases from 1e-15 to 1e-1, and dropping the coefficients from
the `solveAsync` call site fails the 1D suite.
Refs FEAScript#82
Follows up on #82, on the branch you suggested.
solveAsync coefficient forwarding — solve() passes this.coefficientFunctions to assembleHeatConductionMat; solveAsync() did not, so any model with spatially varying coefficients silently fell back to k = 1, Q = 0 on the async path. One-line fix, matching the call site in solve().
Regression tests — closed-form solutions rather than stored reference values, with each case chosen so the finite element solution is exact at the nodes, allowing a tolerance of 1e-10. 1D covers a uniform source against T = x(1-x)/2, the manufactured solution T = x under k = 1+x, Q = -1 for both element orders, the frontal assembler against the matrix assembler, and the solveAsync forwarding above. 2D covers T = x and its rotation T = y.
Mutations tested against the new tests. Each was applied to src/, the suite run, then reverted. Every one is caught, and every one passes the existing HeatConduction1DWall test, which supplies no coefficientFunctions:
Two notes, both pre-existing on main and out of scope here: