Saving a Modelica library

The Modelica language specification defines two ways that a library can be saved.  The complete library can be saved as a single Modelica file or it can be mapped to a directory heirarchy.

In Dymola this choice is made when creating a new package by the checkbox at the bottom of the dialog, see below.  If you later decide you want to change how the package is being stored then select the package, go to the Edit menu and select the Attributes option.

Dymola new package dialog

When choosing to save the package in one file, a single Modelica model file will be created that contains all the classes defined in this package.  Whilst this makes the package easy to copy around between computers it is not really suitable for use with revision control systems.

When choosing to save the package as a directory structure what you will get is a directory structure where each class is stored as a separate Modelica model file.  This approach is very good for use with revision control systems because the revision of each individual class within the library can be managed independently.  An example of the structure you might get is shown below for the Modelica Standard Library:

Modelica package as a directory

0 Comments

Leave a reply

Your email address will not be published. Required fields are marked *

*

CONTACT US

Got a question? Just fill in this form and send it to us and we'll get back to you shortly.

Sending

© Copyright 2010-2017 Claytex Services Ltd All Rights Reserved. | Designed by CMA Marketing

Log in with your credentials

Forgot your details?