You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to #1682: Material.density returns zero, probably under the assumption a subclass will override the method. And most cases that's true.
But, if you make a custom material in the blueprint file and provide a mass density, the CustomMaterial object does not override the density and will return zero. This is despite the fact that is known by the class
In some cases it needs to be set after full core assemblies are populated (e.g. for
CustomLocation materials), so the missing density warning will appear no matter
what.
"""
returnself.customDensity
But, if you have a routine that does something with a subclass of Material and relies on Material.density, you can see strange problems because CustomMaterial.density falls back to Material.density which relies on the refDens property
The text was updated successfully, but these errors were encountered:
drewj-usnctech
changed the title
Density of a custom material raises zero despite knowing the density
Density of a custom material is zero despite knowing the density
Apr 25, 2024
Related to #1682:
Material.density
returns zero, probably under the assumption a subclass will override the method. And most cases that's true.But, if you make a custom material in the blueprint file and provide a mass density, the
CustomMaterial
object does not override the density and will return zero. This is despite the fact that is known by the classarmi/armi/materials/custom.py
Line 40 in 7b26f79
and used in the
pseudoDensity
methodarmi/armi/materials/custom.py
Lines 42 to 50 in 7b26f79
But, if you have a routine that does something with a subclass of
Material
and relies onMaterial.density
, you can see strange problems becauseCustomMaterial.density
falls back toMaterial.density
which relies on therefDens
propertyarmi/armi/materials/material.py
Lines 492 to 514 in 7b26f79
which defaults to zero
armi/armi/materials/material.py
Line 101 in 7b26f79
The text was updated successfully, but these errors were encountered: