Skip to content

Add fenicsx and simplified Landlab solvers - #889

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

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

Conversation

@joargu

@joargu joargu commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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.

self.status[1:-1, 1:-1] = self.CORE

# Have one open boundary on the south side
# rmg.set_closed_boundaries_at_grid_edges(True, True, True, False)

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.

It's often better not to add commented-out code. This will soon be hard to understand.

Comment on lines +24 to +27
# order: right, top, left, bottom
self.status[:, -1] = self.CLOSED
self.status[-1, :] = self.CLOSED
self.status[:, 0] = self.CLOSED

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.

seems like one of the four is missing

for n1, n2 in self.links
])

internal_dt = 0.15 * self.dx * self.dx / np.nanmax(active_D)

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.

What is the 0.15 here? Where does the value come from?

Comment on lines +70 to +71
repeats = int(dt // internal_dt)
remainder = dt - repeats * internal_dt

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.

What are these lines doing? Please add comments.

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

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.

The clean.sh and run.sh scripts are not marked as executable. Mark them with:

chmod +x clean.sh run.sh

(for both case directories)


# Divide the timestep dt passed to the diffuser into internal stability-limited substeps.
# Perform as many full substeps as possible (repeats), followed by one smaller substep for the remainder.
internal_dt = ALPHA * self.dx * self.dx / np.nanmax(active_D)

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 got an error here:

---[precice]  time-window 1, t 0 (max: 100), Dt 2, max-dt 2
Traceback (most recent call last):
  File "/home/gc/repos/precice/tutorials/wolf-sheep-soil-creep/soil-creep-simplified-landlab/soil_creep.py", line 182, in <module>
    diffuser.step(dt)
    ~~~~~~~~~~~~~^^^^
  File "/home/gc/repos/precice/tutorials/wolf-sheep-soil-creep/soil-creep-simplified-landlab/soil_creep.py", line 72, in step
    internal_dt = ALPHA * self.dx * self.dx / np.nanmax(active_D)
                  ^^^^^
NameError: name 'ALPHA' is not defined. Did you mean: 'self.ALPHA'?

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.

Add also (in both requirements.txt) the Python bindings explicitly.
Necessary for the system tests to be able to adjust the pyprecice version.

pyprecice~=3.0

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

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