[FEM] Elmer writer: fix errors on missing material properties

- we must in this case raise an error and stop the writer script
This commit is contained in:
Uwe
2022-07-26 03:37:55 +02:00
parent bb5c445848
commit f0d633eb4b

View File

@@ -422,12 +422,18 @@ class Writer(object):
if obj.References
else self._getAllBodies())
for name in (n for n in refs if n in bodies):
if "Density" not in m:
raise WriteError("Used material does not specify the necessary 'Density'.")
self._material(
name, "Density",
self._getDensity(m))
if "ThermalConductivity" not in m:
raise WriteError("Used material does not specify the necessary 'Thermal Conductivity'.")
self._material(
name, "Heat Conductivity",
self._convert(m["ThermalConductivity"], "M*L/(T^3*O)"))
if "SpecificHeat" not in m:
raise WriteError("Used material does not specify the necessary 'Specific Heat'.")
self._material(
name, "Heat Capacity",
self._convert(m["SpecificHeat"], "L^2/(T^2*O)"))