Skip to content

Add fenicsx and simplified Landlab solvers - #889

Draft
joargu wants to merge 21 commits into
precice:developfrom
joargu:develop
Draft

Add fenicsx and simplified Landlab solvers#889
joargu wants to merge 21 commits into
precice:developfrom
joargu:develop

Conversation

@joargu

@joargu joargu commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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:

erosion_deposition_patterns_fenicsx grass_map_fenicsx soil_thickness_fenicsx

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.

min_soil_depth

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.

grass_limit_combined

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

  • I added a summary of any user-facing changes (compared to the last release) in the changelog-entries/<PRnumber>.md.
  • If I changed requirements.txt files, I regenerated sibling requirements-reference.txt files with python3 tools/releasing/update-requirements-reference.py (pass a path to update only that directory, or --all to refresh everything).

For new tutorials or tutorial cases:

@MakisH
MakisH marked this pull request as draft July 30, 2026 09:43
@MakisH

MakisH commented Jul 30, 2026

Copy link
Copy Markdown
Member

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 uekerman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread wolf-sheep-soil-creep/soil-creep-simplified-landlab/soil_creep.py Outdated
Comment thread wolf-sheep-soil-creep/soil-creep-simplified-landlab/soil_creep.py Outdated
Comment thread wolf-sheep-soil-creep/soil-creep-simplified-landlab/soil_creep.py Outdated
Comment thread wolf-sheep-soil-creep/soil-creep-simplified-landlab/soil_creep.py

@MakisH MakisH left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is still a draft, but I did a first review pass as well. Happy to look over it again later.

Comment thread wolf-sheep-soil-creep/soil-creep-fenicsx/clean.sh
Comment thread wolf-sheep-soil-creep/soil-creep-simplified-landlab/soil_creep.py Outdated
Comment thread wolf-sheep-soil-creep/soil-creep-fenicsx/requirements.txt

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@MakisH

MakisH commented Aug 15, 2026

Copy link
Copy Markdown
Member

FYI: tools/tests/ is now tests/. I recommend updating your branch before adding new tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants