def strategy_with_ecut(self, ecut): """Return a Strategy instance with given cutoff energy ecut.""" # Define the system: one atom in a box of lenghts acell. boxed_atom = AbiStructure.boxed_atom(self.pseudo, acell=self.acell) # Gamma-only sampling. gamma_only = KSampling.gamma_only() # Setup electrons. electrons = Electrons(spin_mode=self.spin_mode, smearing=self.smearing) # Don't write WFK files. extra_abivars = { "ecut" : ecut, "prtwf": 0, "toldfe": self.toldfe, } strategy = ScfStrategy(boxed_atom, self.pseudo, gamma_only, spin_mode=self.spin_mode, smearing=self.smearing, charge=0.0, scf_algorithm=None, use_symmetries=True, **extra_abivars) return strategy
def add_task_with_ecut(self, ecut): """Register a new task with cutoff energy ecut.""" # One atom in a box of lenghts acell. inp = abilab.AbinitInput(structure=Structure.boxed_atom(self.pseudo, acell=self.acell), pseudos=self.pseudo) # Gamma-only sampling. inp.add_abiobjects(self.spin_mode, self.smearing, KSampling.gamma_only()) inp.set_vars( ecut=ecut, toldfe=self.toldfe, prtwf=1, ) self.ecuts.append(ecut) self.register_scf_task(inp)