pyiron / FAQs

General question board for pyiron users
3 stars 0 forks source link

How to specify raw input in lammps #24

Open ligerzero-ai opened 7 months ago

ligerzero-ai commented 7 months ago

https://github.com/pyiron/pyiron_atomistics/issues/598#issuecomment-1111418639

Option 1

job.input.control.load_string(input_str="""\
units metal
dimension 3
boundary p p p
atom_style atomic
read_data structure.inp
include potential.inp
fix ensemble all box/relax iso 0.0
variable dumptime equal 100
variable thermotime equal 100
min_style cg
dump 1 all custom ${dumptime} dump.out id type xsu ysu zsu fx fy fz vx vy vz
dump_modify 1 sort id format line "%d %d %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g %20.15g"
thermo_style custom step temp pe etotal pxx pxy pxz pyy pyz pzz vol
thermo_modify format float %20.15g
thermo ${thermotime}
minimize 0.0 0.0001 100000 10000000
min_style cg
minimize 0.0 1.0e-8 10000 20000
"""                          
)

Option 2

job.calc_minimize(pressure=0.0)
job.input.control["min_style"] = "fire"
job.input.control._insert(line_number=16, data_dict={"Parameter": ['min_style'], "Value": ['cg'], "Comment": [""]})
job.input.control._insert(line_number=17, data_dict={"Parameter": ['minimize'], "Value": ['0.0 1.0e-8 10000 20000'], "Comment": [""]})