#!/usr/bin/env python from __future__ import division import abipy.data as data from abipy.abilab import AbiInput # Create an ABINIT input file with 1 dataset. # Pseudos are located in the pseudo_dir directory. inp = AbiInput(pseudos="14si.pspnc", pseudo_dir=data.pseudo_dir, ndtset=1) # One can set the value of the variables directly with the syntax. inp.ecut = 10. inp.tolwfr = 1e-8 # It's possible to use strings but use them only for special cases such as: inp.istwfk = '*1' # One can create a dictionary mapping keywords to values unit_cell = { "acell": 3*[10.217], 'rprim': [ [.0, .5, .5], [.5, .0, .5], [.5, .5, .0]], 'ntypat': 1, 'znucl': [14,], 'natom': 2, 'typat': [1, 1], 'xred': [ [.0, .0, .0], [.25,.25,.25] ] }
#!/usr/bin/env python from __future__ import division import numpy as np import abipy.data as data from abipy.abilab import Structure, StructureModifier, AbiInput structure = Structure.from_file(data.cif_file("si.cif")) modifier = StructureModifier(structure) # From 98% to 102% of the initial volume. new_structures = modifier.scale_lattice(vol_ratios=np.arange(98, 104, 2) / 100.) inp = AbiInput(pseudos=data.pseudos("14si.pspnc"), ndtset=len(new_structures)) for (idt, new_structure) in enumerate(new_structures): inp.set_structure(new_structure, dtset=idt+1) print(inp) # Supercell inp = AbiInput(pseudos=data.pseudos("14si.pspnc"), ndtset=1) new_structure = modifier.make_supercell(scaling_matrix=[1,2,3]) inp.set_structure(new_structure) print(inp) structure = Structure.from_abivars({