Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Commit

Permalink
#86: Mering trunk r180-210 to branches/2.0.x for 2.0.3b3 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bengt-Arne Andersson committed Sep 26, 2016
2 parents b6164da + d974be6 commit 0db7ae2
Show file tree
Hide file tree
Showing 13 changed files with 621 additions and 305 deletions.
13 changes: 13 additions & 0 deletions HOW-TO-RELEASE-FMUChecker.txt
@@ -0,0 +1,13 @@
File: HOW-TO-RELEASE-FMUChecker.txt
Instructions for how to release FMI Compliance Checker (FMUChecker) application.

1. Release FMILibrary.
2. Set trunk Compliance Checker svn externals to point to the released FMILibrary.
3. Prepare RELEASE-NOTES-FMUChecker.txt for a new release.
4. Merge changes to the release branch.
5. Create a release tag from the branch.
6. Follow instructions in 'branches/Packaging/FMUChecker_build_all_platforms.sh'
and run the script to build the release.
7. Commit release to
https://svn.fmi-standard.org/fmi/branches/public/Test_FMUs/Compliance-Checker/
8. Join the googlegroup fmi-design and announce the new release.
60 changes: 41 additions & 19 deletions README-FMUChecker.txt
Expand Up @@ -4,6 +4,7 @@ Background information for FMI Compliance Checker (FMUChecker) application.
For build instructions see: BUILD-FMUChecker.txt
Licence information is provided in: LICENCE-FMUChecker.txt
Acknowledgements for used software: ACKNOWLEDGEMENTS-FMUChecker.txt
Instructions for how to make a release: RELEASE-NOTES-FMUChecker.txt

The FMI Compliance Checker is intended for
validation of FMU 1.0 and 2.0 compliance to the standard specification
Expand All @@ -27,10 +28,13 @@ The basic features include:
- for co-simulation FMUs test whether the FMU can be simulated with
fixed communication step size;
- log computed solution to csv result file (comma separated values,
file format is by default compatible with RFC4180, http://www.ietf.org/rfc/rfc4180.txt;
the header contains variable names, first column is time, alternative
field separator may be specified as an option).
- can supply numerical input data to the simulation from an CSV file. Input start values from FMU binary (not XML) will be used in case no input is provided.
file format is by default compatible with RFC4180,
http://www.ietf.org/rfc/rfc4180.txt; the header contains variable names,
first column is time, alternative field separator may be specified as an
option).
- can supply numerical input data to the simulation from an CSV file. Input
start values from FMU binary (not XML) will be used in case no input
is provided.
String inputs are currently not supported. The input file is expected to be
RFC4180 compatible with following modifications:
- The file must be in UTF-8 encoding;
Expand All @@ -54,30 +58,44 @@ Options:

-c <separator> Separator character to be used in CSV output. Default is ','.

-d Print also left limit values at event points to the output file to investigate event behaviour. Default is to only print values after event handling.
-d Print also left limit values at event points to the output
file to investigate event behaviour. Default is to only print
values after event handling.

-e <filename> Error log file name. Default is to use standard error.

-f Print all variables to the output file. Default is to only print outputs.
-f Print all variables to the output file. Default is to only
print outputs.

-h <stepSize> Step size to use in forward Euler. Default is to use
step size based on the number of output points.
-h <stepSize> For ME simulation: Decides step size to use in forward Euler.
For CS simulation: Decides communication step size for the
stepping.
Observe that if a small stepSize is used the number of saved
outputs will still be limited by the number of output points.
Default is to calculated a step size from the number of output
points. See the -n option for how the number of outputs is
set.

-i <infile> Name of the CSV file name with input data.

-l <log level> Log level: 0 - no logging, 1 - fatal errors only,
2 - errors, 3 - warnings, 4 - info, 5 - verbose, 6 - debug.
-l <log level> Log level: 0 - no logging, 1 - fatal errors only, 2 - errors,
3 - warnings, 4 - info, 5 - verbose, 6 - debug.

