Beispiel #1
0
	def write_input_files_to_path(self):
		"""
		Simply write files to path
		"""

		if self.initial_structure:
			self.initial_structure.to_poscar_file_path(Path.clean(self.path, 'POSCAR'))
		elif not Path.exists(self.contcar_path):
			raise Exception("Neither an initial structure nor an existing contcar path have been provided. Nowhere to get the structure.")
		else:
			Path.copy(self.contcar_path, self.get_extended_path('POSCAR'))

		for file_path in [self.chargecar_path, self.wavecar_path]:
			if Path.exists(file_path):
				Path.copy(file_path, self.path)

		self.initial_incar.write_to_path(Path.join(self.path, 'INCAR'))

		if self.initial_kpoints: 
			self.initial_kpoints.write_to_path(Path.join(self.path, 'KPOINTS'))
		elif 'kspacing' not in self.incar:
			raise Exception("If no kpoints is provided, must have kspacing parameter in incar set")
			
		self.initial_potcar.write_to_path(Path.join(self.path, 'POTCAR'))
		self.submission_script_file.write_to_path(Path.join(self.path, 'submit.sh'))
	def write_input_files_to_path(self, structure, incar, kpoints, potcar, submission_script_file, wavecar_path, chargecar_path):
		"""
		Simply write files to path
		"""

		structure.to_poscar_file_path(Path.clean(self.path, 'POSCAR'))
		incar.write_to_path(Path.clean(self.path, 'INCAR'))
		if kpoints: 
			kpoints.write_to_path(Path.clean(self.path, 'KPOINTS'))
		elif 'kspacing' not in incar:
			raise Exception("If no kpoints is provided, must have kspacing parameter in incar set")
			
		potcar.write_to_path(Path.clean(self.path, 'POTCAR'))
		submission_script_file.write_to_path(Path.clean(self.path, 'submit.sh'))

		if wavecar_path and Path.exists(wavecar_path):
			Path.copy(wavecar_path, self.get_extended_path('WAVECAR'))

		if chargecar_path and Path.exists(chargecar_path):
			Path.copy(chargecar_path, self.get_extended_path('CHARGECAR'))