AmoebaReferenceKernels.h 24.9 KB
Newer Older
1
2
3
4
#ifndef AMOEBA_OPENMM_REFERENCE_KERNELS_H_
#define AMOEBA_OPENMM_REFERENCE_KERNELS_H_

/* -------------------------------------------------------------------------- *
5
 *                              OpenMMAmoeba                                  *
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
 * -------------------------------------------------------------------------- *
 * This is part of the OpenMM molecular simulation toolkit originating from   *
 * Simbios, the NIH National Center for Physics-Based Simulation of           *
 * Biological Structures at Stanford, funded under the NIH Roadmap for        *
 * Medical Research, grant U54 GM072970. See https://simtk.org.               *
 *                                                                            *
 * Portions copyright (c) 2008 Stanford University and the Authors.           *
 * Authors:                                                                   *
 * Contributors:                                                              *
 *                                                                            *
 * This program is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.                        *
 *                                                                            *
 * You should have received a copy of the GNU Lesser General Public License   *
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.      *
 * -------------------------------------------------------------------------- */

#include "openmm/System.h"
31
#include "openmm/amoebaKernels.h"
32
33
#include "openmm/AmoebaMultipoleForce.h"
#include "AmoebaReferenceMultipoleForce.h"
34
#include "SimTKReference/ReferenceNeighborList.h"
35
36
37
38
39
#include "SimTKUtilities/SimTKOpenMMRealType.h"

