AmoebaWcaDispersionForceImpl.h 4.35 KB
Newer Older
Mark Friedrichs's avatar
Mark Friedrichs committed
1
2
3
4
#ifndef OPENMM_AMOEBA_WCA_DISPERSION_FORCE_IMPL_H_
#define OPENMM_AMOEBA_WCA_DISPERSION_FORCE_IMPL_H_

/* -------------------------------------------------------------------------- *
5
 *                                OpenMMAmoeba                                *
Mark Friedrichs's avatar
Mark Friedrichs committed
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
 * -------------------------------------------------------------------------- *
 * 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:                                                              *
 *                                                                            *
 * 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.                                     *
 * -------------------------------------------------------------------------- */

#include "openmm/internal/ForceImpl.h"
36
#include "openmm/AmoebaWcaDispersionForce.h"
Mark Friedrichs's avatar
Mark Friedrichs committed
37
38
39
40
41
42
43
44
45
46
47
#include "openmm/Kernel.h"
#include <utility>
#include <set>
#include <string>

namespace OpenMM {

/**
 * This is the internal implementation of AmoebaWcaDispersionForce.
 */

48
class OPENMM_EXPORT_AMOEBA AmoebaWcaDispersionForceImpl : public ForceImpl {
Mark Friedrichs's avatar
Mark Friedrichs committed
49
public:
50
    AmoebaWcaDispersionForceImpl(const AmoebaWcaDispersionForce& owner);
Mark Friedrichs's avatar
Mark Friedrichs committed
51
52
    ~AmoebaWcaDispersionForceImpl();
    void initialize(ContextImpl& context);
53
    const AmoebaWcaDispersionForce& getOwner() const {
Mark Friedrichs's avatar
Mark Friedrichs committed
54
55
        return owner;
    }
56
    void updateContextState(ContextImpl& context, bool& forcesInvalid) {
Mark Friedrichs's avatar
Mark Friedrichs committed
57
58
        // This force field doesn't update the state directly.
    }
59
    double calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy, int groups);
Mark Friedrichs's avatar
Mark Friedrichs committed
60
61
62
63
    std::map<std::string, double> getDefaultParameters() {
        return std::map<std::string, double>(); // This force field doesn't define any parameters.
    }
    std::vector<std::string> getKernelNames();
64
65
66
67
68
69
70
71

    /** 
     * Get the maximum dispersion energy for a particle
     * 
     * @param force               AmoebaWcaDispersionForce reference
     * @param particleIndex       the particle index
     * @param maxDispersionEnergy maximum dispersion energy
     */
72
    static void getMaximumDispersionEnergy(const AmoebaWcaDispersionForce& force, int particleIndex, double& maxDispersionEnergy);
73
74
75
76
77
78
79
80

    /** 
     * Get the total maximum dispersion energy
     * 
     * @param force               AmoebaWcaDispersionForce reference
     *
     * @return total maximum dispersion energy for the system
     */
81
    static double getTotalMaximumDispersionEnergy(const AmoebaWcaDispersionForce& force);
82
    void updateParametersInContext(ContextImpl& context);
83

Mark Friedrichs's avatar
Mark Friedrichs committed
84
private:
85
    const AmoebaWcaDispersionForce& owner;
Mark Friedrichs's avatar
Mark Friedrichs committed
86
87
88
89
90
91
    Kernel kernel;
};

} // namespace OpenMM

#endif /*OPENMM_AMOEBA_WCA_DISPERSION_FORCE_IMPL_H_*/