forked from barmoral/osmotic_calculations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_sim_params.py
58 lines (52 loc) · 1.89 KB
/
build_sim_params.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
'''Procedurally build and format simulation parameter presets for polymerist-based OpenMM hooks'''
from pathlib import Path
from openmm.unit import kelvin, atmosphere, nanosecond, picosecond, femtoseconds
from polymerist.genutils.fileutils.pathutils import assemble_path
from polymerist.mdtools.openmmtools.parameters import SimulationParameters, ThermoParameters, IntegratorParameters, ReporterParameters
from polymerist.mdtools.openmmtools.thermo import EnsembleFactory
all_omm_sims : dict[str, SimulationParameters] = {
'equil_sim' : SimulationParameters(
integ_params=IntegratorParameters(
time_step=2*femtoseconds,
total_time=2*nanosecond,
num_samples=100,
),
thermo_params=ThermoParameters(
ensemble='NVT',
temperature=300 * kelvin,
),
reporter_params=ReporterParameters(
traj_ext='dcd',
),
),
'prod_sim' : SimulationParameters(
integ_params=IntegratorParameters(
time_step=2*femtoseconds,
total_time=20*nanosecond,
num_samples=1001,
),
thermo_params=ThermoParameters(
ensemble='NVT',
temperature=300 * kelvin,
),
reporter_params=ReporterParameters(),
),
'test_sim' : SimulationParameters(
integ_params=IntegratorParameters(
time_step=2*femtoseconds,
total_time=2*picosecond,
num_samples=10,
),
thermo_params=ThermoParameters(
ensemble='NVT',
temperature=600 * kelvin,
),
reporter_params=ReporterParameters(),
),
}
if __name__ == '__main__':
sim_dir = Path('./sim_param_sets')
sim_dir.mkdir(exist_ok=True)
for step_name, sim_params in all_omm_sims.items():
sp_path = assemble_path(sim_dir, step_name, extension='json')
sim_params.to_file(sp_path)