-m Mangle variable names to avoid quoting (needed for some CSV
importing applications, but not according to the CrossCheck rules).
importing applications, but not according to the CrossCheck
rules).

-n <num_steps> Maximum number of output points. Zero means output
in every step. Default is 500.
-n <numSteps> Maximum number of output points. "-n 0" means output at every
step and the number of outputs are decided by the -h option.
Observe that no interpolation is used, output points are taken
at the steps.
Default is 500.

-o <filename> Simulation result output CSV file name. Default is to use standard output.
-o <filename> Simulation result output CSV file name. Default is to use
standard output.

-s <stopTime> Simulation stop time, default is to use information from
'DefaultExperiment' as specified in the model description XML.
'DefaultExperiment' as specified in the model description XML.

-t <tmp-dir> Temporary dir to use for unpacking the FMU.
Default is to use system-wide directory, e.g., C:\Temp or /tmp.
Expand All @@ -88,17 +106,21 @@ Options:
-k me Check XML and ME simulation.
-k cs Check XML and CS simulation.
Multiple -k options add up.
No -k option: test XML, simulate ME and CS respectively if supported.
No -k option: test XML, simulate ME and CS respectively if
supported.

-x Check XML only. Same as -k xml.

-z <unzip-dir> Do not create and remove temp directory but use the specified one
for unpacking the FMU. The option takes precendence over -t.
-z <unzip-dir> Do not create and remove a temp directory but instead use the
specified one for unpacking the FMU. The option takes
precendence over -t.


Command line examples:

fmuCheck.win32 model.fmu
The checker on win32 platform will process 'model.fmu' with default options.
The checker on win32 platform will process 'model.fmu' with default
options.

fmuCheck.win64 -e log.txt -o result.csv -c , -s 2 -h 1e-3 -l 5 -t . model.fmu
The checker on win64 platform will process "model.fmu". The log
Expand Down
66 changes: 53 additions & 13 deletions RELEASE-NOTES-FMUChecker.txt
@@ -1,6 +1,46 @@
File: REALEASE-NOTES-FMUChecker.txt
Release notes for FMI Compliance Checker (FMUChecker) application.

2016-09-26 Version 2.0.3b3
- Feature updates:
- Support for FMIL 2.0.2b4
- Added an error message if neither of the required XML elements
CoSimulation_StandAlone or CoSimulation_Tool are present in the
Implementation element for 1.0 CS FMUs.
- For ScalarVariable elements with invalid attributes in the XML, the
log message was changed from a warning to an error.

2016-04-28 Version 2.0.3b2
- Bugfixes:
- Fixed 2 bugs where simulating a 1.0 ME FMU did not follow the specified state
machine of calling sequence, specifically:
- Not calling fmiSetIN in the setInputs state
- Calling fmiSetIN in the stepInProgress state instead of fmiSetINC

2016-03-23 Version 2.0.3b1
- Feature updates:
- Variable names are checked to follow the syntax specified in the variable
naming conventions.
- External event check support added for FMI 1.0.
- Improved documentation for the -n <numSteps> and -h <stepSize> options.
- The checker confirms that an FMU contains either a "binaries" or "sources"
folder.
- A warning is logged if input variables have no start values.
- A warning is given if no Capabilities element is found for CS 1.0 FMU.

- Bugfixes:
- All discrete input values in a time step are checked for changes.
- Steps that should be written to output is now written.
- Set time is called at the right time for ME 2.0.
- FMI 1.0 Integer/Enumeration attribute values are no longer overwritten.
- Assert error for empty String variables removed.
- Crash/assert error for empty ModelStructure tag fixed.

2014-12-22 Version 2.0.2b1
- Bugfixes:
- Corrected handling of quoted variable names in input CSV files.
- Fixed unmotivated warning when checking FMI 2.0 ME compliant FMUs.

