Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix checkpointing for FEniCS FSI tutorials #50

Open
BenjaminRodenberg opened this issue Oct 19, 2019 · 6 comments
Open

Fix checkpointing for FEniCS FSI tutorials #50

BenjaminRodenberg opened this issue Oct 19, 2019 · 6 comments
Assignees
Labels

Comments

@BenjaminRodenberg
Copy link
Member

BenjaminRodenberg commented Oct 19, 2019

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

solve(A, u_np1.vector(), b_forces)
a_np1 = project(update_acceleration(u_np1, u_n, v_n, a_n, ufl=False), V)
v_np1 = project(update_velocity(a_np1, u_n, v_n, a_n, ufl=False), V)
t, n, precice_timestep_complete, precice_dt, Forces_x, Forces_y = precice.advance(u_np1, (u_np1, v_np1, a_np1), (u_n, v_n, a_n), t, float(dt), n)

@BenjaminRodenberg
Copy link
Member Author

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

@BenjaminRodenberg BenjaminRodenberg changed the title Fix checkpointinf for FEniCS FSI tutorials Fix checkpointing for FEniCS FSI tutorials Oct 19, 2019
@BenjaminRodenberg
Copy link
Member Author

We should first merge precice/fenics-adapter#34, since this makes handling the solver state much easier.

@BenjaminRodenberg
Copy link
Member Author

This issue is still up-to-date.

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

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:

if precice.is_action_required(precice.action_read_iteration_checkpoint()): # roll back to checkpoint
u_cp, t_cp, n_cp = precice.retrieve_checkpoint()

The commit from the branch mentioned above is heavily outdated, but might still be helpful: b3b4985#diff-e897be07ec33cea9a79328933528b3996749c98b04f78d3dfe69515b489a8780R240-R243

@IshaanDesai IshaanDesai added this to the v202104.2.0 milestone Aug 4, 2021
@BenjaminRodenberg BenjaminRodenberg removed this from the v202102.0 milestone Feb 9, 2022
@precice-bot
Copy link
Collaborator

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
Copy link
Member Author

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 precice/fenics-adapter#172. I think we can then also close this issue.

@BenjaminRodenberg
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants