def update_strain(self): self.a_parallel = self.subM.parm['alc'] self.mtrlAlloys = [ Material.Alloy(self.materials[idx], self.moleFracs[idx], self.Temperature) for idx in range(len(self.materials)) ] for al in self.mtrlAlloys: al.set_strain(self.a_parallel)
def set_mtrl(self, n, mtrl=None, moleFrac=None): """Set material[n] to new material (mtrl) and/or moleFrac""" if mtrl == None and moleFrac == None: raise Exception("Nothing changed") if mtrl == None: mtrl = self.materials[n] if moleFrac == None: moleFrac = self.moleFracs[n] self.moleFracs[n] = moleFrac self.materials[n] = mtrl self.mtrlAlloys[n] = Material.Alloy(mtrl, moleFrac, self.Temperature) self.mtrlAlloys[n].set_strain(self.a_parallel)
def test_Alloy_AlGaAs(self): algaas = Material.Alloy("AlGaAs", 0.0) # so that is pure GaAs gaas = Material.Material("GaAs") # self.assertEqual(gaas.parm.pop("Crystal"), "ZincBlende") for key in gaas.parm: self.assertAlmostEqual(algaas.parm[key], gaas.parm[key])