|
OMSimulatorLib
The OMSimulator project is a FMI-based co-simulation environment.
|
#include <Flags.h>
Classes | |
| struct | Flag |
Static Public Member Functions | |
| static Flags & | GetInstance () |
| static oms_status_enu_t | SetCommandLineOption (const std::string &cmd) |
| static bool | AddParametersToCSV () |
| static bool | DefaultModeIsCS () |
| static bool | DeleteTempFiles () |
| static bool | DirectionalDerivatives () |
| static bool | DumpAlgLoops () |
| static bool | EmitEvents () |
| static bool | IgnoreInitialUnknowns () |
| static bool | InputExtrapolation () |
| static bool | ProgressBar () |
| static bool | RealTime () |
| static bool | SkipCSVHeader () |
| static bool | SolverStats () |
| static bool | StripRoot () |
| static bool | SuppressPath () |
| static bool | WallTime () |
| static bool | ZeroNominal () |
| static double | InitialStepSize () |
| static double | MaximumStepSize () |
| static double | MinimumStepSize () |
| static double | StartTime () |
| static double | StopTime () |
| static double | Timeout () |
| static double | Tolerance () |
| static int | CVODEMaxErrTestFails () |
| static int | CVODEMaxNLSFailures () |
| static int | CVODEMaxNLSIterations () |
| static int | CVODEMaxSteps () |
| static oms_alg_solver_enu_t | AlgLoopSolver () |
| static oms_solver_enu_t | MasterAlgorithm () |
| static oms_solver_enu_t | Solver () |
| static std::string | ResultFile () |
| static unsigned int | Intervals () |
| static unsigned int | MaxEventIteration () |
| static unsigned int | MaxLoopIteration () |
| static unsigned int | NumProcs () |
Public Attributes | |
| Flag | FlagFilename {"", "", "", "", "FMU or SSP file to be loaded", re_filename, Flags::Filename, false, false, false} |
| Flag | FlagAddParametersToCSV {"--addParametersToCSV", "", "", "false", "Export parameters to a .csv file", re_bool, nullptr, false, false, false} |
| Flag | FlagAlgLoopSolver {"--algLoopSolver", "", "", "kinsol", "Specifies the loop solver method (fixedpoint, kinsol) used for algebraic loops spanning multiple components.", re_default, nullptr, false, false, false} |
| Flag | FlagClearAllOptions {"--clearAllOptions", "", "", "", "Reset all flags to their default values", re_void, Flags::ClearAllOptions, false, false, false} |
| Flag | FlagCVODEMaxErrTestFails {"--CVODEMaxErrTestFails", "", "", "100", "Maximum number of error test failures for CVODE", re_number, nullptr, false, false, false} |
| Flag | FlagCVODEMaxNLSFailures {"--CVODEMaxNLSFailures", "", "", "100", "Maximum number of nonlinear convergence failures for CVODE", re_number, nullptr, false, false, false} |
| Flag | FlagCVODEMaxNLSIterations {"--CVODEMaxNLSIterations", "", "", "5", "Maximum number of nonlinear solver iterations for CVODE", re_number, nullptr, false, false, false} |
| Flag | FlagCVODEMaxSteps {"--CVODEMaxSteps", "", "", "1000", "Maximum number of steps for CVODE", re_number, nullptr, false, false, false} |
| Flag | FlagDeleteTempFiles {"--deleteTempFiles", "", "", "true", "Delete temporary files as soon as they are no longer needed", re_bool, nullptr, false, false, false} |
| Flag | FlagDirectionalDerivatives {"--directionalDerivatives", "", "", "true", "Use directional derivatives to calculate the Jacobian for algebraic loops", re_bool, nullptr, false, false, false} |
| Flag | FlagDumpAlgLoops {"--dumpAlgLoops", "", "", "false", "Dump information for algebraic loops", re_bool, nullptr, false, false, false} |
| Flag | FlagEmitEvents {"--emitEvents", "", "", "true", "Emit events during simulation", re_bool, nullptr, false, false, false} |
| Flag | FlagHelp {"--help", "-h", "", "", "Display the help text", re_void, Flags::Help, true, false, false} |
| Flag | FlagIgnoreInitialUnknowns {"--ignoreInitialUnknowns", "", "", "false", "Ignore initial unknowns from the modelDescription.xml", re_bool, nullptr, false, false, false} |
| Flag | FlagInitialStepSize {"--initialStepSize", "", "", "1e-6", "Specify the initial step size", re_double, nullptr, false, false, false} |
| Flag | FlagInputExtrapolation {"--inputExtrapolation", "", "", "false", "Enable input extrapolation using derivative information", re_bool, nullptr, false, false, false} |
| Flag | FlagIntervals {"--intervals", "-i", "", "500", "Specify the number of communication points (arg > 1)", re_number, nullptr, false, false, false} |
| Flag | FlagLogFile {"--logFile", "-l", "", "", "Specify the log file (stdout is used if no log file is specified)", re_default, nullptr, false, false, false} |
| Flag | FlagLogLevel {"--logLevel", "", "", "0", "Set the log level (0: default, 1: debug, 2: debug+trace)", re_number, nullptr, false, false, false} |
| Flag | FlagMasterAlgorithm {"--master", "", "", "ma", "Specify the master algorithm (ma)", re_default, nullptr, false, false, false} |
| Flag | FlagMaxEventIteration {"--maxEventIteration", "", "", "100", "Specify the maximum number of iterations for handling a single event", re_number, nullptr, false, false, false} |
| Flag | FlagMaxLoopIteration {"--maxLoopIteration", "", "", "10", "Specify the maximum number of iterations for solving algebraic loops between system-level components. Internal algebraic loops of components are not affected.", re_number, nullptr, false, false, false} |
| Flag | FlagMinimumStepSize {"--minimumStepSize", "", "", "1e-12", "Specify the minimum step size", re_double, nullptr, false, false, false} |
| Flag | FlagMode {"--mode", "-m", "", "me", "Force a certain FMI mode if the FMU provides both cs and me (cs, me)", re_mode, nullptr, false, false, false} |
| Flag | FlagNumProcs {"--numProcs", "-n", "", "1", "Specify the maximum number of processors to use (0=auto, 1=default)", re_number, nullptr, false, false, false} |
| Flag | FlagProgressBar {"--progressBar", "", "", "false", "Show a progress bar for the simulation progress in the terminal", re_bool, nullptr, false, false, false} |
| Flag | FlagRealTime {"--realTime", "", "", "false", "Enable experimental feature for (soft) real-time co-simulation", re_bool, nullptr, false, false, false} |
| Flag | FlagResultFile {"--resultFile", "-r", "", "<default>", "Specify the name of the output result file", re_default, nullptr, false, false, false} |
| Flag | FlagSkipCSVHeader {"--skipCSVHeader", "", "", "true", "Skip exporting the CSV delimiter in the header", re_bool, nullptr, false, false, false} |
| Flag | FlagSolver {"--solver", "", "", "cvode", "Specify the integration method (euler, cvode)", re_solver, nullptr, false, false, false} |
| Flag | FlagSolverStats {"--solverStats", "", "", "false", "Add solver stats to the result file, e.g., step size; not supported for all solvers", re_bool, nullptr, false, false, false} |
| Flag | FlagStartTime {"--startTime", "-s", "", "0", "Specify the start time", re_double, nullptr, false, false, false} |
| Flag | FlagStepSize {"--stepSize", "", "", "1e-3", "Specify the (maximum) step size", re_double, nullptr, false, false, false} |
| Flag | FlagStopTime {"--stopTime", "-t", "", "1", "Specify the stop time", re_double, nullptr, false, false, false} |
| Flag | FlagStripRoot {"--stripRoot", "", "", "false", "Remove the root system prefix from all exported signals", re_bool, nullptr, false, false, false} |
| Flag | FlagSuppressPath {"--suppressPath", "", "", "false", "Suppress path information in info messages; especially useful for testing", re_bool, nullptr, false, false, false} |
| Flag | FlagTempDir {"--tempDir", "", "", ".", "Specify the temporary directory", re_default, nullptr, false, true, false} |
| Flag | FlagTimeout {"--timeout", "", "", "0", "Specify the maximum allowed time in seconds for running a simulation (0 disables)", re_number, nullptr, false, false, false} |
| Flag | FlagTolerance {"--tolerance", "", "", "1e-4", "Specify the relative tolerance", re_double, nullptr, false, false, false} |
| Flag | FlagVersion {"--version", "-v", "", "", "Display version information", re_void, Flags::Version, false, false, false} |
| Flag | FlagWallTime {"--wallTime", "", "", "false", "Add wall time information to the result file", re_bool, nullptr, false, false, false} |
| Flag | FlagWorkingDir {"--workingDir", "", "", ".", "Specify the working directory", re_default, nullptr, false, true, false} |
| Flag | FlagZeroNominal {"--zeroNominal", "", "", "false", "Accept FMUs with invalid nominal values and replace the invalid nominal values with 1.0", re_bool, nullptr, false, false, false} |
Private Member Functions | |
| Flags () | |
| ~Flags () | |
| void | setDefaults () |
| Flags (Flags const &) | |
| not implemented More... | |
| Flags & | operator= (Flags const &) |
| not implemented More... | |
Static Private Member Functions | |
| static oms_status_enu_t | SetFlag (size_t flag_id, const std::string &value) |
| static oms_status_enu_t | ClearAllOptions (const std::string &value) |
| static oms_status_enu_t | Filename (const std::string &value) |
| static oms_status_enu_t | Help (const std::string &value) |
| static oms_status_enu_t | Version (const std::string &value) |
Private Attributes | |
| std::map< std::string, unsigned int > | lookup |
| std::vector< std::string > | files |
| const std::string | re_void = "" |
| const std::string | re_default = ".+" |
| const std::string | re_bool = "(true|false)" |
| const std::string | re_mode = "(me|cs)" |
| const std::string | re_double = "((\\+|-)?[[:digit:]]+)(\\.(([[:digit:]]+)?))?((e|E)((\\+|-)?)[[:digit:]]+)?" |
| const std::string | re_number = "[[:digit:]]+" |
| const std::string | re_filename = ".+(\\.fmu|\\.ssp|\\.lua)" |
| const std::string | re_solver = "(euler|cvode)" |
| std::array< Flag *, 43 > | flags |
|
private |
|
private |
|
private |
not implemented
|
inlinestatic |
|
static |
|
staticprivate |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
staticprivate |
|
static |
|
staticprivate |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
static |
|
private |
|
staticprivate |
|
inlinestatic |
|
static |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
staticprivate |
|
inlinestatic |
|
inlinestatic |
|
private |
| Flag oms::Flags::FlagAddParametersToCSV {"--addParametersToCSV", "", "", "false", "Export parameters to a .csv file", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagAlgLoopSolver {"--algLoopSolver", "", "", "kinsol", "Specifies the loop solver method (fixedpoint, kinsol) used for algebraic loops spanning multiple components.", re_default, nullptr, false, false, false} |
| Flag oms::Flags::FlagClearAllOptions {"--clearAllOptions", "", "", "", "Reset all flags to their default values", re_void, Flags::ClearAllOptions, false, false, false} |
| Flag oms::Flags::FlagCVODEMaxErrTestFails {"--CVODEMaxErrTestFails", "", "", "100", "Maximum number of error test failures for CVODE", re_number, nullptr, false, false, false} |
| Flag oms::Flags::FlagCVODEMaxNLSFailures {"--CVODEMaxNLSFailures", "", "", "100", "Maximum number of nonlinear convergence failures for CVODE", re_number, nullptr, false, false, false} |
| Flag oms::Flags::FlagCVODEMaxNLSIterations {"--CVODEMaxNLSIterations", "", "", "5", "Maximum number of nonlinear solver iterations for CVODE", re_number, nullptr, false, false, false} |
| Flag oms::Flags::FlagCVODEMaxSteps {"--CVODEMaxSteps", "", "", "1000", "Maximum number of steps for CVODE", re_number, nullptr, false, false, false} |
| Flag oms::Flags::FlagDeleteTempFiles {"--deleteTempFiles", "", "", "true", "Delete temporary files as soon as they are no longer needed", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagDirectionalDerivatives {"--directionalDerivatives", "", "", "true", "Use directional derivatives to calculate the Jacobian for algebraic loops", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagDumpAlgLoops {"--dumpAlgLoops", "", "", "false", "Dump information for algebraic loops", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagEmitEvents {"--emitEvents", "", "", "true", "Emit events during simulation", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagFilename {"", "", "", "", "FMU or SSP file to be loaded", re_filename, Flags::Filename, false, false, false} |
| Flag oms::Flags::FlagHelp {"--help", "-h", "", "", "Display the help text", re_void, Flags::Help, true, false, false} |
| Flag oms::Flags::FlagIgnoreInitialUnknowns {"--ignoreInitialUnknowns", "", "", "false", "Ignore initial unknowns from the modelDescription.xml", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagInitialStepSize {"--initialStepSize", "", "", "1e-6", "Specify the initial step size", re_double, nullptr, false, false, false} |
| Flag oms::Flags::FlagInputExtrapolation {"--inputExtrapolation", "", "", "false", "Enable input extrapolation using derivative information", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagIntervals {"--intervals", "-i", "", "500", "Specify the number of communication points (arg > 1)", re_number, nullptr, false, false, false} |
| Flag oms::Flags::FlagLogFile {"--logFile", "-l", "", "", "Specify the log file (stdout is used if no log file is specified)", re_default, nullptr, false, false, false} |
| Flag oms::Flags::FlagLogLevel {"--logLevel", "", "", "0", "Set the log level (0: default, 1: debug, 2: debug+trace)", re_number, nullptr, false, false, false} |
| Flag oms::Flags::FlagMasterAlgorithm {"--master", "", "", "ma", "Specify the master algorithm (ma)", re_default, nullptr, false, false, false} |
| Flag oms::Flags::FlagMaxEventIteration {"--maxEventIteration", "", "", "100", "Specify the maximum number of iterations for handling a single event", re_number, nullptr, false, false, false} |
| Flag oms::Flags::FlagMaxLoopIteration {"--maxLoopIteration", "", "", "10", "Specify the maximum number of iterations for solving algebraic loops between system-level components. Internal algebraic loops of components are not affected.", re_number, nullptr, false, false, false} |
| Flag oms::Flags::FlagMinimumStepSize {"--minimumStepSize", "", "", "1e-12", "Specify the minimum step size", re_double, nullptr, false, false, false} |
| Flag oms::Flags::FlagMode {"--mode", "-m", "", "me", "Force a certain FMI mode if the FMU provides both cs and me (cs, me)", re_mode, nullptr, false, false, false} |
| Flag oms::Flags::FlagNumProcs {"--numProcs", "-n", "", "1", "Specify the maximum number of processors to use (0=auto, 1=default)", re_number, nullptr, false, false, false} |
| Flag oms::Flags::FlagProgressBar {"--progressBar", "", "", "false", "Show a progress bar for the simulation progress in the terminal", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagRealTime {"--realTime", "", "", "false", "Enable experimental feature for (soft) real-time co-simulation", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagResultFile {"--resultFile", "-r", "", "<default>", "Specify the name of the output result file", re_default, nullptr, false, false, false} |
|
private |
| Flag oms::Flags::FlagSkipCSVHeader {"--skipCSVHeader", "", "", "true", "Skip exporting the CSV delimiter in the header", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagSolver {"--solver", "", "", "cvode", "Specify the integration method (euler, cvode)", re_solver, nullptr, false, false, false} |
| Flag oms::Flags::FlagSolverStats {"--solverStats", "", "", "false", "Add solver stats to the result file, e.g., step size; not supported for all solvers", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagStartTime {"--startTime", "-s", "", "0", "Specify the start time", re_double, nullptr, false, false, false} |
| Flag oms::Flags::FlagStepSize {"--stepSize", "", "", "1e-3", "Specify the (maximum) step size", re_double, nullptr, false, false, false} |
| Flag oms::Flags::FlagStopTime {"--stopTime", "-t", "", "1", "Specify the stop time", re_double, nullptr, false, false, false} |
| Flag oms::Flags::FlagStripRoot {"--stripRoot", "", "", "false", "Remove the root system prefix from all exported signals", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagSuppressPath {"--suppressPath", "", "", "false", "Suppress path information in info messages; especially useful for testing", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagTempDir {"--tempDir", "", "", ".", "Specify the temporary directory", re_default, nullptr, false, true, false} |
| Flag oms::Flags::FlagTimeout {"--timeout", "", "", "0", "Specify the maximum allowed time in seconds for running a simulation (0 disables)", re_number, nullptr, false, false, false} |
| Flag oms::Flags::FlagTolerance {"--tolerance", "", "", "1e-4", "Specify the relative tolerance", re_double, nullptr, false, false, false} |
| Flag oms::Flags::FlagVersion {"--version", "-v", "", "", "Display version information", re_void, Flags::Version, false, false, false} |
| Flag oms::Flags::FlagWallTime {"--wallTime", "", "", "false", "Add wall time information to the result file", re_bool, nullptr, false, false, false} |
| Flag oms::Flags::FlagWorkingDir {"--workingDir", "", "", ".", "Specify the working directory", re_default, nullptr, false, true, false} |
| Flag oms::Flags::FlagZeroNominal {"--zeroNominal", "", "", "false", "Accept FMUs with invalid nominal values and replace the invalid nominal values with 1.0", re_bool, nullptr, false, false, false} |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |