Skip to main content

AVxcelerate Simulation Framework 2025 R2

simulation_framework::core::lifecycle::IFmuLogic Class Reference

Last update: 16.07.2025

The interface for FMU Logic to be used by an FMU activity. More...

#include <i_fmu_logic.h>

Inheritance diagram for simulation_framework::core::lifecycle::IFmuLogic:

Public Member Functions

virtual void SetupExperiment (double start=0, double stop=0, double tolerance=0)=0
 Call fmi2SetupExperiment
 
virtual void EnterInitialization ()=0
 Call fmi2EnterInitializationMode
 
virtual void ExitInitialization ()=0
 Call fmi2ExitInitializationMode
 
virtual void Setup (double start=0, double stop=0, double tolerance=0)=0
 Call SetupExperiment, EnterInitialization, and ExitInitialization.
 
virtual bool Step (double step_size)=0
 Step the FMU model for given step size by calling fmi2DoStep
 
virtual FmuInOutMap InitInOutMap (std::set< std::string > variable_names)=0
 Use the internal implementation to initialize the inputs or outputs with the correct underlying type.
 
virtual bool Step (double step_size, const FmuInOutMap &input)=0
 Set the fmu inputs and step the FMU model for given step size by calling fmi2DoStep
 
virtual void SetInputs (const FmuInOutMap &inputs)=0
 Set the fmu inputs.
 
virtual FmuInOutMap GetOutputs () const =0
 Get all fmu outputs.
 
virtual void GetOutputs (FmuInOutMap &requested_outputs) const =0
 Get a subset of the fmu outputs.
 

Detailed Description

The interface for FMU Logic to be used by an FMU activity.

An implementation of this class can be used from a high level to control the execution of an FMU. Currently this interface is designed for FMU co-simulation.

Definition at line 25 of file i_fmu_logic.h.

Member Function Documentation

◆ EnterInitialization()

virtual void simulation_framework::core::lifecycle::IFmuLogic::EnterInitialization ( )
pure virtual

Call fmi2EnterInitializationMode

Implemented in simulation_framework::core::lifecycle::FmuLogic.

◆ ExitInitialization()

virtual void simulation_framework::core::lifecycle::IFmuLogic::ExitInitialization ( )
pure virtual

Call fmi2ExitInitializationMode

Implemented in simulation_framework::core::lifecycle::FmuLogic.

◆ GetOutputs() [1/2]

virtual FmuInOutMap simulation_framework::core::lifecycle::IFmuLogic::GetOutputs ( ) const
pure virtual

Get all fmu outputs.

Returns
The map of outputs, where keys are variable name, and the value is the variable value

Implemented in simulation_framework::core::lifecycle::FmuLogic.

◆ GetOutputs() [2/2]

virtual void simulation_framework::core::lifecycle::IFmuLogic::GetOutputs ( FmuInOutMap &  requested_outputs) const
pure virtual

Get a subset of the fmu outputs.

Parameters
[in,out]requested_outputsThe map of requested outputs, whose keys are already set to the requested subset of variables. The values will contain the output variable values.

Implemented in simulation_framework::core::lifecycle::FmuLogic.

◆ InitInOutMap()

virtual FmuInOutMap simulation_framework::core::lifecycle::IFmuLogic::InitInOutMap ( std::set< std::string >  variable_names)
pure virtual

Use the internal implementation to initialize the inputs or outputs with the correct underlying type.

Parameters
variable_namesA set of strings of variable names to initialize
Returns
The map of variables with the values being initialized to the correct std::variant type

Implemented in simulation_framework::core::lifecycle::FmuLogic.

◆ SetInputs()

virtual void simulation_framework::core::lifecycle::IFmuLogic::SetInputs ( const FmuInOutMap &  inputs)
pure virtual

Set the fmu inputs.

Parameters
inputsThe map of inputs to set where keys are variable name, and the value is the variable value

Implemented in simulation_framework::core::lifecycle::FmuLogic.

◆ Setup()

virtual void simulation_framework::core::lifecycle::IFmuLogic::Setup ( double  start = 0,
double  stop = 0,
double  tolerance = 0 
)
pure virtual

Call SetupExperiment, EnterInitialization, and ExitInitialization.

Parameters
startThe fixed initial value of the independent variable
stopThe final value of the independent variable
toleranceThe tolerance when using a numerical integration scheme. Can be ignored for co-simulation.

Implemented in simulation_framework::core::lifecycle::FmuLogic.

◆ SetupExperiment()

virtual void simulation_framework::core::lifecycle::IFmuLogic::SetupExperiment ( double  start = 0,
double  stop = 0,
double  tolerance = 0 
)
pure virtual

Call fmi2SetupExperiment

Parameters
startThe fixed initial value of the independent variable
stopThe final value of the independent variable
toleranceThe tolerance when using a numerical integration scheme. Can be ignored for co-simulation.

Implemented in simulation_framework::core::lifecycle::FmuLogic.

◆ Step() [1/2]

virtual bool simulation_framework::core::lifecycle::IFmuLogic::Step ( double  step_size)
pure virtual

Step the FMU model for given step size by calling fmi2DoStep

Parameters
step_sizeThe update interval of the independent variable
Returns
A boolean value indicating whether the step was successful

Implemented in simulation_framework::core::lifecycle::FmuLogic.

◆ Step() [2/2]

virtual bool simulation_framework::core::lifecycle::IFmuLogic::Step ( double  step_size,
const FmuInOutMap &  input 
)
pure virtual

Set the fmu inputs and step the FMU model for given step size by calling fmi2DoStep

Parameters
step_sizeThe update interval of the independent variable
inputThe map of inputs to set where keys are variable name, and the value is the variable value
Returns
A boolean value indicating whether the step was successful

Implemented in simulation_framework::core::lifecycle::FmuLogic.


The documentation for this class was generated from the following file:

Connect with Ansys