Repository navigation
Conversation
…ared regression module TransientLinearADR<nS> (proteus's LinearVADR_ConstantCoefficients: m = u, f = b u, a = kappa I, r = c u), DiracExact<nS> (the Gaussian of AnalyticalSolutions.LinearADR_Decay_DiracIC with proteus's exponent cut-off) and ExactBC<nS, Exact>, the boundary functor fed by an exact solution's value and gradient at (x, t) in all seven kinds; bindings transient_adr and transient_adr_faces. regression_common.py holds what the steady and the new transient driver share; ad_regression.py uses it. ad_dirac_regression.py steps the engine (backward Euler, one linear solve per step, boundary data at the new time) against the proteus model ad_dirac_p.py / ad_dirac_n.py (BackwardEuler + FixedStep, DT = T / NSTEPS) and the exact solution, with h and dt sweeps. Engine vs proteus at T = 0.3, all seven boundary modes: P1, P2, Q1 in 2D <= 9e-14, 3D samples <= 1.1e-13, once the engine mimics (AD_FIRST_STEP=proteus) how proteus builds the first step's old mass: NumericalSolution.calculateSolution evaluates the residual once more after initialize_dt_model has moved the time to t1, with the strongly imposed Dirichlet dofs set to g(t1), and then stepController.initializeTimeHistory copies that mass into m_last, so the boundary dofs have no time derivative in step one (O(dt^2), boundary-adjacent rows only; later steps are right; the weak-Dirichlet classes are unaffected). The engine's default keeps the true old state. Error against the exact solution: rate 0.9-1.0 in dt, saturating in h. Trap: a _p file must not name anything but the domain x0 or L (proteus reads p.x0 and p.L for its regular mesh); run_proteus asserts the unit domain. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #100 (base
adrh-spaces). Nothing outsideexperimental/adrh/changes.The engine's backward-Euler mass term was already in the kernel; this adds what is needed to run and check it:
TransientLinearADR<nS>(Proteus'sLinearVADR_ConstantCoefficients),DiracExact<nS>(the Gaussian ofAnalyticalSolutions.LinearADR_Decay_DiracIC, verified in #90) andExactBC<nS, Exact>, a boundary functor fed by any exact solution's value and gradient at(x, t)in all seven boundary kinds; bindingstransient_adr/transient_adr_faces; the driverad_dirac_regression.pywith the Proteus modelad_dirac_p.py/ad_dirac_n.py(BackwardEuler+FixedStep,DT = T/NSTEPS); andregression_common.py, which the steady and transient drivers now share.Engine vs Proteus nodal solutions at
T = 0.3, all seven boundary modes: P1, P2, Q1 in 2D (nnup to 65) to<= 9e-14; P1, P2, Q1 samples in 3D to<= 1.1e-13. Against the exact solution the error converges at rate 0.9-1.0 indtand saturates at the time error inh, as backward Euler should.One Proteus behaviour had to be mimicked for that agreement (
AD_FIRST_STEP=proteus, off by default), and it looks like a bug worth a decision: inNumericalSolution.calculateSolution, afterstepController.initialize_dt_model(t0, t1)has moved the time tot1, each level model'sgetResidualruns once more (setting the strongly imposed Dirichlet dofs tog(t1)), and only then doesstepController.initializeTimeHistory()copy that evaluation's mass intoBackwardEuler.m_last. In the first step the eliminated boundary dofs therefore have no time derivative; from the second step onm_lastcomes from the previous step's final evaluation and is right. The effect isO(dt^2), local to the boundary-adjacent rows (1.4e-4 after one step of 0.3 atnn = 17; 5e-8 atdt = 0.3/16,nn = 65), and absent in the weak-Dirichlet classes, which eliminate nothing. Not changed here: a fix moves every transient result with strong Dirichlet data by that amount, goldens included.Also recorded in the regression: a
_pfile must not usex0orLfor anything but the domain (Proteus readsp.x0,p.Lfor its regular mesh);run_proteusnow asserts the mesh spans the unit domain. Design noteADRH_ENGINE_DESIGN.mdsection 18 (beside the campaign notes, not in this repo).🤖 Generated with Claude Code