Skip to content

Commit

Permalink
Remove clockElementIndex parameter from FMI3ActivateModelPartition()
Browse files Browse the repository at this point in the history
  • Loading branch information
t-sommer committed Mar 4, 2022
1 parent c851a67 commit 0f291fc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions examples/scs_synchronous.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ int main(int argc, char* argv[]) {
while (time < 10) {

// Model Partition 1 is active every second
CALL(FMI3ActivateModelPartition(S, vr_inClock1, 0, time));
CALL(FMI3ActivateModelPartition(S, vr_inClock1, time));

// Model Partition 2 is active at 0, 1, 8, and 9
if (time % 8 == 0 || (time - 1) % 8 == 0) {
CALL(FMI3ActivateModelPartition(S, vr_inClock2, 0, time));
CALL(FMI3ActivateModelPartition(S, vr_inClock2, time));
}

if (countdownClocksQualifier[0] == fmi3IntervalChanged) {
CALL(FMI3ActivateModelPartition(S, vr_inClock3, 0, time));
CALL(FMI3ActivateModelPartition(S, vr_inClock3, time));
countdownClocksQualifier[0] = fmi3IntervalUnchanged;
}

Expand Down
6 changes: 3 additions & 3 deletions examples/scs_threaded.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ unsigned __stdcall thr_activateModelPartition(void *args) {
case vr_inClock1: {
logEvent("activateModelPartition calling fmi3ActivateModelPartition (%d)", TA->clockRef);
// No variables to set for this partition
retval = FMI3ActivateModelPartition(S, TA->clockRef, 0, TA->activationTime);
retval = FMI3ActivateModelPartition(S, TA->clockRef, TA->activationTime);
if (retval != fmi3OK) break;
retval = FMI3GetInt32(S, vrOutputs_c1, 2, &outputs_c1[0], 2);
recordVariables2(S->component, TA->activationTime, vr_inClock1);
Expand All @@ -506,7 +506,7 @@ unsigned __stdcall thr_activateModelPartition(void *args) {
// Reset the source for the input again, so it is counted just once
inputs_c2[0] = 0;
if (retval != fmi3OK) break;
retval = FMI3ActivateModelPartition(S, TA->clockRef, 0, TA->activationTime);
retval = FMI3ActivateModelPartition(S, TA->clockRef, TA->activationTime);
if (retval != fmi3OK) break;
retval = FMI3GetInt32(S, vrOutputs_c2, 3, outputs_c2, 3);
recordVariables2(S->component, TA->activationTime, vr_inClock2);
Expand All @@ -515,7 +515,7 @@ unsigned __stdcall thr_activateModelPartition(void *args) {
case vr_inClock3: {
logEvent("activateModelPartition calling fmi3ActivateModelPartition (%d)", TA->clockRef);
// No variables to set for this partition
retval = FMI3ActivateModelPartition(S, TA->clockRef, 0, TA->activationTime);
retval = FMI3ActivateModelPartition(S, TA->clockRef, TA->activationTime);
if (retval != fmi3OK) break;
retval = FMI3GetInt32(S, vrOutputs_c3, 3, outputs_c3, 3);
// Use the output of model part 3 as input for model part 2
Expand Down
1 change: 0 additions & 1 deletion include/FMI3.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ Functions for Scheduled Execution

FMI_STATIC fmi3Status FMI3ActivateModelPartition(FMIInstance *instance,
fmi3ValueReference clockReference,
size_t clockElementIndex,
fmi3Float64 activationTime);

#ifdef __cplusplus
Expand Down
1 change: 0 additions & 1 deletion src/FMI3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,6 @@ fmi3Status FMI3DoStep(FMIInstance *instance,

fmi3Status FMI3ActivateModelPartition(FMIInstance *instance,
fmi3ValueReference clockReference,
size_t clockElementIndex,
fmi3Float64 activationTime) {
CALL_ARGS(ActivateModelPartition,
"clockReference=%u, activationTime=%.16g",
Expand Down

0 comments on commit 0f291fc

Please sign in to comment.