def test(tmpdir, path): from numpy import abs from pylada.crystal import Structure from pylada.vasp import Vasp from pylada.vasp.relax import epitaxial from pylada import default_comm structure = Structure([[0, 0.5, 0.5], [0.5, 0, 0.5], [0.5, 0.5, 0]], scale=5.55, name='has a name')\ .add_atom(0, 0, 0, "Si")\ .add_atom(0.25, 0.25, 0.25, "Si") vasp = Vasp() vasp.kpoints = "Automatic generation\n0\nMonkhorst\n2 2 2\n0 0 0" vasp.prec = "accurate" vasp.ediff = 1e-5 vasp.encut = 1.4 vasp.ismear = "fermi" vasp.sigma = 0.01 vasp.relaxation = "volume" vasp.add_specie = "Si", "{0}/pseudos/Si".format(path) result = epitaxial(vasp, structure, outdir=str(tmpdir), epiconv=1e-5, comm=default_comm) assert result.success assert abs(result.stress[2, 2]) < 1.0
def test(path): from shutil import rmtree from os.path import exists from os import makedirs from tempfile import mkdtemp from numpy import abs from pylada.crystal import Structure from pylada.vasp import Vasp from pylada.vasp.relax import epitaxial from pylada import default_comm structure = Structure([[0, 0.5, 0.5],[0.5, 0, 0.5], [0.5, 0.5, 0]], scale=5.55, name='has a name')\ .add_atom(0,0,0, "Si")\ .add_atom(0.25,0.25,0.25, "Si") vasp = Vasp() vasp.kpoints = "Automatic generation\n0\nMonkhorst\n2 2 2\n0 0 0" vasp.prec = "accurate" vasp.ediff = 1e-5 vasp.encut = 1.4 vasp.ismear = "fermi" vasp.sigma = 0.01 vasp.relaxation = "volume" vasp.add_specie = "Si", "{0}/pseudos/Si".format(path) directory = mkdtemp() if exists(directory) and directory == '/tmp/test': rmtree(directory) if not exists(directory): makedirs(directory) try: result = epitaxial(vasp, structure, outdir=directory, epiconv=1e-5, comm=default_comm) assert result.success assert abs(result.stress[2, 2]) < 1.0 finally: if directory != '/tmp/test': rmtree(directory) pass
def test(path): from shutil import rmtree from os.path import exists from os import makedirs from tempfile import mkdtemp from numpy import abs from pylada.crystal import Structure from pylada.vasp import Vasp from pylada.vasp.relax import epitaxial from pylada import default_comm structure = Structure([[0, 0.5, 0.5],[0.5, 0, 0.5], [0.5, 0.5, 0]], scale=5.55, name='has a name')\ .add_atom(0,0,0, "Si")\ .add_atom(0.25,0.25,0.25, "Si") vasp = Vasp() vasp.kpoints = "Automatic generation\n0\nMonkhorst\n2 2 2\n0 0 0" vasp.prec = "accurate" vasp.ediff = 1e-5 vasp.encut = 1.4 vasp.ismear = "fermi" vasp.sigma = 0.01 vasp.relaxation = "volume" vasp.add_specie = "Si", "{0}/pseudos/Si".format(path) directory = mkdtemp() if exists(directory) and directory == '/tmp/test': rmtree(directory) if not exists(directory): makedirs(directory) try: result = epitaxial(vasp, structure, outdir=directory, epiconv=1e-5, comm=default_comm) assert result.success assert abs(result.stress[2,2]) < 1.0 finally: if directory != '/tmp/test': rmtree(directory) pass