May I ask how precice implements that calculix waits for force to be delivered in real time during the calculation, rather than restarting a new calculix every time force is delivered? In other words, how does calculix implement the idea of pausing at the completion of each time step calculation and then restarting the calculation after waiting for a new force?
Similarly to my answer in How does the steering work? - #2 by Makis, the logic of pausing at the completion of each time step is implemented in the preCICE library.
The CalculiX solver calls the Precice_Advance(&simulationData)
function of the CalculiX adapter, which calls the preCICE advance()
. This is currently a blocking operation: the CalculiX participant will wait for the fluid participant to provide new data. Under the hood, the waiting is implemented depending on the communication protocol selected in the configuration (sockets or MPI).
In implicit coupling schemes, a participant may need to go back in time and compute the past few time steps (since the last coupling time window) again. The CalculiX adapter does this by storing copies of the solution fields and reading them again: calculix-adapter/nonlingeo_precice.c at 9057470c6b7018a28895c24c964f65364a7fbd04 · precice/calculix-adapter · GitHub
P.S.: I renamed your topic from “About Calculix adapter”. Please choose descriptive names for new topics and choose a fitting category / tags. I see how choosing a category here was complicated. I put it now into “Using preCICE”, as it is essentially a general question about the preCICE logic, not specific to CalculiX.