fmi-test-data
Utilities for fetching test data from Modelica's Reference-FMUs repository.
This crate provides easy access to the official Modelica Reference FMUs for testing and validation purposes. It automatically downloads and caches the FMU archive, providing convenient methods to access individual FMUs.
Features
- Automatic Download: Downloads and caches Reference FMUs from the official GitHub repository
- Version Management: Easy upgrade path with centralized version constants (currently v0.0.39)
- FMI Support: Works with both FMI 2.0 and FMI 3.0 standards
- Multiple Access Methods: Load FMUs directly into memory or extract to temporary files
- Archive Exploration: List all available FMUs in the archive
- Integrity Verification: SHA256 checksum validation of downloaded archives
Usage
use ReferenceFmus;
use FmiImport;
#
Available FMUs
The Reference FMUs package includes several test models such as:
- BouncingBall: A simple bouncing ball simulation
- Dahlquist: A test equation for numerical solvers
- VanDerPol: Van der Pol oscillator
- Feedthrough: Simple input/output feedthrough
- Clocks: Clock-based simulation (FMI 3.0)
- And many more...
Use ReferenceFmus::list_available_fmus() to get the complete list.
Version Management
The crate uses version constants for easy upgrades:
use ReferenceFmus;
// Check the current Reference FMUs version
println!;
// Access version constants
println!;
println!;
To upgrade to a newer version, simply update the REF_FMU_VERSION constant in the source code.
Testing
The crate includes comprehensive tests for all functionality:
References
See https://github.com/modelica/Reference-FMUs
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.