Open BenjaminRodenberg opened 3 weeks ago
Before I start working on the TODOs of this PR, I wanted to understand what was going on here since I didn't experience any issues in the partitioned heat tutorial.
To this end, I ran some tutorials with subcycling and did some research about the copy
function.
heat.py
file such that only one participant does subcycling.
It seems like in this tutorial, the checkpointing doesn't affect the solution (or at least not so severely)fenics_dt=precice_dt/5
. The simulation crashed as wellcopy()
?Though in the current dolfin documentation about Function.copy(), the dof are deep copied, but as we use legacy FEniCS this is how the copy function is implemented (when I started looking at the documentation, I haven't considered that the dolfin version FEniCS uses is outdated; that's why I am pointing that out).
So, I think it is necessary to use a copy(deepcopy=true)
with the current state of the adapter.
Since the odd behavior isn't solely restricted to the OpenFOAM-FEniCS perpendicular flap tutorial but also to cases where the FEniCS adapter isn't used at all, my guess would be that there is a bug elsewhere as well.
What do you think?
Since the odd behavior isn't solely restricted to the OpenFOAM-FEniCS perpendicular flap tutorial but also to cases where the FEniCS adapter isn't used at all, my guess would be that there is a bug elsewhere as well.
The OpenFOAM-OpenFOAM failure definitely makes this more confusing. Otherwise I could imagine that something goes wrong in the Python bindings, and hence all Python-based participants produce failures.
I could imagine that you have two independent issues here. Maybe ignoring OpenFOAM for the moment is the more sane strategy.
There seems to be a bug when using checkpointing. I stumbled across this with subcycling:
solid.py
by settingfenics_dt = precice_dt / 10
. Here, OpenFOAM runs into an exception after some time. The vtk files also start to obviously look faulty after some time.Looking at the value of
u_n
in any of these cases shows that we do not correctly load the checkpoint we originally stored. I assume there is some unintended pointer-magic happening. I used the following debugging statements insolid.py
to sample the solution at the tip of the flap:The fixes applied here seem to avoid the error.
There are still some todos: