Use Dirichlet boundary conditions in 2D heat eq problem #339
+193
−19
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.
The convergence tests have been flakey for a while, and I think I've found the issue.
The 2D heat equation problem is doubly periodic, but I don't think that we're explicitly enforcing the compatibility constraint. The constraint states that the descrete integral of the source terms must be exactly zero (i.e., within machine precision zero). This effectively removes the null space, and chooses a particular solution that we're interested in.
My rough explanation of this is:
T
on a 2D domain, with purely periodic boundaries.T + 14
will also satisfy the equationsAT = b
, then the condition number ofA
would beInf
.There's a few ways to do this:
Since this problem uses
sin
as a source term, we have one more option: use Dirichlet boundary conditions. In this approach, we can set the tendency to zero at the boundary, which also effectively pins the solution.I think the result is that we should see the solution unchanged, but also now stable.
I'm going to trigger CI a bunch of times and see if this fixes the flaky jobs.
(hopefully) closes #283.