def run_aconvasp_command(command, structure): """ Helper function for calling aconvasp with different arguments """ poscar = Poscar(structure) p = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) output = p.communicate(input=poscar.get_string()) return output
def run_aconvasp_command(command, structure): """ Helper function for calling aconvasp with different arguments """ poscar = Poscar(structure) p = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) output = p.communicate(input=poscar.get_string()) return output
def get_new_poscar_lines(self): """ Pymatgen does not realize that decorated elements (species) should be treated as different sites in VASP. This routine hacks the poscar file (which has already been hacked to go from 5.x to 4.6) to include the correct number of distinct sites. """ self.check_structure_is_modified() # get a poscar consistent with the internally modified structure poscar = Poscar(self.structure) lines = poscar.get_string(vasp4_compatible=True).split('\n') hack_line = '' for element, number in self.species_dict.items(): hack_line += ' %i'%number lines[5] = hack_line return lines