2014-10-24 Version 2.0.1
- Feature updates:
- Added call to Checker to logfile for improved documentation
Expand All @@ -19,16 +59,16 @@ Release notes for FMI Compliance Checker (FMUChecker) application.
- input calculation for FMI 1.0 and FMI 2.0
- inconsistencies in output file fixed


2014-05-09 Version 2.0b3
- Feature updates:
- Added Support for FMIL 2.0b3 resp. FMI 2.0 RC2. Prior versions
- Added Support for FMIL 2.0b3 resp. FMI 2.0 RC2. Prior versions
(RC1 and below) not supported any more.
- Simultaneous identifiers for ModelExchange and CoSimulation in
- Simultaneous identifiers for ModelExchange and CoSimulation in
2.0 now legal and will both be verified.
- updated model structure output for 2.0 due to new variabilities.


2014-03-10 Version 2.0b2
- Bug fix release:
- Corrected reduced output for the 2.0RC1 FMUs
Expand All @@ -37,18 +77,18 @@ Release notes for FMI Compliance Checker (FMUChecker) application.

2013-12-17 Version 2.0b1
- Feature updates:
- Added Support for FMIL 2.0b1 resp. FMI 2.0 RC1. Prior versions
- Added Support for FMIL 2.0b1 resp. FMI 2.0 RC1. Prior versions
(beta4) not supported any more.
- New event handling for FMU 2.0 in ModelExchange simulation.
- Added support for CSV input files for FMUs in 2.0 standard

