Skip to content

New tutorial: Partitioned Burgers eq. 1D #670

Open
vidulejs wants to merge 54 commits into
developfrom
partitioned-burgers-1d
Open

New tutorial: Partitioned Burgers eq. 1D #670
vidulejs wants to merge 54 commits into
developfrom
partitioned-burgers-1d

Conversation

@vidulejs

@vidulejs vidulejs commented Sep 29, 2025

Copy link
Copy Markdown
Collaborator

New tutorial case: Partitioned Burgers' Equation in 1D solved with SciPy Finite Volume implementation and a Neural Network surrogate model !

  • Fix README.md to comply with the standard
  • How to run surrogate,
  • Improve README.md further
  • Clean up the scripts in base directory
  • What to do with the initial condition generation? Steps are too complex currently
  • How to reproduce the offline model, i.e., training scripts
  • Either remove old .solver-nutils-dgalerkin or fix
  • Read through again https://precice.org/community-contribute-to-precice.html
  • Allow skipping venv setup

Checklist:

  • I added a summary of any user-facing changes (compared to the last release) in the changelog-entries/<PRnumber>.md.
  • I will remember to squash-and-merge, providing a useful summary of the changes of this PR.

@vidulejs vidulejs requested a review from uekerman September 29, 2025 15:15
… in visualize_partitioned_domain.py. Wrap boundary conditions in new class BoundaryWrapper because they are dependent on the solver iterations. Implement implicit Euler (and Jacobian and residual for the root finding iteration. Initialize participants. Zero gradient condition on the outside boundaries.
@vidulejs vidulejs changed the title Partitioned Burgers eq. 1D New tutorial: Partitioned Burgers eq. 1D Oct 1, 2025
…-surrogate.sh, generate-training-data.sh. Fix floating point issue in t_index. Add --savefile argument to solver-scipy-fvolumes.py to save data for training.
…n scripts. Fix requirements.txt for scipy and surrogate solvers. Add example images for README
…ipt to check for initial conditions after installing environment.
@vidulejs vidulejs marked this pull request as ready for review October 15, 2025 13:04

@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 very nice addition already! I only had brief look in this first iteration and did not yet try to run things. Please see comments below.

Let's indeed remove the Nutils solver. Could always be added later again.

Comment thread partitioned-burgers-1d/README.md Outdated
Comment thread partitioned-burgers-1d/README.md Outdated
Comment thread partitioned-burgers-1d/README.md Outdated
Comment thread partitioned-burgers-1d/README.md Outdated
Comment thread partitioned-burgers-1d/README.md Outdated
Comment thread partitioned-burgers-1d/solver-scipy/solver.py Outdated
Comment thread partitioned-burgers-1d/precice-config.xml Outdated
Comment thread partitioned-burgers-1d/neumann-surrogate/run.sh Outdated
Comment thread partitioned-burgers-1d/neumann-surrogate/clean.sh Outdated
Comment thread partitioned-burgers-1d/clean.sh Outdated
Comment thread partitioned-burgers-1d/README.md Outdated

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

I was able to run the cases and got meaningful results. We are probably close to merging this. Mainly cosmetics now.

I think a few scripts of utils could go into solver-scipy. Only keep those in utils that are used by neumann-surrogate as well.

Comment thread changelog-entries/670.md Outdated
Comment thread partitioned-burgers-1d/README.md Outdated
Comment thread partitioned-burgers-1d/README.md Outdated
Comment thread partitioned-burgers-1d/README.md Outdated
Comment thread partitioned-burgers-1d/README.md Outdated
Comment thread partitioned-burgers-1d/README.md Outdated
Comment thread partitioned-burgers-1d/README.md Outdated
Comment thread partitioned-burgers-1d/README.md Outdated
Comment thread partitioned-burgers-1d/neumann-surrogate/requirements.txt Outdated
Comment thread partitioned-burgers-1d/README.md Outdated
@vidulejs vidulejs requested review from MakisH and uekerman February 20, 2026 20:08

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

Some first comments on the structure/scripts - I will continue later.

After relaxing the requirements.txt, I could install and run all participant options and the post-processing scripts.

Comment thread partitioned-burgers-1d/solver-scipy/requirements.txt Outdated
Comment thread partitioned-burgers-1d/solver-scipy/run.sh Outdated
Comment thread tools/cleaning-tools.sh Outdated
Comment thread partitioned-burgers-1d/utils/generate-training-data.sh
Comment thread changelog-entries/670.md Outdated
Comment thread partitioned-burgers-1d/dirichlet-scipy/run.sh Outdated

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.

These files could be named/described in the README.md, as well as how they are generated. I think this is half-way there already.

Comment thread partitioned-burgers-1d/utils/run-partitioned-surrogate.sh Outdated
Comment thread partitioned-burgers-1d/clean-tutorial.sh
`visualize_partitioned_domain.py` generates plots comparing the partitioned and monolithic solutions. You can specify which timestep to plot. Call from the root of the tutorial:

```bash
python3 utils/visualize_partitioned_domain.py --neumann neumann-surrogate/surrogate.npz [timestep]

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.

An example would be useful here, I am not sure if I should add an integer here and what good values would be.

Similarly in other places.

Comment thread partitioned-burgers-1d/README.md Outdated
@MakisH

MakisH commented May 8, 2026

Copy link
Copy Markdown
Member

@vidulejs it would be great to be able to include this in the upcoming distribution release. With a quick look, I think that most/all of the open points here are rather easy to resolve.

Let me know if I can help; I could also resolve some of these (but not all) directly.

@MakisH

MakisH commented Jun 11, 2026

Copy link
Copy Markdown
Member

@vidulejs I applied as much of the feedback as I could. Only a few comments are still missing:

It would be great if you could quickly add these comments, so that we can finally get this one merged and published.

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