Add fenicsx and simplified Landlab solvers - #889
Conversation
|
Thank you for the updates, @joargu! Since I see that the PR description is missing and the CI is failing, I marked this as draft. Let me know once you need a review, or if you need any help. |
uekerman
left a comment
There was a problem hiding this comment.
Thanks for the update!
Structure looks good, a few minor comments below. I have not yet run things, but I want to do so once the README is updated.
MakisH
left a comment
There was a problem hiding this comment.
I know this is still a draft, but I did a first review pass as well. Happy to look over it again later.
There was a problem hiding this comment.
self-note: I could not install FEniCSx on my system at the moment. In any case, we should test it on the system tests once the respective entries are there (see the checklist in the PR description).
|
FYI: |
Updated README to include FEniCSx information and clarify output paths for soil-creep visualizations.
Change z to u in diffusion equation comment
I added simplified Landlab and FEniCSx soil-creep participants.
The simplified Landlab implementation is standalone and exposes the inner workings of Landlab for this specific example. It produces the same results as the Landlab implementation without depending on it.
Landlab uses a finite-difference method, while FEniCSx provides a finite-element alternative. The FEniCSx participant solves the same soil-diffusion equation as the Landlab participant, but uses a triangular mesh instead of Landlab's regular grid and backward Euler instead of Landlab's forward Euler time integration.
The Landlab and FEniCSx participants produce similar results with uni-directional coupling, but diverge under bi-directional coupling due to the differences in spatial and temporal discretization. These are the resulting FEniCSx plots, showing the visible differences from Landlab:
The discrepancy is caused by the influence of the soil-creep participant on the grass map in the bidirectional coupling. The grass, which determines the diffusivity of the soil creep, is limited by soil depth from the soil-creep participant based on the minimum soil-depth threshold. If soil depth at a cell is below the threshold, a grass patch that is fully grown will be reset.
Because the Landlab and FEniCSx implementations use different spatial and temporal discretizations, one participant can cross the minimum soil-depth threshold earlier than the other. The grass can therefore be limited in one simulation while remaining fully grown in the other.
Once the grass maps begin to differ, their evolution also diverges because the wolf-sheep-grass ABM participant is stochastic. The grass map starts getting limited in the FEniCSx-coupled simulation once the soil depth falls below the threshold.
After four steps, a fully grown grass patch is reset for the first time, and the Landlab and FEniCSx simulations begin to diverge.
TODO: Summarize and motivate the changes, link to issues, remove the checklist entries that are not relevant.
Checklist
changelog-entries/<PRnumber>.md.requirements.txtfiles, I regenerated siblingrequirements-reference.txtfiles withpython3 tools/releasing/update-requirements-reference.py(pass a path to update only that directory, or--allto refresh everything).For new tutorials or tutorial cases:
README.mdmetadata.yamltests/tests.yaml_config.yaml