Skip to content

Commit

Permalink
Call configurate() for FMI 1.0 & 2.0 in Co-Simulation (#458)
Browse files Browse the repository at this point in the history
fixes #457
  • Loading branch information
t-sommer authored Jan 18, 2024
1 parent 5a4f957 commit 97c5269
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cosimulation.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ Status configurate(ModelInstance* comp) {
comp->nz = getNumberOfEventIndicators(comp);

if (comp->nz > 0) {
CALL(s_reallocate(comp, (void**)& comp->prez, comp->nz * sizeof(double)));
CALL(s_reallocate(comp, (void**)&comp->prez, comp->nz * sizeof(double)));
CALL(s_reallocate(comp, (void**)&comp->z, comp->nz * sizeof(double)));
}

Expand Down
2 changes: 2 additions & 0 deletions src/fmi1Functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ fmiStatus fmiInitializeSlave(fmiComponent c, fmiReal tStart, fmiBoolean StopTime
instance->stopTime = StopTimeDefined ? tStop : INFINITY;
instance->time = tStart;

configurate(instance);

return init(c);
}

Expand Down
2 changes: 2 additions & 0 deletions src/fmi2Functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ fmi2Status fmi2ExitInitializationMode(fmi2Component c) {

S->state = S->type == ModelExchange ? EventMode : StepComplete;

CALL(configurate(S));

END_FUNCTION();
}

Expand Down

0 comments on commit 97c5269

Please sign in to comment.