namespace OpenMM {

/**
40
 * This kernel is invoked by AmoebaBondForce to calculate the forces acting on the system and the energy of the system.
41
 */
42
class ReferenceCalcAmoebaBondForceKernel : public CalcAmoebaBondForceKernel {
43
public:
44
    ReferenceCalcAmoebaBondForceKernel(std::string name, 
45
                                               const Platform& platform,
46
                                               const System& system);
47
    ~ReferenceCalcAmoebaBondForceKernel();
48
49
50
51
    /**
     * Initialize the kernel.
     * 
     * @param system     the System this kernel will be applied to
52
     * @param force      the AmoebaBondForce this kernel will be used for
53
     */
54
    void initialize(const System& system, const AmoebaBondForce& force);
55
56
57
58
59
60
61
62
63
    /**
     * Execute the kernel to calculate the forces and/or energy.
     *
     * @param context        the context in which to execute this kernel
     * @param includeForces  true if forces should be calculated
     * @param includeEnergy  true if the energy should be calculated
     * @return the potential energy due to the force
     */
    double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
64
65
66
67
68
69
70
    /**
     * Copy changed parameters over to a context.
     *
     * @param context    the context to copy parameters to
     * @param force      the AmoebaBondForce to copy the parameters from
     */
    void copyParametersToContext(ContextImpl& context, const AmoebaBondForce& force);
71
72
73
74
75
76
private:
    int numBonds;
    std::vector<int>   particle1;
    std::vector<int>   particle2;
    std::vector<RealOpenMM> length;
    std::vector<RealOpenMM> kQuadratic;
77
78
    RealOpenMM globalBondCubic;
    RealOpenMM globalBondQuartic;
79
    const System& system;
80
81
82
};

/**
83
 * This kernel is invoked by AmoebaAngleForce to calculate the forces acting on the system and the energy of the system.
84
 */
85
class ReferenceCalcAmoebaAngleForceKernel : public CalcAmoebaAngleForceKernel {
86
public:
87
    ReferenceCalcAmoebaAngleForceKernel(std::string name, const Platform& platform, const System& system);
88
    ~ReferenceCalcAmoebaAngleForceKernel();
89
90
91
92
    /**
     * Initialize the kernel.
     * 
     * @param system     the System this kernel will be applied to
93
     * @param force      the AmoebaAngleForce this kernel will be used for
94
     */
95
    void initialize(const System& system, const AmoebaAngleForce& force);
96
97
98
99
100
101
102
103
104
    /**
     * Execute the kernel to calculate the forces and/or energy.
     *
     * @param context        the context in which to execute this kernel
     * @param includeForces  true if forces should be calculated
     * @param includeEnergy  true if the energy should be calculated
     * @return the potential energy due to the force
     */
    double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
105
106
107
108
109
110
111
    /**
     * Copy changed parameters over to a context.
     *
     * @param context    the context to copy parameters to
     * @param force      the AmoebaAngleForce to copy the parameters from
     */
    void copyParametersToContext(ContextImpl& context, const AmoebaAngleForce& force);
112
113
114
115
116
117
118
private:
    int numAngles;
    std::vector<int>   particle1;
    std::vector<int>   particle2;
    std::vector<int>   particle3;
    std::vector<RealOpenMM> angle;
    std::vector<RealOpenMM> kQuadratic;
119
120
121
122
    RealOpenMM globalAngleCubic;
    RealOpenMM globalAngleQuartic;
    RealOpenMM globalAnglePentic;
    RealOpenMM globalAngleSextic;
123
    const System& system;
124
125
};

126
/**
127
 * This kernel is invoked by AmoebaInPlaneAngleForce to calculate the forces acting on the system and the energy of the system.
128
 */
129
class ReferenceCalcAmoebaInPlaneAngleForceKernel : public CalcAmoebaInPlaneAngleForceKernel {
130
public:
131
    ReferenceCalcAmoebaInPlaneAngleForceKernel(std::string name, const Platform& platform, const System& system);
132
    ~ReferenceCalcAmoebaInPlaneAngleForceKernel();
133
134
135
136
    /**
     * Initialize the kernel.
     * 
     * @param system     the System this kernel will be applied to
137
     * @param force      the AmoebaInPlaneAngleForce this kernel will be used for
138
     */
139
    void initialize(const System& system, const AmoebaInPlaneAngleForce& force);
140
141
142
143
144
145
146
147
148
    /**
     * Execute the kernel to calculate the forces and/or energy.
     *
     * @param context        the context in which to execute this kernel
     * @param includeForces  true if forces should be calculated
     * @param includeEnergy  true if the energy should be calculated
     * @return the potential energy due to the force
     */
    double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
149
150
151
152
153
154
155
    /**
     * Copy changed parameters over to a context.
     *
     * @param context    the context to copy parameters to
     * @param force      the AmoebaInPlaneAngleForce to copy the parameters from
     */
    void copyParametersToContext(ContextImpl& context, const AmoebaInPlaneAngleForce& force);
156
157
158
159
160
161
162
163
private:
    int numAngles;
    std::vector<int>   particle1;
    std::vector<int>   particle2;
    std::vector<int>   particle3;
    std::vector<int>   particle4;
    std::vector<RealOpenMM> angle;
    std::vector<RealOpenMM> kQuadratic;
164
165
166
167
    RealOpenMM globalInPlaneAngleCubic;
    RealOpenMM globalInPlaneAngleQuartic;
    RealOpenMM globalInPlaneAnglePentic;
    RealOpenMM globalInPlaneAngleSextic;
168
    const System& system;
169
170
};

171
172
173
174
175
/**
 * This kernel is invoked by AmoebaPiTorsionForce to calculate the forces acting on the system and the energy of the system.
 */
class ReferenceCalcAmoebaPiTorsionForceKernel : public CalcAmoebaPiTorsionForceKernel {
public:
176
    ReferenceCalcAmoebaPiTorsionForceKernel(std::string name, const Platform& platform, const System& system);
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
    ~ReferenceCalcAmoebaPiTorsionForceKernel();
    /**
     * Initialize the kernel.
     * 
     * @param system     the System this kernel will be applied to
     * @param force      the AmoebaPiTorsionForce this kernel will be used for
     */
    void initialize(const System& system, const AmoebaPiTorsionForce& force);
    /**
     * Execute the kernel to calculate the forces and/or energy.
     *
     * @param context        the context in which to execute this kernel
     * @param includeForces  true if forces should be calculated
     * @param includeEnergy  true if the energy should be calculated
     * @return the potential energy due to the force
     */
    double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
194
195
196
197
198
199
200
    /**
     * Copy changed parameters over to a context.
     *
     * @param context    the context to copy parameters to
     * @param force      the AmoebaPiTorsionForce to copy the parameters from
     */
    void copyParametersToContext(ContextImpl& context, const AmoebaPiTorsionForce& force);
201
202
203
204
205
206
207
208
209
private:
    int numPiTorsions;
    std::vector<int>   particle1;
    std::vector<int>   particle2;
    std::vector<int>   particle3;
    std::vector<int>   particle4;
    std::vector<int>   particle5;
    std::vector<int>   particle6;
    std::vector<RealOpenMM> kTorsion;
210
    const System& system;
211
212
};

213
214
215
216
217
/**
 * This kernel is invoked by AmoebaStretchBendForce to calculate the forces acting on the system and the energy of the system.
 */
class ReferenceCalcAmoebaStretchBendForceKernel : public CalcAmoebaStretchBendForceKernel {
public:
218
    ReferenceCalcAmoebaStretchBendForceKernel(std::string name, const Platform& platform, const System& system);
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
    ~ReferenceCalcAmoebaStretchBendForceKernel();
    /**
     * Initialize the kernel.
     * 
     * @param system     the System this kernel will be applied to
     * @param force      the AmoebaStretchBendForce this kernel will be used for
     */
    void initialize(const System& system, const AmoebaStretchBendForce& force);
    /**
     * Execute the kernel to calculate the forces and/or energy.
     *
     * @param context        the context in which to execute this kernel
     * @param includeForces  true if forces should be calculated
     * @param includeEnergy  true if the energy should be calculated
     * @return the potential energy due to the force
     */
    double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
236
237
238
239
240
241
242
    /**
     * Copy changed parameters over to a context.
     *
     * @param context    the context to copy parameters to
     * @param force      the AmoebaStretchBendForce to copy the parameters from
     */
    void copyParametersToContext(ContextImpl& context, const AmoebaStretchBendForce& force);
243
244
245
246
247
248
249
250
251
private:
    int numStretchBends;
    std::vector<int>   particle1;
    std::vector<int>   particle2;
    std::vector<int>   particle3;
    std::vector<RealOpenMM> lengthABParameters;
    std::vector<RealOpenMM> lengthCBParameters;
    std::vector<RealOpenMM> angleParameters;
    std::vector<RealOpenMM> kParameters;
252
    const System& system;
253
};
254
255
256
257
258
259

/**
 * This kernel is invoked by AmoebaOutOfPlaneBendForce to calculate the forces acting on the system and the energy of the system.
 */
class ReferenceCalcAmoebaOutOfPlaneBendForceKernel : public CalcAmoebaOutOfPlaneBendForceKernel {
public:
260
    ReferenceCalcAmoebaOutOfPlaneBendForceKernel(std::string name, const Platform& platform, const System& system);
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
    ~ReferenceCalcAmoebaOutOfPlaneBendForceKernel();
    /**
     * Initialize the kernel.
     * 
     * @param system     the System this kernel will be applied to
     * @param force      the AmoebaOutOfPlaneBendForce this kernel will be used for
     */
    void initialize(const System& system, const AmoebaOutOfPlaneBendForce& force);
    /**
     * Execute the kernel to calculate the forces and/or energy.
     *
     * @param context        the context in which to execute this kernel
     * @param includeForces  true if forces should be calculated
     * @param includeEnergy  true if the energy should be calculated
     * @return the potential energy due to the force
     */
    double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
278
279
280
281
282
283
284
    /**
     * Copy changed parameters over to a context.
     *
     * @param context    the context to copy parameters to
     * @param force      the AmoebaOutOfPlaneBendForce to copy the parameters from
     */
    void copyParametersToContext(ContextImpl& context, const AmoebaOutOfPlaneBendForce& force);
285
286
287
288
289
290
291
292
293
294
295
private:
    int numOutOfPlaneBends;
    std::vector<int>   particle1;
    std::vector<int>   particle2;
    std::vector<int>   particle3;
    std::vector<int>   particle4;
    std::vector<RealOpenMM> kParameters;
    RealOpenMM globalOutOfPlaneBendAngleCubic;
    RealOpenMM globalOutOfPlaneBendAngleQuartic;
    RealOpenMM globalOutOfPlaneBendAnglePentic;
    RealOpenMM globalOutOfPlaneBendAngleSextic;
296
    const System& system;
297
298
};

299
300
301
302
303
/**
 * This kernel is invoked by AmoebaTorsionTorsionForce to calculate the forces acting on the system and the energy of the system.
 */
class ReferenceCalcAmoebaTorsionTorsionForceKernel : public CalcAmoebaTorsionTorsionForceKernel {
public:
304
    ReferenceCalcAmoebaTorsionTorsionForceKernel(std::string name, const Platform& platform, const System& system);
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
    ~ReferenceCalcAmoebaTorsionTorsionForceKernel();
    /**
     * Initialize the kernel.
     * 
     * @param system     the System this kernel will be applied to
     * @param force      the AmoebaTorsionTorsionForce this kernel will be used for
     */
    void initialize(const System& system, const AmoebaTorsionTorsionForce& force);
    /**
     * Execute the kernel to calculate the forces and/or energy.
     *
     * @param context        the context in which to execute this kernel
     * @param includeForces  true if forces should be calculated
     * @param includeEnergy  true if the energy should be calculated
     * @return the potential energy due to the force
     */
    double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
    int numTorsionTorsions;
    std::vector<int>   particle1;
    std::vector<int>   particle2;
    std::vector<int>   particle3;
    std::vector<int>   particle4;
    std::vector<int>   particle5;
    std::vector<int>   chiralCheckAtom;
    std::vector<int>   gridIndices;

