to_gpcm3 function

Requirements.Units.Conversions.to_gpcm3  ยท source

Icon of to_gpcm3

Convert from kilogram per cubic metre to gram per cubic centimetre

Extends Modelica.Units.Icons.Conversion

Convert from kilogram per cubic metre to gram per cubic centimetre: g_cm3 := (1/1000)*kg_m3. The input kg_m3 is the value in kilogram per cubic metre (type Modelica.Units.SI.Density), the output g_cm3 the value in gram per cubic centimetre (type NonSI.Density_gpcm3). The inverse is from_gpcm3.

The conversion is a multiplication by a constant factor, without offset, so it converts differences and rates alike; it is exact up to floating-point rounding and has no limits on the input. The function is inlined. A check model uses it to give a variable of the model in the unit in which the requirement states it; see Conversions. Examples.Elementary.Units.Conversions asserts it through the round trip to_gpcm3(from_gpcm3(7)).

Copyright © 2026 Model Based Innovation LLC. All rights reserved.

Inputs

NameTypeDescription
kg_m3 inputSI.DensityValue in kilogram per cubic metre

Outputs

NameTypeDescription
g_cm3 outputNonSI.Density_gpcm3Value in gram per cubic centimetre