Add 1D Allen-Cahn FEniCS playground: SDC order reduction & boundary lifting#636
Add 1D Allen-Cahn FEniCS playground: SDC order reduction & boundary lifting#636
Conversation
Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com> Agent-Logs-Url: https://github.com/Parallel-in-Time/pySDC/sessions/641d9e03-d0b4-45c1-b921-3bce599e14b2
…for clarity Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com> Agent-Logs-Url: https://github.com/Parallel-in-Time/pySDC/sessions/641d9e03-d0b4-45c1-b921-3bce599e14b2
|
@copilot Did you introduce an artificial order reduction by applying the boundary conditions to the accumulated right-hand side in the solver? Is the order reduction gone if you don't do this? |
…in docstrings Co-authored-by: pancetta <7158893+pancetta@users.noreply.github.com> Agent-Logs-Url: https://github.com/Parallel-in-Time/pySDC/sessions/c126ba19-cb8c-4c88-851d-45dea27fd94e
No, the order reduction is not artificial. The previous implementation had a redundant second The key point is that dolfin's If you don't enforce the BCs at all in |
Summary
New playground at
pySDC/playgrounds/FEniCS/allen_cahn_1d/demonstrating SDC order reduction with inhomogeneous time-dependent Dirichlet boundary conditions for the 1D Allen-Cahn equation, and its remedy via boundary lifting. This follows the blueprint of PR #632 (heat equation) but applied to Allen-Cahn.Equation
Exact solution (traveling wave):
$$u(x,t) = \tfrac{1}{2}!\left(1 + \tanh!\left(\frac{x - 0.5 - vt}{\sqrt{2},\varepsilon}\right)\right), \quad v = 3\sqrt{2},\varepsilon,d_w$$
The domain$[0,1]$ is a shift of $[-0.5, 0.5]$ . Boundary conditions are inhomogeneous and time-dependent (exact solution evaluated at $x=0,1$ ).
New playground:
pySDC/playgrounds/FEniCS/allen_cahn_1d/Problem classes (
problem_classes.py)Both classes use an IMEX split with
imex_1st_order_mass: diffusion implicit, nonlinear reaction explicit. Default parameterseps=0.3, dw=-0.04ensure the front is well-resolved and the boundary values vary measurably with time.fenics_allencahn_imex_timebc— naive time-dependent BC imposition:bc.apply(b.values.vector())insidesolve_systemoverwrites boundary DOFs of the accumulated SDC right-hand side with the exact Dirichlet data at the new time, disrupting the sweeper's fixed-point and causing order reduction.fenics_allencahn_imex_timebc_lift— boundary lifting: decomposessolve_systemonly appliesbc_hom(no overwrite), andeval_fincludes the modified explicit forcingConvergence study (
run_convergence.py)Standalone script varying
dtover[0.5, 0.25, 0.125]and comparing estimated convergence orders for both problem classes.Tests (
test_order_reduction.py)All tests are marked
@pytest.mark.fenics.test_allencahn_order_reductiontest_lifting_restores_full_order[M]test_lifting_has_higher_order_than_naiveSecurity Summary
CodeQL found no alerts. No new dependencies were added.