modelica-tools / FMUComplianceChecker

FMI Compliance Checker for validation of FMUs 1.0 and 2.0
BSD 3-Clause "New" or "Revised" License
43 stars 31 forks source link

eventInfo flags ignored during event iteration #17

Open modelica-trac-importer opened 6 years ago

modelica-trac-importer commented 6 years ago

Reported by ottot on 5 Feb 2016 07:59 UTC The compliance checker ignores the nominalsOfContinuousStatesChanged and valuesOfContinuousStatesChanged eventInfo flags except for the last call during event iteration. See the following code:

fmi2_status_t do_event_iteration(fmi2_import_t *fmu, fmi2_event_info_t *eventInfo)
{
    fmi2_status_t fmistatus = fmi2_status_ok;
    eventInfo->newDiscreteStatesNeeded = fmi2_true;
    eventInfo->terminateSimulation     = fmi2_false;
    while (eventInfo->newDiscreteStatesNeeded && !eventInfo->terminateSimulation) {
        fmistatus = fmi2_import_new_discrete_states(fmu, eventInfo);
    }
    return fmistatus;
}

We have the following fragments from the specification.

If valuesOfContinuousStatesChanged = fmi2True then at least one element of the
continuous state vector has changed its value due to the function call.
If no element of the continuous state vector has changed its value, valuesOfContinuousStatesChanged must return fmi2False. [if

The end effect of this is that the compliance checker ignores all nominalsOfContinuousStatesChanged and valuesOfContinuousStatesChanged flags returned from fmi2NewDiscreteStates expect the ones returned from the last call.

Tested with 2.0.1.


Migrated-From: https://trac.fmi-standard.org/ticket/368