2013-06-20 Version 2.0a2
- Feature updates:
- Output format modified:
- CSV files are now RFC 4180 compatible by default (comma is the
- CSV files are now RFC 4180 compatible by default (comma is the
default field separator; CR-LF is used as end of line; variable
names are enclosed in double quotes as needed).
- -m switch is itroduced to support mangling of variable names
- -m switch is itroduced to support mangling of variable names
as needed by CSV importers that don't handle quoting.
- Only variable names are written out in the header line (no
aliasing information is provided).
Expand All @@ -63,9 +103,9 @@ Release notes for FMI Compliance Checker (FMUChecker) application.
the README-FMUChecker.txt.
- Version information printed as a part of the help screen.
- Packaging updates:
- FMI Library is distirbuted as a part of checker's source.
- FMI Library is distirbuted as a part of checker's source.
- Build script supports automatic cross-checking with FMI Library driven by
compliance checker. See information on FMUCHK_FMI_PUBLIC in
compliance checker. See information on FMUCHK_FMI_PUBLIC in
BUILD-FMUChecker.txt for details.
- Updated the header files for FMI 2.0 (still beta4 compatible).

Expand All @@ -74,11 +114,11 @@ Release notes for FMI Compliance Checker (FMUChecker) application.
- Modified and corrected standard header files as proposed in
tickets #86, #87, #88 and #108 at https://trac.fmi-standard.org/
Header files are distributed with the FMU checker.
- Removed fmiGetPartialDerivatives interface function as decided
- Removed fmiGetPartialDerivatives interface function as decided
during the FMI meeting Sep 07, 2012
Note that FMU Checker 2.0a1 supports both FMI 1.0 and 2.0 beta 4
Note that FMU Checker 2.0a1 supports both FMI 1.0 and 2.0 beta 4
specifications and contains a number of bug fixes as compared to the 1.0.2
release. The �alpha� status concerns FMI 2.0 support due to limited testing
release. The �alpha� status concerns FMI 2.0 support due to limited testing
and beta status of the specification.
- Added logging of memory callbacks calls
- The '-z <dir>' switch simplifies debugging for FMU developers
Expand All @@ -97,7 +137,7 @@ Release notes for FMI Compliance Checker (FMUChecker) application.

2012-07-16 Version 1.0.1
- Added output for the simulation start time
- Improved simulation output file header. Alias information
- Improved simulation output file header. Alias information
is now provided as "a=b" or "a=-b" in the first output row.
- Improved readability for a number of log messages

Expand Down
19 changes: 17 additions & 2 deletions include/fmi1_input_reader.h
Expand Up @@ -30,6 +30,9 @@ typedef struct fmi1_csv_input_t {
fmi1_import_variable_list_t* realInputs;
jm_vector(jm_voidp)* realInputData;

/* a subset of realInputs */
fmi1_import_variable_list_t *continuousInputs;

fmi1_import_variable_list_t* intInputs;
jm_vector(jm_voidp)* intInputData;

Expand All @@ -39,10 +42,17 @@ typedef struct fmi1_csv_input_t {
/** interpolation data for doubles. */
/* v[t] = v[i1]*lambda+v[i2](1-lambda) */
double interpTime; /** time instance where the coeff is calculated */
size_t discreteIndex; /** current data element index for discrete inputs */
size_t interpIndex1; /** first data element index for interpolation */
size_t interpIndex2; /** second data element index for interpolation */
double interpLambda; /** interpolation coefficient */
fmi1_real_t* interpData; /** interpolated inputs */
fmi1_real_t* interpContinuousData; /** interpolated continuous inputs */

/*input event check data*/
size_t eventIndex1; /** first data element index for interpolation */
size_t eventIndex2; /** first data element index for interpolation */

} fmi1_csv_input_t;

typedef struct fmu_check_data_t fmu_check_data_t;
Expand All @@ -56,10 +66,15 @@ void fmi1_free_input_data(fmi1_csv_input_t* indata);
/** update the interpolation coefficients inside the input data */
void fmi1_update_input_interpolation(fmi1_csv_input_t* indata, double t);

/** set inputs on the fmu */
/** set continuous inputs on the fmu */
fmi1_status_t fmi1_set_continuous_inputs(fmu_check_data_t* cdata, double time);

/** set all inputs on the fmu */
fmi1_status_t fmi1_set_inputs(fmu_check_data_t* cdata, double time);

/** read input data from the file */
/** read input data from the file */
jm_status_enu_t fmi1_read_input_file( fmu_check_data_t* cdata);

/** check input data interval for event trigger from data */
jm_status_enu_t fmi1_check_external_events(fmi1_real_t tcur, fmi1_real_t tnext, fmi1_event_info_t* eventInfo, fmi1_csv_input_t* indata);
#endif
1 change: 1 addition & 0 deletions include/fmi2_input_reader.h
Expand Up @@ -48,6 +48,7 @@ typedef struct fmi2_csv_input_t {
/** interpolation data for doubles. */
/* v[t] = v[i1]*lambda+v[i2](1-lambda) */
double interpTime; /** time instance where the coeff is calculated */
size_t discreteIndex; /** current data element index for discrete inputs */
size_t interpIndex1; /** first data element index for interpolation */
size_t interpIndex2; /** second data element index for interpolation */
double interpLambda; /** interpolation coefficient */
Expand Down
13 changes: 7 additions & 6 deletions include/fmuChecker.h
Expand Up @@ -88,13 +88,14 @@ struct fmu_check_data_t {
double stepSize;
/** Flag indicating if step size is user defined in command line */
int stepSizeSetByUser;
/** Number of steps to take */
#define DEFAULT_NUM_STEPS 500
#define DEFAULT_NUM_STEPS_STR "500"
#define DEFAULT_MAX_OUTPUT_PTS 500
#define DEFAULT_MAX_OUTPUT_PTS_STR "500"

size_t numSteps;
/** Flag indicating if number of steps is user defined in command line */
int numStepsSetByUser;
/** Maximum number of steps to save to output */
size_t maxOutputPts;
/** Flag indicating if max number of steps is user defined in command line */
int maxOutputPtsSetByUser;
/** Next output time */
double nextOutputTime;
/** Next output step number*/
Expand Down

0 comments on commit 0db7ae2

Please sign in to comment.