def getInputParam(text, param): "Gets input string, sets param value and returns updated string" # XXX: Parameters should be from "SYSTEM" namelist (extend for K-points) input = QEInput(config=text) input.parse() nl = input.namelist("system") return nl.param(param)
def setInput(self): "Set namelist 'input'" self._input = QEInput(type='dynmat') nl = Namelist("input") self._input.addNamelist(nl) nl.add("fildyn", self._phresults.fildyn()) # from PH results self._addAsr(nl) self._addQPoint(nl)
def setInput(self): "Set namelist 'input'" self._input = QEInput(type='q2r') nl = self._input.namelist("input") zasr = ZASR[ZASRLIST[int(self._inv.zasr)]] nl.set("fildyn", self.fildyn()) # from PH results nl.set("zasr", zasr) nl.set("flfrc", FLFRC)
def _inputFromRecord(self): "Set input object from input configuration" inputs = self._director.clerk.getQEConfigurations(where="taskid='%s'" % self._emTaskId()) if len(inputs) == 0: # No input created return input = inputs[0] fname = defaultInputName(input.type) inputStr = readRecordFile(self._director.dds, input, fname) self._input = QEInput(config=inputStr, type="cp") self._input.parse()
def filterInput(self, director): "Default behaviour: standard filtering" input = QEInput(config=self.inventory.text, type=self.inventory.type) filter = filters.filterFactory(self.inventory.type) # Creating filter filter.apply(input) # Apply filter to input fconfig = input.toString() # Filtered config input return director.redirect( actor='material_simulations/espresso/input-create', routine='createRecord', text=fconfig, id=self.inventory.id, taskid=self.inventory.taskid, type=self.inventory.type, subtype=self.inventory.subtype, fname=self.inventory.fname, description=self.inventory.description)
def setInputpp(self): self._input = QEInput(type="dos") nl = self._input.namelist("inputpp") nl.add("Emin", self._inv.emin) nl.add("Emax", self._inv.emax) nl.add("DeltaE", self._inv.deltae)
def setInputpp(self): self._input = QEInput(type="bands") nl = self._input.namelist("inputpp") nl.add("filband", FILBAND) nl.add("lsym", LSIM)