    int numTorsionTorsionGrids;
    std::vector< std::vector< std::vector< std::vector<RealOpenMM> > > > torsionTorsionGrids;

335
    const System& system;
336
337
};

338
339
340
341
342
/**
 * This kernel is invoked by AmoebaMultipoleForce to calculate the forces acting on the system and the energy of the system.
 */
class ReferenceCalcAmoebaMultipoleForceKernel : public CalcAmoebaMultipoleForceKernel {
public:
343
    ReferenceCalcAmoebaMultipoleForceKernel(std::string name, const Platform& platform, const System& system);
344
345
346
347
348
349
350
351
    ~ReferenceCalcAmoebaMultipoleForceKernel();
    /**
     * Initialize the kernel.
     * 
     * @param system     the System this kernel will be applied to
     * @param force      the AmoebaMultipoleForce this kernel will be used for
     */
    void initialize(const System& system, const AmoebaMultipoleForce& force);
352
353
354
355
356
357
358
359
    /**
     * Setup for AmoebaReferenceMultipoleForce instance. 
     *
     * @param context        the current context
     *
     * @return pointer to initialized instance of AmoebaReferenceMultipoleForce
     */
    AmoebaReferenceMultipoleForce* setupAmoebaReferenceMultipoleForce(ContextImpl& context );
360
361
362
363
364
365
366
367
368
    /**
     * Execute the kernel to calculate the forces and/or energy.
     *
     * @param context        the context in which to execute this kernel
     * @param includeForces  true if forces should be calculated
     * @param includeEnergy  true if the energy should be calculated
     * @return the potential energy due to the force
     */
    double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
369
    /** 
370
     * Calculate the electrostatic potential given vector of grid coordinates.
371
     *
372
373
     * @param context                      context
     * @param inputGrid                    input grid coordinates
374
375
376
377
     * @param outputElectrostaticPotential output potential 
     */
    void getElectrostaticPotential(ContextImpl& context, const std::vector< Vec3 >& inputGrid,
                                   std::vector< double >& outputElectrostaticPotential );
378
379

