-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_util_wrapper.html
315 lines (198 loc) · 15.4 KB
/
user_util_wrapper.html
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>3.1. MM Program Interfaces — molsys 1.0.0 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="1. API Documentation" href="tech_api.html" />
<link rel="prev" title="3. Utility Modules" href="user_util.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> molsys
</a>
<div class="version">
1.0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">User Documentation</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="user_quickstart.html">1. Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="user_addon.html">2. Addons</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="user_util.html">3. Utility Modules</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">3.1. MM Program Interfaces</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#introduction">3.1.1. Introduction</a></li>
<li class="toctree-l3"><a class="reference internal" href="#lammps-interface">3.1.2. LAMMPS Interface</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<p class="caption"><span class="caption-text">Technical Stuff</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="tech_api.html">1. API Documentation</a></li>
</ul>
<p class="caption"><span class="caption-text">File Formats</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="file_io.html">1. File Formats</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">molsys</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home"></a> »</li>
<li><a href="user_util.html"><span class="section-number">3. </span>Utility Modules</a> »</li>
<li><span class="section-number">3.1. </span>MM Program Interfaces</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/user_util_wrapper.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="mm-program-interfaces">
<h1><span class="section-number">3.1. </span>MM Program Interfaces<a class="headerlink" href="#mm-program-interfaces" title="Permalink to this headline">¶</a></h1>
<div class="section" id="introduction">
<h2><span class="section-number">3.1.1. </span>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
<p>As already explained it is possible to assign force field parameters to a molecular system of
interest by using the FF addon. In addition MOLSYS features interfaces to several molecular
mechanis programms which makes it easy to run molecular dynamics simulations of the system
at the basis of the assigned FF. In this chapter it is explained how to use these interfaces.
Up to know interfaces to PYDLPOLY and PYLMPS are implemented. Setting up an instance of PYDLPOLY
or PYLMPS based on MOLSYS is quite easy. Two ways are possible.</p>
<p>In the first way one creates a mol object with a FF addon attached, which is then used to initialize
PYDLPOLY/PYLMPS. For PYLPOLY this has to be done as follows:</p>
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="o">>></span> <span class="kn">import</span> <span class="nn">pydlpoly</span>
<span class="o">>></span> <span class="kn">import</span> <span class="nn">molsys</span>
<span class="o">>></span> <span class="n">m</span> <span class="o">=</span> <span class="n">molsys</span><span class="o">.</span><span class="n">mol</span><span class="o">.</span><span class="n">fromFile</span><span class="p">(</span><span class="s2">"HKUST-1.mfpx"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">m</span><span class="o">.</span><span class="n">addon</span><span class="p">(</span><span class="s2">"ff"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">m</span><span class="o">.</span><span class="n">ff</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="s2">"HKUST-1"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">pd</span> <span class="o">=</span> <span class="n">pydlpoly</span><span class="o">.</span><span class="n">pydlpoly</span><span class="p">(</span><span class="s2">"HKUST-1"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">pd</span><span class="o">.</span><span class="n">setup</span><span class="p">(</span><span class="n">mol</span> <span class="o">=</span> <span class="n">m</span><span class="p">)</span>
</pre></div>
</td></tr></table></div>
<p>For PYLMPS it works totally the same:</p>
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="o">>></span> <span class="kn">import</span> <span class="nn">pylmps</span>
<span class="o">>></span> <span class="kn">import</span> <span class="nn">molsys</span>
<span class="o">>></span> <span class="n">m</span> <span class="o">=</span> <span class="n">molsys</span><span class="o">.</span><span class="n">mol</span><span class="o">.</span><span class="n">fromFile</span><span class="p">(</span><span class="s2">"HKUST-1.mfpx"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">m</span><span class="o">.</span><span class="n">addon</span><span class="p">(</span><span class="s2">"ff"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">m</span><span class="o">.</span><span class="n">ff</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="s2">"HKUST-1"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">pd</span> <span class="o">=</span> <span class="n">pylmps</span><span class="o">.</span><span class="n">pylmps</span><span class="p">(</span><span class="s2">"HKUST-1"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">pd</span><span class="o">.</span><span class="n">setup</span><span class="p">(</span><span class="n">mol</span> <span class="o">=</span> <span class="n">m</span><span class="p">)</span>
</pre></div>
</td></tr></table></div>
<p>It is also possbile to startup PYDLPOLY/PYLMPS directly from the .fpar and .ric files.
For this purpose please follow the example below:</p>
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="o">>></span> <span class="kn">import</span> <span class="nn">pylmps</span>
<span class="o">>></span> <span class="n">pd</span> <span class="o">=</span> <span class="n">pylmps</span><span class="o">.</span><span class="n">pylmps</span><span class="p">(</span><span class="s2">"HKUST-1"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">pd</span><span class="o">.</span><span class="n">setup</span><span class="p">(</span><span class="n">xyz</span><span class="o">=</span><span class="s2">"HKUST-1.mfpx"</span><span class="p">,</span> <span class="n">par</span><span class="o">=</span><span class="s2">"HKUST-1"</span><span class="p">)</span>
</pre></div>
</td></tr></table></div>
<p>In addition it is possible to start PYLMPS/PYDLPOLY from the MOFplus database:</p>
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="o">>></span> <span class="kn">import</span> <span class="nn">pylmps</span>
<span class="o">>></span> <span class="n">pd</span> <span class="o">=</span> <span class="n">pylmps</span><span class="o">.</span><span class="n">pylmps</span><span class="p">(</span><span class="s2">"HKUST-1"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">pd</span><span class="o">.</span><span class="n">setup</span><span class="p">(</span><span class="n">xyz</span><span class="o">=</span><span class="s2">"HKUST-1.mfpx"</span><span class="p">,</span> <span class="n">ff</span><span class="o">=</span><span class="s2">"MOF-FF"</span><span class="p">)</span>
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="lammps-interface">
<h2><span class="section-number">3.1.2. </span>LAMMPS Interface<a class="headerlink" href="#lammps-interface" title="Permalink to this headline">¶</a></h2>
<p>The LAMMPS interface is implemented in the ff2lammps module in the PYLMPS package. It can be used
to create easily a PYLMPS object for your system of interest as explained above. In addition it can
be used to generate usual LAMMPS input files in oder to start LAMMPS from the command line.
This is shown in the example below:</p>
<div class="highlight-python notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span>
<span class="normal">8</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="o">>></span> <span class="kn">import</span> <span class="nn">molsys</span>
<span class="o">>></span> <span class="kn">from</span> <span class="nn">pylmps</span> <span class="kn">import</span> <span class="n">ff2lammps</span>
<span class="o">>></span> <span class="n">m</span> <span class="o">=</span> <span class="n">molsys</span><span class="o">.</span><span class="n">mol</span><span class="o">.</span><span class="n">fromFile</span><span class="p">(</span><span class="s2">"HKUST-1.mfpx"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">m</span><span class="o">.</span><span class="n">addon</span><span class="p">(</span><span class="s2">"ff"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">m</span><span class="o">.</span><span class="n">ff</span><span class="o">.</span><span class="n">read</span><span class="p">(</span><span class="s2">"HKUST-1"</span><span class="p">)</span>
<span class="o">>></span> <span class="n">ff2lmp</span> <span class="o">=</span> <span class="n">ff2lammps</span><span class="o">.</span><span class="n">ff2lammps</span><span class="p">(</span><span class="n">m</span><span class="p">)</span>
<span class="o">>></span> <span class="n">ff2lmp</span><span class="o">.</span><span class="n">write_data</span><span class="p">(</span><span class="s1">'hkust1.data'</span><span class="p">)</span>
<span class="o">>></span> <span class="n">ff2lmp</span><span class="o">.</span><span class="n">write_input</span><span class="p">(</span><span class="s1">'hkust1.in'</span><span class="p">)</span>
</pre></div>
</td></tr></table></div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="tech_api.html" class="btn btn-neutral float-right" title="1. API Documentation" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="user_util.html" class="btn btn-neutral float-left" title="3. Utility Modules" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2019-2021, Roberto Amabile, Johannes P. Duerholt, Julian Keupp, Rochus Schmid.
</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>