from_gpcm3 function

Requirements.Units.Conversions.from_gpcm3  ยท source

Icon of from_gpcm3

Convert from gram per cubic centimetre to kilogram per cubic metre

Extends Modelica.Units.Icons.Conversion

Convert from gram per cubic centimetre to kilogram per cubic metre: kg_m3 := 1000*g_cm3. The input g_cm3 is the value in gram per cubic centimetre (type NonSI.Density_gpcm3), the output kg_m3 the value in kilogram per cubic metre (type Modelica.Units.SI.Density). The inverse is to_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 write a value of a requirement in the unit in which the requirement states it, from_gpcm3(<value as written>), so that the model reads like the statement; see Conversions. Examples.Elementary.Units.Conversions asserts its factor and the round trip to_gpcm3(from_gpcm3(7)).

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

Inputs

NameTypeDescription
g_cm3 inputNonSI.Density_gpcm3Value in gram per cubic centimetre

Outputs

NameTypeDescription
kg_m3 outputSI.DensityValue in kilogram per cubic metre