tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Fix checkpointing for FEniCS FSI tutorials

Open BenjaminRodenberg opened this issue 6 years ago • 6 comments

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 avatar Oct 19 '19 08:10 BenjaminRodenberg

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

BenjaminRodenberg avatar Oct 19 '19 08:10 BenjaminRodenberg

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

BenjaminRodenberg avatar Oct 19 '19 08:10 BenjaminRodenberg

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

BenjaminRodenberg avatar Apr 06 '21 13:04 BenjaminRodenberg

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

precice-bot avatar Feb 29 '24 10:02 precice-bot

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 avatar Jun 27 '24 14:06 BenjaminRodenberg