Skip to content

Commit

Permalink
conflicts before coffee 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sblackburn-mila committed Feb 26, 2024
2 parents ea7664b + 5927511 commit 239f992
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
11 changes: 11 additions & 0 deletions crystal_diffusion/data/parse_lammps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

EXP_DIR="lammps_scripts/Si/si-custom/"
DUMP_FILENAME="dump.si-300-1.yaml"
THERMO_FILENAME="thermo_log.yaml"
OUTPUT_NAME="demo.parquet"

python crystal_diffusion/data/parse_lammps_outputs.py \
--dump_file ${EXP_DIR}/${DUMP_FILENAME} \
--thermo_file ${EXP_DIR}/${THERMO_FILENAME} \
--output_name ${EXP_DIR}/${OUTPUT_NAME}
1 change: 1 addition & 0 deletions crystal_diffusion/data/parse_lammps_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def parse_lammps_output(lammps_dump: str, lammps_thermo_log: str, output_name: s
if 'id' not in doc['keywords']: # sanity check
raise ValueError('id should be in LAMMPS dump file')
atoms_info = defaultdict(list) # store information on atoms positions and forces here

for data in doc['data']: # loop over the atoms to get their positions and forces
for key, v in zip(doc['keywords'], data):
if key not in ['id', 'type', 'x', 'y', 'z', 'fx', 'fy', 'fz']:
Expand Down
6 changes: 5 additions & 1 deletion data/run_lammps_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
TEMPERATURE=300
BOX_SIZE=1

<<<<<<< HEAD
lmp < lammps_input_example.lammps -v STEP 10 -v T $TEMPERATURE -v S $BOX_SIZE

# extract the thermodynamic outputs in a yaml file
egrep '^(keywords:|data:$|---$|\.\.\.$| - \[)' log.lammps > log.yaml
egrep '^(keywords:|data:$|---$|\.\.\.$| - \[)' log.lammps > log.yaml
=======
lmp < lammps_input_example.lammps -v STEP 10 -v T $TEMPERATURE -v S $BOX_SIZE
>>>>>>> 5927511b163780d0be25d5db4a0eb8868b12f8b2

0 comments on commit 239f992

Please sign in to comment.