-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSimulation.py
128 lines (101 loc) · 3.43 KB
/
Simulation.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
"""
Defines the Simulation class for setting up containing information on a
metadynamics simulation.
Copyright (C) 2017 Thomas John Heavey IV
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
theavey@bu.edu
thomasjheavey@gmail.com
"""
# I will attempt to be python 2/3 compatible, but no guarantees.
# I'm planning on writing in python 3 primarily, but some dependencies may
# not be python 3 compatible.
from __future__ import print_function
class Simulation(object):
"""
"""
def __init__(self, *args, **kwargs):
"""
:param args:
:param kwargs:
"""
self.cvs = None
self.restraints = None
self.molecules = None
self.run_parameters = None
self.metad_parameters = None
self.Universe = None
self.mdp_name = None
self.tpr_name = None
self.plumed_name = None
self.minim_out_basename = None
self.equil_out_basename = None
self.hills_name = None
self.colvar_name = None
try:
resume_name = kwargs['resume']
self.set_from_resume(resume_name)
except KeyError:
# Though this method would look neater: https://stackoverflow.com/a/18677839/3961920
pass
def set_from_resume(self, resume_name):
"""
Setup object by resuming old instance from a file
:param resume_name:
:return:
"""
# TODO write this
raise NotImplementedError
def add_molecule(self, geom_name, name='mol', **kwargs):
"""
Add a molecule to the simulation.
:param geom_name:
:param name:
:param kwargs:
:return:
"""
raise NotImplementedError
def add_molecule_params(self, param_names):
"""
Add parameter files for a molecule already added to the simulation.
:param param_names:
:return:
"""
raise NotImplementedError
def combine_molecules(self):
""""""
raise NotImplementedError
def add_solvent(self, geom_name, params_name, box_side=3.0):
"""
Add solvent (solvate) all molecules already added.
:param geom_name:
:param params_name:
:param box_side: The size for the side of the box, assuming a cubic box (in nm)
:return:
"""
raise NotImplementedError
def add_cv(self):
"""
Define a collective variable for either metadynamics or restraint.
# This will not be implemented in initial versions.
:return:
"""
raise NotImplementedError
def add_restraint(self, cv, value, kappa):
"""
Restrain simulation along given CV with given parameters
# This will not be implemented in initial versions.
:param cv:
:param value:
:param kappa:
:return:
"""
raise NotImplementedError