    /**
380
     * Get the system multipole moments.
381
     *
382
383
384
     * @param context                context 
     * @param outputMultipoleMonents vector of multipole moments:
                                     (charge,
385
386
387
388
389
                                      dipole_x, dipole_y, dipole_z,
                                      quadrupole_xx, quadrupole_xy, quadrupole_xz,
                                      quadrupole_yx, quadrupole_yy, quadrupole_yz,
                                      quadrupole_zx, quadrupole_zy, quadrupole_zz )
     */
Lee-Ping Wang's avatar
Lee-Ping Wang committed
390
    void getSystemMultipoleMoments(ContextImpl& context, std::vector< double >& outputMultipoleMoments);
391
392
393
394
395
396
397
    /**
     * Copy changed parameters over to a context.
     *
     * @param context    the context to copy parameters to
     * @param force      the AmoebaMultipoleForce to copy the parameters from
     */
    void copyParametersToContext(ContextImpl& context, const AmoebaMultipoleForce& force);
398

399
private:
400

401
    int numMultipoles;
402
    AmoebaMultipoleForce::NonbondedMethod nonbondedMethod;
403
    AmoebaMultipoleForce::PolarizationType polarizationType;
404
405
406
407
408
409
410
    std::vector<RealOpenMM> charges;
    std::vector<RealOpenMM> dipoles;
    std::vector<RealOpenMM> quadrupoles;
    std::vector<RealOpenMM> tholes;
    std::vector<RealOpenMM> dampingFactors;
    std::vector<RealOpenMM> polarity;
    std::vector<int>   axisTypes;
411
412
413
    std::vector<int>   multipoleAtomZs;
    std::vector<int>   multipoleAtomXs;
    std::vector<int>   multipoleAtomYs;
414
415
416
417
418
    std::vector< std::vector< std::vector<int> > > multipoleAtomCovalentInfo;

    int mutualInducedMaxIterations;
    RealOpenMM mutualInducedTargetEpsilon;

419
420
421
422
423
    bool usePme;
    RealOpenMM alphaEwald;
    RealOpenMM cutoffDistance;
    std::vector<int> pmeGridDimension;

424
    const System& system;
425
426
};

Mark Friedrichs's avatar
Mark Friedrichs committed
427
428
429
430
431
/**
 * This kernel is invoked to calculate the vdw forces acting on the system and the energy of the system.
 */
class ReferenceCalcAmoebaVdwForceKernel : public CalcAmoebaVdwForceKernel {
public:
432
    ReferenceCalcAmoebaVdwForceKernel(std::string name, const Platform& platform, const System& system);
Mark Friedrichs's avatar
Mark Friedrichs committed
433
434
435
436
437
    ~ReferenceCalcAmoebaVdwForceKernel();
    /**
     * Initialize the kernel.
     * 
     * @param system     the System this kernel will be applied to
438
     * @param force      the AmoebaVdwForce this kernel will be used for
Mark Friedrichs's avatar
Mark Friedrichs committed
439
440
441
442
443
444
445
446
447
448
449
     */
    void initialize(const System& system, const AmoebaVdwForce& force);
    /**
     * Execute the kernel to calculate the forces and/or energy.
     *
     * @param context        the context in which to execute this kernel
     * @param includeForces  true if forces should be calculated
     * @param includeEnergy  true if the energy should be calculated
     * @return the potential energy due to the force
     */
    double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
450
451
452
453
454
455
456
    /**
     * Copy changed parameters over to a context.
     *
     * @param context    the context to copy parameters to
     * @param force      the AmoebaVdwForce to copy the parameters from
     */
    void copyParametersToContext(ContextImpl& context, const AmoebaVdwForce& force);
Mark Friedrichs's avatar
Mark Friedrichs committed
457
458
private:
    int numParticles;
459
    int useCutoff;
460
461
    int usePBC;
    double cutoff;
462
    double dispersionCoefficient;
Mark Friedrichs's avatar
Mark Friedrichs committed
463
    std::vector<int> indexIVs;
464
    std::vector< std::set<int> > allExclusions;
Mark Friedrichs's avatar
Mark Friedrichs committed
465
466
467
468
469
    std::vector<RealOpenMM> sigmas;
    std::vector<RealOpenMM> epsilons;
    std::vector<RealOpenMM> reductions;
    std::string sigmaCombiningRule;
    std::string epsilonCombiningRule;
470
    const System& system;
471
    NeighborList* neighborList;
Mark Friedrichs's avatar
Mark Friedrichs committed
472
473
};

Mark Friedrichs's avatar
Mark Friedrichs committed
474
475
476
477
478
/**
 * This kernel is invoked to calculate the WCA dispersion forces acting on the system and the energy of the system.
 */
class ReferenceCalcAmoebaWcaDispersionForceKernel : public CalcAmoebaWcaDispersionForceKernel {
public:
479
    ReferenceCalcAmoebaWcaDispersionForceKernel(std::string name, const Platform& platform, const System& system);
Mark Friedrichs's avatar
Mark Friedrichs committed
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
    ~ReferenceCalcAmoebaWcaDispersionForceKernel();
    /**
     * Initialize the kernel.
     * 
     * @param system     the System this kernel will be applied to
     * @param force      the AmoebaMultipoleForce this kernel will be used for
     */
    void initialize(const System& system, const AmoebaWcaDispersionForce& force);
    /**
     * Execute the kernel to calculate the forces and/or energy.
     *
     * @param context        the context in which to execute this kernel
     * @param includeForces  true if forces should be calculated
     * @param includeEnergy  true if the energy should be calculated
     * @return the potential energy due to the force
     */
    double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
497
498
499
500
501
502
503
    /**
     * Copy changed parameters over to a context.
     *
     * @param context    the context to copy parameters to
     * @param force      the AmoebaWcaDispersionForce to copy the parameters from
     */
    void copyParametersToContext(ContextImpl& context, const AmoebaWcaDispersionForce& force);
Mark Friedrichs's avatar
Mark Friedrichs committed
504
505
506
507
508
509
510
511
512
513
514
515
516
517
private:

