OSDN Git Service

0e62c94330cc176f3f6c697b9cae54d5473127f6
[molby/Molby.git] / Documents / src / molby_rb / MDArena.html
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html 
3      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <head>
8   <title>Class: MDArena</title>
9   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10   <meta http-equiv="Content-Script-Type" content="text/javascript" />
11   <link rel="stylesheet" href="rdoc-style.css" type="text/css" media="screen" />
12 </head>
13 <body>
14
15 <div id="navi">
16 <a href="../index.html">[Molby Document Home]</a>
17 <a href="../ruby_ref.html">[Contents]</a>
18 </div>
19
20 <div id="classHeader">
21 <table class="header-table">
22 <tr>
23 <td><strong>Class:</strong></td>
24 <td class="class-name-in-header">MDArena</td>
25 </tr>
26 <tr>
27 <td><strong>Parent:</strong></td>
28 <td><a href="Object.html">Object</a></td>
29 </tr>
30 </table>
31 </div>
32
33 <div id="section">
34 <h3 class="section-bar">Description</h3>
35 <a name="description-overview"></a>
36 <h4>Overview</h4>
37 <p>
38 The class <a href="MDArena.html">MDArena</a> provides access to the MM/MD runtime information for a <a href="Molecule.html">Molecule</a>. To run a MM/MD calculation from script, the following steps should be followed.
39 </p>
40 <ul>
41 <li>Obtain the <a href="MDArena.html">MDArena</a> object by <a href="Molecule.html#M000313">Molecule#md_arena</a>.</li>
42 <li>Initialize the MM/MD runtime by <a href="MDArena.html#M000046">MDArena#prepare</a>. If it raises exception or returns nil, some of the settings need modification (providing missing parameters, etc.) before the MM/MD calculation can be run.</li>
43 <li>Run an energy minimization by <a href="MDArena.html#M000045">MDArena#minimize</a>, or a simulation by <a href="MDArena.html#M000044">MDArena#run</a>.</li>
44 </ul>
45 <a name="description-attributes"></a>
46 <h4>MDArena attributes</h4>
47 <p>
48 The MM/MD calculation uses many setting parameters and runtime information, which are accessible as attributes of <a href="MDArena.html">MDArena</a>. The available attributes are listed below:
49 </p>
50 <table border="1" cellspacing="0">
51 <tr><th>name</th><th>value type</th><th>description</th></tr>
52 <tr><td>timestep</td><td>Float</td><td>The timestep (in femtosecond) for solving the Newtonian equation of motion. Default: 1 fs.</td></tr>
53 <tr><td>cutoff</td><td>Float</td><td>The cutoff distance (in Å) for van der Waals interaction. Default: 9.0 Å.</td></tr>
54 <tr><td>electro_cutoff</td><td>Float</td><td>The cutoff distance (in Å) for electrostatic interaction. Default: 9.0 Å.</td></tr>
55 <tr><td>pairlist_distance</td><td>Float</td><td>The threshold distance for making the pairlist table. The pairlist table records the interatomic distances, and is updated when the maximum displacement of any atom exceeds <code>(pairlist_distance - cutoff)</code> or <code>(pairlist_distance - electro_cutoff)</code>. The recommended value is <code>cutoff + 1.0</code> or <code>electro_cutoff + 1.0</code>, whichever is larger. Default: 10.0 Å.</td></tr>
56 <tr><td>temperature</td><td>Float</td><td>The target temperature (in Kelvin). Default: 300.0 K.</td></tr>
57 <tr><td>transient_temperature</td><td>Float</td><td>The transient temperature at the last MD step (in Kelvin). Read only.</td></tr>
58 <tr><td>average_temperature</td><td>Float</td><td>The average temperature from the beginning of the MD run (in Kelvin). Read only.</td></tr>
59 <tr><td>andersen_freq</td><td>Integer</td><td>The frequency to perform Andersen thermostat. Default: 50.</td></tr>
60 <tr><td>andersen_coupling</td><td>Float</td><td>The coupling constant for Andersen thermostat. Default: 0.1.</td></tr>
61 <tr><td>random_seed</td><td>Integer</td><td>The random seed. Default: 0 (new seed is generated at every initialization).</td></tr>
62 <tr><td>dielectric</td><td>Float</td><td>The dielectric constant of the media. Default: 1.0.</td></tr>
63 <tr><td>gradient_convergence</td><td>Float</td><td>The gradient threshold for terminating minimization. Default: 1e-6.</td></tr>
64 <tr><td>coordinate_convergence</td><td>Float</td><td>The coordinate threshold for terminating minimization. Default: 1e-8.</td></tr>
65 <tr><td>use_xplor_shift</td><td>Integer</td><td>If non-zero, use X-PLOR type shift for the electrostatic potential. Default: 1.</td></tr>
66 <tr><td>scale14_vdw</td><td>Float</td><td>Scale factor for the van der Waals potentials for the 1-4 atom pair (i.e. the pair of atoms that are connected through 3 bonds). Default: 0.5.</td></tr>
67 <tr><td>scale14_elect</td><td>Float</td><td>Scale factor for the electrostatic potentials for the 1-4 atom pair. Default: 0.83.</td></tr>
68 <tr><td>relocate_center</td><td>Integer</td><td>If non-zero, then relocate the whole system so that the center of mass does not move. Default: 0.</td></tr>
69 <tr><td>step</td><td>Integer</td><td>The current step. Read only.</td></tr>
70 <tr><td>coord_frame</td><td>Integer</td><td>The last frame number created by this calculation. Read only.</td></tr>
71 <tr><td>coord_file</td><td>String</td><td>The output file name for coordinates. The file is in the "crd" format. Default: nil (no output)</td></tr>
72 <tr><td>vel_file</td><td>String</td><td>The output file name for velocities. The file is in the "crd" format. Default: nil (no output)</td></tr>
73 <tr><td>force_file</td><td>String</td><td>The output file name for force. The file is in the "crd" format. Default: nil (no output)</td></tr>
74 <tr><td>log_file</td><td>String</td><td>The output file name for the log. Default: nil (no output)</td></tr>
75 <tr><td>debug_file</td><td>String</td><td>The output file name for the debug information. Default: nil (no output)</td></tr>
76 <tr><td>coord_output_freq</td><td>Integer</td><td>Output the coordinates every this step. Default: 10.</td></tr>
77 <tr><td>energy_output_freq</td><td>Integer</td><td>Output the energies every this step to the log file. Default: 10.</td></tr>
78 <tr><td>debug_output_level</td><td>Integer</td><td>Set the verbosity of the debug information. Default: 0.</td></tr>
79 </table>
80 </div>
81
82 <div id="section">
83
84 <div id="methods">
85 <h3 class="section-bar">Public Instance methods</h3>
86
87 <div id="method-M000048" class="method-detail">
88 <a name="M000048"></a>
89 <div class="method-heading">
90 <span class="method-name">self[attr]<br />
91 self[attr] = value
92 </span>
93 </div>
94 <div class="method-description">
95 <p>
96 Get/set the attribute value. The attribute values also can be accessed by <code>self.attribute_name</code> and <code>self.attribute_name = value</code>. See the <a href="#description-attributes">MDArena attributes</a> section for the list of available attributes.
97 </p>
98 </div>
99 </div>
100
101 <div id="method-M000047" class="method-detail">
102 <a name="M000047"></a>
103 <div class="method-heading">
104 <span class="method-name">energies &rarr; [total, bond, angle, dihedral, improper, vdw, electrostatic, auxiliary, surface, kinetic, net]<br />
105 </span>
106 </div>
107 <div class="method-description">
108 <p>
109 Get the <a href="MDArena.html#M000047">energies</a> at the last step of the MM/MD calculation. The unit is kcal/mol.
110 </p>
111 </div>
112 </div>
113
114 <div id="method-M000050" class="method-detail">
115 <a name="keys"></a>
116 <div class="method-heading">
117 <span class="method-name">keys &rarr; Array<br />
118 </span>
119 </div>
120 <div class="method-description">
121 <p>
122 Returns an array of attributes.
123 </p>
124 </div>
125 </div>
126
127 <div id="method-M000045" class="method-detail">
128 <a name="M000045"></a>
129 <div class="method-heading">
130 <span class="method-name">minimize(n)       &rarr; self<br />
131 minimize(n) { ... } &rarr; self<br />
132 </span>
133 </div>
134 <div class="method-description">
135 <p>
136 Minimize the MM energy for n steps. If a block is given, it is executed when
137 minimization is complete.
138 </p>
139 </div>
140 </div>
141
142 <div id="method-M000046" class="method-detail">
143 <a name="M000046"></a>
144 <div class="method-heading">
145 <span class="method-name">prepare(check_only = false)         &rarr; self or nil<br />
146 </span>
147 </div>
148 <div class="method-description">
149 <p>
150 Prepare for the MD calculation. The angles and dihedrals may be rebuilt so that they are consistent with the bond information, and the impropers may be added where the corresponding improper parameters are defined (even if the force constant is zero). These result in the modification of the angle/dihedral/improper tables of the Molecule, which are undoable (see "<a href="Molecule.html#description-undo-support">Undo support</a>" of the Molecule document).
151 </p>
152 <p>
153 After the above rebuild is done, the MM parameters are looked for. If any necessary parameters are missing, then nil is returned at this point. If all parameters are found, and if the <code>check_only</code> argument is true, then self is returned at this point. Otherwise, the runtime fields for MM/MD calculation are initialized and self is returned.
154 </p>
155 </div>
156 </div>
157
158 <div id="method-M000044" class="method-detail">
159 <a name="M000044"></a>
160 <div class="method-heading">
161 <span class="method-name">run(n)       &rarr; self<br />
162 </span>
163 </div>
164 <div class="method-description">
165 <p>
166 Run the MD simulation for n steps.
167 </p>
168 </div>
169 </div>
170
171 <div id="method-M000050" class="method-detail">
172 <a name="M000050"></a>
173 <div class="method-heading">
174 <span class="method-name">to_hash &rarr; Hash<br />
175 </span>
176 </div>
177 <div class="method-description">
178 <p>
179 Returns a (frozen) hash that contains the current values of all attributes.
180 </p>
181 </div>
182 </div>
183
184 </div>
185
186 </div>
187
188 </body>
189 </html>