@@ -1089,6 +1089,8 @@ void nonlingeo_precice(double **cop, ITG *nk, ITG **konp, ITG **ipkonp, char **l
1089
1089
/* Adapter: Create the interfaces and initialize the coupling */
1090
1090
printf ("About to enter preCICE setup in Calculix with names %s and %s \n" , preciceParticipantName , configFilename );
1091
1091
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 );
1092
1094
1093
1095
/* Adapter: Give preCICE the control of the time stepping */
1094
1096
while ( Precice_IsCouplingOngoing () ){
@@ -1114,11 +1116,14 @@ void nonlingeo_precice(double **cop, ITG *nk, ITG **konp, ITG **ipkonp, char **l
1114
1116
1115
1117
memcpy (& vini [0 ],& vold [0 ],sizeof (double )* mt * * nk );
1116
1118
1117
- if ( Precice_IsWriteCheckpointRequired () == simulationData . coupling_implicit )
1119
+ if ( Precice_IsWriteCheckpointRequired () ) // implicit coupling
1118
1120
{
1119
1121
Precice_WriteIterationCheckpoint ( & simulationData , vini );
1120
- if ( Precice_IsWriteCheckpointRequired () ) Precice_FulfilledWriteCheckpoint ();
1122
+ Precice_FulfilledWriteCheckpoint ();
1121
1123
}
1124
+ if ( Precice_IsCouplingTimestepComplete () && !simulationData .coupling_implicit ) // explicit coupling
1125
+ Precice_WriteIterationCheckpoint ( & simulationData , vini );
1126
+
1122
1127
1123
1128
for (k = 0 ;k < * nboun ;++ k ){xbounini [k ]= xbounact [k ];}
1124
1129
if ((* ithermal == 1 )|| (* ithermal >=3 )){
0 commit comments