libSBML C API  libSBML 5.8.0 C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
SBMLUnitsConverter Class Reference

Detailed Description

SBML converter to convert a model's units to SI units.

This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. It is a class used in the implementation of extra functionality provided by libSBML.

This SBML converter converts the units in a model to base SI units, namely metre, kilogram, second, Ampere, Kelvin, mole and candela.

Unit conversion will only be performed on models that are fully unit consistent; that is, all objects have associated units, and there are no literal numbers with no units specified. In the case of an SBML Level 3 model involving math expressions, this means that the timeUnits attribute on the Model object must be set, and if there are any reactions in the model, the extentUnits attribute on the Model object must also be set.

This converter has the additional Boolean property "removeUnusedUnits" that can be used to tell the converter whether to remove any UnitDefinition objects that are not referred to, after conversion is complete. You can set this value by adding the property using

prop.addOption("removeUnusedUnits", false);

The converter's default behavior is to remove the unused UnitDefinition objects in the model.

See Also
SBMLFunctionDefinitionConverter
SBMLLevelVersionConverter
SBMLRuleConverter
SBMLStripPackageConverter
SBMLUnitsConverter