Пример #1
0
 def test_number_density_units(self):
     builder = MaterialBuilder()
     builder.setName('Bizarre oxide').setFormula('Al2 O3').setNumberDensity(
         0.23)
     builder.setNumberDensityUnit(NumberDensityUnit.FormulaUnits)
     material = builder.build()
     self.assertEqual(material.numberDensity, 0.23 * (2. + 3.))
Пример #2
0
 def test_number_density_units(self):
     builder = MaterialBuilder()
     builder.setName(NAME).setFormula(FORMULA).setNumberDensity(NUMBER_DENSITY)
     builder.setNumberDensityUnit(NumberDensityUnit.FormulaUnits)
     material = builder.build()
     self.assertEqual(material.numberDensity, NUMBER_DENSITY * (2. + 3.))
     self.assertEqual(material.numberDensityEffective, NUMBER_DENSITY * (2. + 3.))
     self.assertEqual(material.packingFraction, 1.)
Пример #3
0
 def test_number_density_units(self):
     builder = MaterialBuilder()
     builder.setName('Bizarre oxide').setFormula('Al2 O3').setNumberDensity(0.23)
     builder.setNumberDensityUnit(NumberDensityUnit.FormulaUnits)
     material = builder.build()
     self.assertEqual(material.numberDensity, 0.23 * (2. + 3.))