-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Checkpointing does not work for subcycling #9
Comments
Thanks for pointing us to this. I guess that this has simply never been implemented. |
Thank you for your reaction Benjamin. This problem can be easily overcome in the calculix input file by specifying: Where the 'direct' keyword forces calculix to use the timestep specified (this should be the precice timestep). |
Doesn't putting write/read checkpoints inside If that is the case, CalculiX sub-cycles by storing states in calculix-adapter/nonlingeo_precice.c Lines 1115 to 1121 in b01641e
calculix-adapter/nonlingeo_precice.c Lines 2664 to 2678 in b01641e
calculix-adapter/nonlingeo_precice.c Lines 1097 to 1099 in b01641e
calculix-adapter/nonlingeo_precice.c Line 2666 in b01641e
read/write simulationData->preciceInterfaces ,calculix-adapter/adapter/PreciceInterface.c Line 162 in b01641e
calculix-adapter/adapter/PreciceInterface.c Line 229 in b01641e
set simulationData->dtheta (to keep calculix within the coupling step),
and increments simulationData->precice_dt (to track progress within a coupling step), respectively.
|
Furthermore, CalculiX's check for sub-cycle convergence is calculix-adapter/nonlingeo_precice.c Lines 2683 to 2725 in b01641e
This controls memcpy between vini and vold (vini is Calculix's sub-cycle "checkpoint") and precice checkpoints are also under this check, making sure precice checkpoints are only read/set when calculix sub-cycles are converged.calculix-adapter/nonlingeo_precice.c Lines 1101 to 1121 in b01641e
calculix-adapter/nonlingeo_precice.c Lines 2628 to 2681 in b01641e
You can see in the blob above that when precice reads a checkpoint, we increment icutb to unset CalculiX's converged state.
|
I assume that the branch https://github.com/precice/calculix-adapter/tree/i9 refers to this issue. Should we still keep it around? Is this issue still relevant? |
I've been toying around to fix this, but this opens new questions. |
Important to ensure here, is that checkpoints should only be written on every coupling time window (and every time a coupling time window is repeated), not every solver time step. When reading a checkpoint, CalculiX should go back to the state of the last coupling time window.
This is something I am not completely sure how it works also in OpenFOAM at the moment. If I remember correctly, results get overwritten, and this is fine.
We could always give a warning (or error) till we fix the actual problem.
I am not sure I understand this point. |
Yes. From what I understood the issue lies mostly in the fact that not sufficient data is saved but since we check that writing checkpoints is required, this should be fine. We mostly need to upgrade to reset correctly the internal time, step number etc, as currently only the DOFs are saved.
I'll have to check if CalculiX can overwrite. Since it's a unique file, I'm not so sure, it's not like you can write many times the file "output_step_37" many times.
Imagine a time window size of 1.0 and an internal step of 0.4.
|
For implicit coupling the writeCheckpoint is called by the function:
Precice_WriteIterationCheckPoint
This function takes the values of the last timestep as checkpoint values. However, for implicit coupled simulations where the calculix is subcycling, the last calculix timestep is not the same as the last coupling timestep. Therefore, the wrong checkpoint is written.
The text was updated successfully, but these errors were encountered: