ImplicitSolventParameters.h 12.1 KB
Newer Older
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

/* Portions copyright (c) 2006 Stanford University and Simbios.
 * Contributors: Pande Group
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject
 * to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS, CONTRIBUTORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#ifndef __ImplicitSolventParameters_H__
#define __ImplicitSolventParameters_H__

#include "../SimTKUtilities/SimTKOpenMMRealType.h"
29
#include "../../../../openmmapi/include/openmm/internal/windowsExport.h"
30
31
32
33
#include <string>

// ---------------------------------------------------------------------------------------

34
class OPENMM_EXPORT ImplicitSolventParameters {
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

   protected:

      // parameters common to implicit solvent models
   
      RealOpenMM _solventDielectric;
      RealOpenMM _soluteDielectric;
      RealOpenMM _kcalA_To_kJNm;
      RealOpenMM _electricConstant;
      RealOpenMM _probeRadius;
      RealOpenMM _pi4Asolv;

      RealOpenMM _preFactor;
   
      // ---------------------------------------------------------------------------------------

      // atom count

      int _numberOfAtoms;

      // flag signalling whether arrays are to be freed

      int _freeArrays;

      // atomic radii

      int _ownAtomicRadii;
      RealOpenMM* _atomicRadii;

      /**---------------------------------------------------------------------------------------
      
         Initialize ImplicitSolvent Parameters (Simbios) 
      
         --------------------------------------------------------------------------------------- */
      
      void _initializeImplicitSolventConstants( void );

      /**---------------------------------------------------------------------------------------
      
         Set KcalA_To_kJNm
      
         @param kcalA_To_kJNm probe radius
      
         --------------------------------------------------------------------------------------- */
      
80
      void setKcalA_To_kJNm( RealOpenMM kcalA_To_kJNm );
81
82
83
84
85
86
87
88
89

      /**---------------------------------------------------------------------------------------
      
         Set free array flag -- if set then work arrays are freed when destructor is called
      
         @param freeArrays flag
      
         --------------------------------------------------------------------------------------- */

90
      void setFreeArrays( int freeArrays );
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

      /**---------------------------------------------------------------------------------------
      
         Reset prefactor (Simbios) 
      
         called when _electricConstant, _soluteDielectric, or _solventDielectric are modified
      
         --------------------------------------------------------------------------------------- */
      
      void _resetPreFactor( void );
      
   public:

      /**---------------------------------------------------------------------------------------
      
         ImplicitSolventParameters constructor (Simbios) 
      
         @param numberOfAtoms       number of atoms
      
         --------------------------------------------------------------------------------------- */
    
       ImplicitSolventParameters( int numberOfAtoms );

      /**---------------------------------------------------------------------------------------
      
         ImplicitSolventParameters destructor (Simbios) 
      
         --------------------------------------------------------------------------------------- */
    
120
       virtual ~ImplicitSolventParameters( );
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

      // override of new/delete

      //static void* operator new( size_t size );
      //static void  operator delete( void *p );

      //static void* operator new[]( size_t size );
      //static void  operator delete[]( void *p );

      /**---------------------------------------------------------------------------------------
      
         Get number of atoms
      
         @return number of atoms
      
         --------------------------------------------------------------------------------------- */
    
      int getNumberOfAtoms( void ) const;

      /**---------------------------------------------------------------------------------------
      
         Get free array flag -- if set then work arrays are freed when destructor is called
      
         @return freeArrays flag
      
         --------------------------------------------------------------------------------------- */
      
      int getFreeArrays( void ) const;

      /**---------------------------------------------------------------------------------------
      
         Get solvent dielectric
      
         @return solvent dielectric
      
         --------------------------------------------------------------------------------------- */
      
      RealOpenMM getSolventDielectric( void ) const;
      
      /**---------------------------------------------------------------------------------------
      
         Set solvent dielectric
      
         @param solventDielectric solvent dielectric
      
         --------------------------------------------------------------------------------------- */
      
168
      void setSolventDielectric( RealOpenMM solventDielectric );
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
      
      /**---------------------------------------------------------------------------------------
      
         Get solute dielectric
      
         @return soluteDielectric
      
         --------------------------------------------------------------------------------------- */
      
      RealOpenMM getSoluteDielectric( void ) const;
      
      /**---------------------------------------------------------------------------------------
      
         Set solute dielectric
      
         @param soluteDielectric solute dielectric
      
         --------------------------------------------------------------------------------------- */
      
