Skip to content

Add fenicsx and simplified Landlab solvers - #889

Merged
MakisH merged 30 commits into
precice:developfrom
joargu:develop
Sep 13, 2026
Merged

MakisH merged 30 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
Comment thread wolf-sheep-soil-creep/soil-creep-fenicsx/soil_creep.py
@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.

@MakisH

MakisH commented Sep 12, 2026

Copy link
Copy Markdown
Member

@joargu the CI is now passing. Let me know once this PR is ready for review.

@joargu
joargu marked this pull request as ready for review September 12, 2026 10:10
Removed alternative run examples for different landlab participants.
@joargu

joargu commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Just submitted a PR for the updated metadata.yaml

@MakisH

MakisH commented Sep 13, 2026

Copy link
Copy Markdown
Member

@joargu the metadata.yaml updates fit here best, since they refer to these changes. It would be easier for me to test as well. I will cherry-pick your commit and close #920.

@MakisH MakisH self-assigned this Sep 13, 2026
@MakisH MakisH mentioned this pull request Sep 13, 2026
7 tasks

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

Structure-wise, this is ready, and the tests run. The preCICE configuration file makes sense, has no issues, and the visualization is up-to-date. The README.md is fine.

Results from running all cases, with FEniCS showing a bit different results, as described (with the thickness having some small differences):

results

I have not looked into the internals of the solver, as I understand that this has already been discussed in detail with @uekerman. In case there are any updates later, just open a follow-up PR.

Comment thread tests/tests.yaml
Comment thread wolf-sheep-soil-creep/README.md Outdated
Comment thread wolf-sheep-soil-creep/README.md Outdated
@MakisH

MakisH commented Sep 13, 2026

Copy link
Copy Markdown
Member

Post-merge todos:

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants