"plugins/normalModeLangevin/include/NMLKernels.h" did not exist on "cfcebe266cf5dc915dfc59470edc933161d6730d"
AmoebaInPlaneAngleForce.cpp 5.29 KB
Newer Older
Mark Friedrichs's avatar
Mark Friedrichs committed
1
/* -------------------------------------------------------------------------- *
2
 *                                OpenMMAmoeba                                *
Mark Friedrichs's avatar
Mark Friedrichs committed
3
4
5
6
7
8
 * -------------------------------------------------------------------------- *
 * 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.               *
 *                                                                            *
9
 * Portions copyright (c) 2008-2016 Stanford University and the Authors.      *
Mark Friedrichs's avatar
Mark Friedrichs committed
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 * 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/Force.h"
#include "openmm/OpenMMException.h"
34
35
#include "openmm/AmoebaInPlaneAngleForce.h"
#include "openmm/internal/AmoebaInPlaneAngleForceImpl.h"
Mark Friedrichs's avatar
Mark Friedrichs committed
36
37
38

using namespace OpenMM;

39
AmoebaInPlaneAngleForce::AmoebaInPlaneAngleForce() : usePeriodic(false) {
Mark Friedrichs's avatar
Mark Friedrichs committed
40
41
42
    _globalCubicK = _globalQuarticK = _globalPenticK = _globalSexticK = 0.0;
}

43
44
int AmoebaInPlaneAngleForce::addAngle(int particle1, int particle2, int particle3, int particle4,  double length, double quadraticK) {
    angles.push_back(AngleInfo(particle1, particle2, particle3, particle4, length, quadraticK));
Mark Friedrichs's avatar
Mark Friedrichs committed
45
46
47
    return angles.size()-1;
}

48
void AmoebaInPlaneAngleForce::getAngleParameters(int index, int& particle1, int& particle2, int& particle3, int& particle4,
49
                                                  double& length, double&  quadraticK) const {
Mark Friedrichs's avatar
Mark Friedrichs committed
50
51
52
53
54
55
56
57
    particle1       = angles[index].particle1;
    particle2       = angles[index].particle2;
    particle3       = angles[index].particle3;
    particle4       = angles[index].particle4;
    length          = angles[index].length;
    quadraticK      = angles[index].quadraticK;
}

58
void AmoebaInPlaneAngleForce::setAngleParameters(int index, int particle1, int particle2, int particle3, int particle4,
59
                                                    double length, double quadraticK) {
Mark Friedrichs's avatar
Mark Friedrichs committed
60
61
62
63
64
65
66
67
    angles[index].particle1  = particle1;
    angles[index].particle2  = particle2;
    angles[index].particle3  = particle3;
    angles[index].particle4  = particle4;
    angles[index].length     = length;
    angles[index].quadraticK = quadraticK;
}

68
void AmoebaInPlaneAngleForce::setAmoebaGlobalInPlaneAngleCubic(double cubicK) {
Mark Friedrichs's avatar
Mark Friedrichs committed
69
70
71
    _globalCubicK           = cubicK;
}

72
void AmoebaInPlaneAngleForce::setAmoebaGlobalInPlaneAngleQuartic(double quarticK) {
Mark Friedrichs's avatar
Mark Friedrichs committed
73
74
75
    _globalQuarticK         = quarticK;
}

peastman's avatar
peastman committed
76
double AmoebaInPlaneAngleForce::getAmoebaGlobalInPlaneAngleCubic() const {
Mark Friedrichs's avatar
Mark Friedrichs committed
77
78
79
    return _globalCubicK;
}

peastman's avatar
peastman committed
80
double AmoebaInPlaneAngleForce::getAmoebaGlobalInPlaneAngleQuartic() const {
Mark Friedrichs's avatar
Mark Friedrichs committed
81
82
83
    return _globalQuarticK;
}

84
void AmoebaInPlaneAngleForce::setAmoebaGlobalInPlaneAnglePentic(double cubicK) {
Mark Friedrichs's avatar
Mark Friedrichs committed
85
86
87
    _globalPenticK           = cubicK;
}

88
void AmoebaInPlaneAngleForce::setAmoebaGlobalInPlaneAngleSextic(double quarticK) {
Mark Friedrichs's avatar
Mark Friedrichs committed
89
90
91
    _globalSexticK         = quarticK;
}

peastman's avatar
peastman committed
92
double AmoebaInPlaneAngleForce::getAmoebaGlobalInPlaneAnglePentic() const {
Mark Friedrichs's avatar
Mark Friedrichs committed
93
94
95
    return _globalPenticK;
}

peastman's avatar
peastman committed
96
double AmoebaInPlaneAngleForce::getAmoebaGlobalInPlaneAngleSextic() const {
Mark Friedrichs's avatar
Mark Friedrichs committed
97
98
99
    return _globalSexticK;
}

100
ForceImpl* AmoebaInPlaneAngleForce::createImpl() const {
101
    return new AmoebaInPlaneAngleForceImpl(*this);
Mark Friedrichs's avatar
Mark Friedrichs committed
102
}
103
104
105
106

void AmoebaInPlaneAngleForce::updateParametersInContext(Context& context) {
    dynamic_cast<AmoebaInPlaneAngleForceImpl&>(getImplInContext(context)).updateParametersInContext(getContextImpl(context));
}
107
108
109
110
111
112
113
114

void AmoebaInPlaneAngleForce::setUsesPeriodicBoundaryConditions(bool periodic) {
    usePeriodic = periodic;
}

bool AmoebaInPlaneAngleForce::usesPeriodicBoundaryConditions() const {
    return usePeriodic;
}