188
      void setSoluteDielectric( RealOpenMM soluteDielectric );
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
      
      /**---------------------------------------------------------------------------------------
      
         Get conversion factor for kcal/A -> kJ/nm (Simbios) 
      
         @return kcalA_To_kJNm factor
      
         --------------------------------------------------------------------------------------- */
      
      RealOpenMM getKcalA_To_kJNm( void ) const;
      
      
      /**---------------------------------------------------------------------------------------
      
         Get electric constant (Simbios) 
      
         @return electricConstant
      
         --------------------------------------------------------------------------------------- */
      
      RealOpenMM getElectricConstant( void ) const;
      
      /**---------------------------------------------------------------------------------------
      
         Set electric constant (Simbios) 
      
         @param electricConstant       electric constant
      
         --------------------------------------------------------------------------------------- */
      
219
      void setElectricConstant( RealOpenMM electricConstant );
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238

      /**---------------------------------------------------------------------------------------
      
         Get probe radius (Simbios) 
      
         @return probeRadius
      
         --------------------------------------------------------------------------------------- */
      
      RealOpenMM getProbeRadius( void ) const;
      
      /**---------------------------------------------------------------------------------------
      
         Set probe radius (Simbios) 
      
         @param probeRadius   probe radius
      
         --------------------------------------------------------------------------------------- */
      
239
      void setProbeRadius( RealOpenMM probeRadius );
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
      
      /**---------------------------------------------------------------------------------------
      
         Get pi4Asolv:  used in ACE approximation for nonpolar term  
            ((RealOpenMM) M_PI)*4.0f*0.0049f*1000.0f; (Simbios) 
      
         @return pi4Asolv
      
         --------------------------------------------------------------------------------------- */
      
      RealOpenMM getPi4Asolv( void ) const;
      
      /**---------------------------------------------------------------------------------------
      
         Get prefactor
      
         @returnpreFactor 
      
         --------------------------------------------------------------------------------------- */
      
      RealOpenMM getPreFactor( void ) const;
      
      /**---------------------------------------------------------------------------------------
      
         Set values used in ACE approximation for nonpolar term
            ((RealOpenMM) M_PI)*4.0f*0.0049f*1000.0f; (Simbios) 
      
         @param pi4Asolv   see above
      
         --------------------------------------------------------------------------------------- */
      
271
      void setPi4Asolv( RealOpenMM pi4Asolv );
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
      
      /**---------------------------------------------------------------------------------------
      
         Get AtomicRadii array
      
         @return array of atom volumes
      
         --------------------------------------------------------------------------------------- */

      virtual RealOpenMM* getAtomicRadii( void ) const;

      /**---------------------------------------------------------------------------------------
      
         Set AtomicRadii array
      
         @param atomicRadii array of atomic radii
      
         --------------------------------------------------------------------------------------- */

291
      virtual void setAtomicRadii( RealOpenMM* atomicRadii );
292
293
294
295
296
297
298
299
300

      /**---------------------------------------------------------------------------------------
      
         Set AtomicRadii array
      
         @param atomicRadii vector of atomic radii
      
         --------------------------------------------------------------------------------------- */

301
      virtual void setAtomicRadii( const RealOpenMMVector& atomicRadii );
302
303
304
305
306
307
308
309
310
311
312
313
      
      /**---------------------------------------------------------------------------------------
      
         Set flag indicating whether AtomicRadii array is owned by
         object; if flag is set, then when the object is deleted,
         the array will be freed
      
         @param ownAtomicRadii flag indicating whether array of atomic radii
                               should be freed
      
         --------------------------------------------------------------------------------------- */

314
      void setOwnAtomicRadii( int ownAtomicRadii );
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340

      /**---------------------------------------------------------------------------------------
            
         Print state to log file (Simbios)
         
         @param title               title (optional)
            
         --------------------------------------------------------------------------------------- */
      
      virtual std::string getStateString( const char* title ) const;

      /**---------------------------------------------------------------------------------------
            
         Get string tab -- centralized
         
         @return tab string
            
         --------------------------------------------------------------------------------------- */
      
      std::string getStringTab( void ) const;
      
};

// ---------------------------------------------------------------------------------------

#endif // __ImplicitSolventParameters_H__