Skip to content

Commit

Permalink
add tags, fix min_ab slab (#829)
Browse files Browse the repository at this point in the history
* add tags, fix min_ab slab

* add pp setups support
  • Loading branch information
mshuaibii authored Sep 5, 2024
1 parent c8e87c1 commit c4e9822
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
1 change: 1 addition & 0 deletions src/fairchem/data/oc/core/interface_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def create_interface_on_sites(
"slab_shift": self.slab.shift,
"slab_top": self.slab.top,
"bulk_idx": self.slab.bulk.bulk_id_from_db,
"ase_tags": interface_atoms.get_tags(),
}
metadata_interface_list.append(metadata)

Expand Down
2 changes: 1 addition & 1 deletion src/fairchem/data/oc/core/slab.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def from_bulk_get_random_slab(
)
sampled_miller_idx = np.random.randint(len(avail_millers))
slabs = Slab.from_bulk_get_specific_millers(
avail_millers[sampled_miller_idx], bulk
avail_millers[sampled_miller_idx], bulk, min_ab
)

# If multiple shifts exist, sample one randomly
Expand Down
3 changes: 2 additions & 1 deletion src/fairchem/data/oc/utils/vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def calculate_surface_k_points(atoms):
)


def write_vasp_input_files(atoms, outdir=".", vasp_flags=None):
def write_vasp_input_files(atoms, outdir=".", vasp_flags=None, pp_setups="minimal"):
"""
Effectively goes through the same motions as the `run_vasp` function,
except it only writes the input files instead of running.
Expand All @@ -84,4 +84,5 @@ def write_vasp_input_files(atoms, outdir=".", vasp_flags=None):

atoms, vasp_flags = _clean_up_inputs(atoms, vasp_flags.copy())
calc = Vasp(directory=outdir, **vasp_flags)
calc.input_params["setups"] = pp_setups
calc.write_input(atoms)
25 changes: 8 additions & 17 deletions src/fairchem/data/oc/utils/vasp_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,19 @@
"ivdw": 11,
"encut": 400.0,
"ediff": 1e-6,
"ediffg": -0.05,
"nelm": 100,
"ismear": 0,
"sigma": 0.1,
"lwave": False,
"lcharg": False,
"lcharg": True,
"lwave": True,
"isif": 0,
"ispin": 2,
"algo": "Fast",
"algo": "All",
"idipol": 3,
"ldipol": True,
"lasph": True,
"lreal": "Auto",
"ncore": 100,
"ncore": 100, # VASP will scale this down to whatever ncores are available.
"dipol": [0.5, 0.5, 0.5],
}

Expand All @@ -82,20 +81,12 @@
"ncore": 4,
}

RELAX_FLAGS = {"ibrion": 2, "nsw": 500}
RELAX_FLAGS = {"ibrion": 2, "nsw": 5}

MD_FLAGS = {
"ibrion": 0,
"nsw": 100,
"nsw": 10,
"smass": 0,
"tebeg": 600,
"potim": 1,
}

ML_FLAGS = {
"ML_LMLFF": True,
"ML_ISTART": 0,
"ML_EPS_LOW": 1e-7,
"NSW": 1000,
"ISIF": 2,
"tebeg": 1000,
"potim": 2,
}

0 comments on commit c4e9822

Please sign in to comment.