@@ -1089,6 +1089,8 @@ void nonlingeo_precice(double **cop, ITG *nk, ITG **konp, ITG **ipkonp, char **l
10891089 /* Adapter: Create the interfaces and initialize the coupling */
10901090 printf ("About to enter preCICE setup in Calculix with names %s and %s \n" , preciceParticipantName , configFilename );
10911091 Precice_Setup ( configFilename , preciceParticipantName , & simulationData );
1092+ // Initialize for the first step because Precice_IsCouplingTimestepComplete will return false until the end of the first step
1093+ if ( !simulationData .coupling_implicit ) Precice_WriteIterationCheckpoint ( & simulationData , vini );
10921094
10931095 /* Adapter: Give preCICE the control of the time stepping */
10941096 while ( Precice_IsCouplingOngoing () ){
@@ -1114,11 +1116,14 @@ void nonlingeo_precice(double **cop, ITG *nk, ITG **konp, ITG **ipkonp, char **l
11141116
11151117 memcpy (& vini [0 ],& vold [0 ],sizeof (double )* mt * * nk );
11161118
1117- if ( Precice_IsWriteCheckpointRequired () == simulationData . coupling_implicit )
1119+ if ( Precice_IsWriteCheckpointRequired () ) // implicit coupling
11181120 {
11191121 Precice_WriteIterationCheckpoint ( & simulationData , vini );
1120- if ( Precice_IsWriteCheckpointRequired () ) Precice_FulfilledWriteCheckpoint ();
1122+ Precice_FulfilledWriteCheckpoint ();
11211123 }
1124+ if ( Precice_IsCouplingTimestepComplete () && !simulationData .coupling_implicit ) // explicit coupling
1125+ Precice_WriteIterationCheckpoint ( & simulationData , vini );
1126+
11221127
11231128 for (k = 0 ;k < * nboun ;++ k ){xbounini [k ]= xbounact [k ];}
11241129 if ((* ithermal == 1 )|| (* ithermal >=3 )){
0 commit comments