    int numParticles;
    std::vector<RealOpenMM> radii;
    std::vector<RealOpenMM> epsilons;
    RealOpenMM epso; 
    RealOpenMM epsh; 
    RealOpenMM rmino; 
    RealOpenMM rminh; 
    RealOpenMM awater; 
    RealOpenMM shctd; 
    RealOpenMM dispoff;
    RealOpenMM slevy;
    RealOpenMM totalMaximumDispersionEnergy;
518
    const System& system;
Mark Friedrichs's avatar
Mark Friedrichs committed
519
};
520

521
522
523
524
525
/**
 * This kernel is invoked to calculate the Gerneralized Kirkwood forces acting on the system and the energy of the system.
 */
class ReferenceCalcAmoebaGeneralizedKirkwoodForceKernel : public CalcAmoebaGeneralizedKirkwoodForceKernel {
public:
526
    ReferenceCalcAmoebaGeneralizedKirkwoodForceKernel(std::string name, const Platform& platform, const System& system);
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
    ~ReferenceCalcAmoebaGeneralizedKirkwoodForceKernel();
    /**
     * Initialize the kernel.
     * 
     * @param system     the System this kernel will be applied to
     * @param force      the AmoebaMultipoleForce this kernel will be used for
     */
    void initialize(const System& system, const AmoebaGeneralizedKirkwoodForce& force);
    /**
     * Execute the kernel to calculate the forces and/or energy.
     *
     * @param context        the context in which to execute this kernel
     * @param includeForces  true if forces should be calculated
     * @param includeEnergy  true if the energy should be calculated
     * @return the potential energy due to the force
     */
    double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
 
    /**
546
     *  Get the 'include cavity term' flag.
547
548
549
550
551
552
     *
     *  @return includeCavityTerm
     */
    int getIncludeCavityTerm( void ) const;

    /**
553
     *  Get the number of particles.
554
555
556
557
558
559
     *
     *  @return number of particles
     */
    int getNumParticles( void ) const;

    /**
560
     *  Get Direct Polarization flag.
561
562
563
564
565
566
567
     *
     *  @return directPolarization
     *
     */
    int getDirectPolarization( void ) const;

    /**
568
     *  Get the solute dielectric.
569
570
571
572
573
574
575
     *
     *  @return soluteDielectric
     *
     */
    RealOpenMM getSoluteDielectric( void ) const;

    /**
576
     *  Get the solvent dielectric.
577
578
579
580
581
582
583
     *
     *  @return solventDielectric
     *
     */
    RealOpenMM getSolventDielectric( void ) const;

    /**
584
     *  Get the dielectric offset.
585
586
587
588
589
590
591
     *
     *  @return dielectricOffset
     *
     */
    RealOpenMM getDielectricOffset( void ) const;

    /**
592
     *  Get the probe radius.
593
594
595
596
597
598
599
     *
     *  @return probeRadius
     *
     */
    RealOpenMM getProbeRadius( void ) const;

    /**
600
     *  Get the surface area factor.
601
602
603
604
605
606
607
     *
     *  @return surfaceAreaFactor
     *
     */
    RealOpenMM getSurfaceAreaFactor( void ) const;

    /**
608
     *  Get the vector of particle radii.
609
610
611
612
613
614
615
     *
     *  @param atomicRadii vector of atomic radii
     *
     */
    void getAtomicRadii( std::vector<RealOpenMM>& atomicRadii ) const;

    /**
616
     *  Get the vector of scale factors.
617
618
619
620
621
622
623
     *
     *  @param scaleFactors vector of scale factors
     *
     */
    void getScaleFactors( std::vector<RealOpenMM>& scaleFactors ) const;

    /**
624
     *  Get the vector of charges.
625
626
627
628
629
630
     *
     *  @param charges vector of charges
     *
     */
    void getCharges( std::vector<RealOpenMM>& charges ) const;

631
632
633
634
635
636
637
638
    /**
     * Copy changed parameters over to a context.
     *
     * @param context    the context to copy parameters to
     * @param force      the AmoebaGeneralizedKirkwoodForce to copy the parameters from
     */
    void copyParametersToContext(ContextImpl& context, const AmoebaGeneralizedKirkwoodForce& force);

639
640
641
642
643
644
645
646
647
648
649
650
651
private:

    int numParticles;
    std::vector<RealOpenMM> atomicRadii;
    std::vector<RealOpenMM> scaleFactors;
    std::vector<RealOpenMM> charges;
    RealOpenMM soluteDielectric;
    RealOpenMM solventDielectric;
    RealOpenMM dielectricOffset;
    RealOpenMM probeRadius;
    RealOpenMM surfaceAreaFactor;
    int includeCavityTerm;
    int directPolarization;
652
    const System& system;
653
654
};

655
656
657
} // namespace OpenMM

#endif /*AMOEBA_OPENMM_REFERENCE_KERNELS_H*/