precice / tutorials

Various tutorial cases for the coupling library preCICE with real solvers. These files are meant to be rendered on precice.org, so don't look at the README files here.
https://www.precice.org/
GNU Lesser General Public License v3.0
107 stars 110 forks source link

Fix checkpointing for FEniCS FSI tutorials #50

Open BenjaminRodenberg opened 5 years ago

BenjaminRodenberg commented 5 years ago

Only u_n is considered by the checkpointing. But we should also properly checkpoint v_n and a_n. There is already a prototype implementation on this branch (don't merge this branch, it has a different purpose!)

The most important part is

https://github.com/precice/tutorials/blob/b3b498562255b8a4fb60c785cce4c71a9bd36abc/FSI/cylinderFlap/OpenFOAM-FEniCS/Solid/cyl-flap.py#L238-L243

BenjaminRodenberg commented 5 years ago

Be aware that this bug does not matter, if we do not use subcycling!

BenjaminRodenberg commented 5 years ago

We should first merge https://github.com/precice/fenics-adapter/pull/34, since this makes handling the solver state much easier.

BenjaminRodenberg commented 3 years ago

This issue is still up-to-date.

https://github.com/precice/tutorials/blob/0c3407a553c5df6414fe114585db253626128b7b/perpendicular-flap/solid-fenics/perp-flap.py#L185-L186

should be transferred to something like

 if precice.is_action_required(precice.action_write_iteration_checkpoint()):  # write checkpoint 
    state = (u_n,v_n,a_n) 
    precice.store_checkpoint(state, t, n) 

Same for precice.retreive_checkpoint:

https://github.com/precice/tutorials/blob/0c3407a553c5df6414fe114585db253626128b7b/perpendicular-flap/solid-fenics/perp-flap.py#L215-L216

The commit from the branch mentioned above is heavily outdated, but might still be helpful: https://github.com/precice/tutorials/commit/b3b498562255b8a4fb60c785cce4c71a9bd36abc#diff-e897be07ec33cea9a79328933528b3996749c98b04f78d3dfe69515b489a8780R240-R243

precice-bot commented 8 months ago

This issue has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/fenics-precice-implicit-coupling-with-multiple-fields-in-checkpoint/1806/1

BenjaminRodenberg commented 4 months ago

I performed some experiments with the perpendicular flap case and subcycling for my thesis. This generally works for the current state of the tutorials and the FEniCS adapter. There is one PR that we still need to close https://github.com/precice/fenics-adapter/pull/172. I think we can then also close this issue.

BenjaminRodenberg commented 2 weeks ago

Since this issue has been lying around for quite a while, here is a quick update:

We can close this issue as soon as these PRs have been merged.