本文整理汇总了Python中ase.lattice.cubic.FaceCenteredCubic.get_stresses方法的典型用法代码示例。如果您正苦于以下问题:Python FaceCenteredCubic.get_stresses方法的具体用法?Python FaceCenteredCubic.get_stresses怎么用?Python FaceCenteredCubic.get_stresses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ase.lattice.cubic.FaceCenteredCubic
的用法示例。
在下文中一共展示了FaceCenteredCubic.get_stresses方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MaxwellBoltzmannDistribution
# 需要导入模块: from ase.lattice.cubic import FaceCenteredCubic [as 别名]
# 或者: from ase.lattice.cubic.FaceCenteredCubic import get_stresses [as 别名]
MaxwellBoltzmannDistribution(atoms, 300 * units.kB)
s = atoms.get_stress()
print
print "Stress:", s
s = atoms.get_stress()
print
print "Stress:", s
atoms = FaceCenteredCubic(directions=((1,0,0), (0,1,0), (0,0,1)),
size=(15,15,15), symbol="Cu", pbc=True)
atoms.set_calculator(EMT())
s = atoms.get_stress()
atoms.get_forces()
atoms.get_forces()
MaxwellBoltzmannDistribution(atoms, 300 * units.kB)
atoms.get_forces()
atoms.get_forces()
atoms = FaceCenteredCubic(directions=((1,0,0), (0,1,0), (0,0,1)),
size=(15,15,15), symbol="Cu", pbc=True)
atoms.set_calculator(EMT())
atoms.get_stresses()
atoms.get_stresses()
MaxwellBoltzmannDistribution(atoms, 300 * units.kB)
atoms.get_stresses()
atoms.get_stresses()
print
print
print "No crash: Test passes succesfully!"
示例2: EMT
# 需要导入模块: from ase.lattice.cubic import FaceCenteredCubic [as 别名]
# 或者: from ase.lattice.cubic.FaceCenteredCubic import get_stresses [as 别名]
emt = EMT()
emt.set_subtractE0(False)
atoms_kim.set_calculator(kim)
atoms_emt.set_calculator(emt)
ek = atoms_kim.get_potential_energy()
ee = atoms_emt.get_potential_energy()
ReportTest(txt+"Total energy", ek, ee, 1e-8)
ek = atoms_kim.get_potential_energies()
ee = atoms_emt.get_potential_energies()
for i in range(0, natoms, step):
ReportTest(txt+"Energy of atom %i" % (i,), ek[i], ee[i], 1e-8)
fk = atoms_kim.get_forces()
fe = atoms_emt.get_forces()
n = 0
for i in range(0, natoms, step):
n = (n + 1) % 3
ReportTest(txt+"Force(%i) of atom %i" % (n, i), fk[i, n], fe[i, n], 1e-8)
sk = atoms_kim.get_stress()
se = atoms_emt.get_stress()
for i in range(6):
ReportTest(txt+"Stress(%i)" % (i,), sk[i], se[i], 1e-8)
sk = atoms_kim.get_stresses()
se = atoms_emt.get_stresses()
for i in range(0, natoms, step):
n = (n + 1) % 6
# Volume per atom is not defined the same way: greater tolerance needed
ReportTest(txt+"Stress(%i) of atom %i" % (n, i), sk[i, n], se[i, n], 1e-3)
ReportTest.Summary()