Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Commit 69b5a2e

Browse files
committed
VaspFactory: Allow to customize potcars
1 parent 6cea58a commit 69b5a2e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pyiron_contrib/jobfactories/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,14 @@ class VaspFactory(DftFactory):
304304
def __init__(self):
305305
super().__init__()
306306
self.storage.incar = {}
307+
self.storage.potential = {}
307308
self.storage.nband_nelec_map = None
308309

309310
@property
310311
def incar(self):
312+
"""
313+
Values are set on job.input.incar on job creation.
314+
"""
311315
return self.storage.incar
312316

313317
def enable_nband_hack(self, nelec: Dict[str, int]):
@@ -320,6 +324,13 @@ def enable_nband_hack(self, nelec: Dict[str, int]):
320324
"""
321325
self.storage.nband_nelec_map = nelec
322326

327+
@property
328+
def potential(self):
329+
"""
330+
Values are set as job.potential.<elem> = <value>
331+
"""
332+
return self.storage.potential
333+
323334
def _get_hamilton(self):
324335
return "Vasp"
325336

@@ -340,6 +351,11 @@ def _prepare_job(self, job, structure):
340351
job = super()._prepare_job(job, structure)
341352
for k, v in self.incar.items():
342353
job.input.incar[k] = v
354+
for k, v in self.potential.items():
355+
try:
356+
job.potential[k] = v
357+
except AttributeError:
358+
pass # element k does not exist in the current structure
343359
if self.storage.nband_nelec_map is not None:
344360
# ensure we apply the hack only for structures where we know an NBAND estimate for all elements
345361
elems = set(self.storage.nband_nelec_map.keys())

0 commit comments

Comments
 (0)