Skip to content

State handling in FMUs #34

Description

@ghorwin

FMICodeGenerator should handle and maintain states properly.

With "states", we need to distinguish between a) just regular states and b) integrated continuous variables.

a) This is handled already automatically. Whenever you store a value in any of the data maps

m_boolVar
m_realVar
m_integerVar
m_stringVar

these are stored and maintained in the FMU instance class object from one doStep() call to the next. Also, these states are stored in calls to serializeFMUstate() and restored in deserializeFMUstate(). Even if the master copies the FMU state and stores it into a file and later re-creates the FMU instance and restores data back from external memory - these states are restored as well.

b) support for continues variables is pending - for now a workaround would be to "reuse" the m_realVar map, but for larger fields this would be bad for performance. The plan is to add some integration library (CVODE?) into the code generator and then provide some integration functionality inside the FMU as well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions