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
29
30
31
32
33
34
35
36
37
38 package ffx.openmm;
39
40 import static edu.uiowa.jopenmm.OpenMMLibrary.OpenMM_CustomNonbondedForce_addExclusion;
41 import static edu.uiowa.jopenmm.OpenMMLibrary.OpenMM_CustomNonbondedForce_addGlobalParameter;
42 import static edu.uiowa.jopenmm.OpenMMLibrary.OpenMM_CustomNonbondedForce_addInteractionGroup;
43 import static edu.uiowa.jopenmm.OpenMMLibrary.OpenMM_CustomNonbondedForce_addParticle;
44 import static edu.uiowa.jopenmm.OpenMMLibrary.OpenMM_CustomNonbondedForce_addPerParticleParameter;
45 import static edu.uiowa.jopenmm.OpenMMLibrary.OpenMM_CustomNonbondedForce_create;
46 import static edu.uiowa.jopenmm.OpenMMLibrary.OpenMM_CustomNonbondedForce_destroy;
47 import static edu.uiowa.jopenmm.OpenMMLibrary.OpenMM_CustomNonbondedForce_setCutoffDistance;
48 import static edu.uiowa.jopenmm.OpenMMLibrary.OpenMM_CustomNonbondedForce_setNonbondedMethod;
49 import static edu.uiowa.jopenmm.OpenMMLibrary.OpenMM_CustomNonbondedForce_setSwitchingDistance;
50 import static edu.uiowa.jopenmm.OpenMMLibrary.OpenMM_CustomNonbondedForce_setUseSwitchingFunction;
51
52
53
54
55 public class CustomNonbondedForce extends Force {
56
57 public CustomNonbondedForce(String energy) {
58 pointer = OpenMM_CustomNonbondedForce_create(energy);
59 }
60
61
62
63
64
65
66
67 public void addGlobalParameter(String name, double value) {
68 OpenMM_CustomNonbondedForce_addGlobalParameter(pointer, name, value);
69 }
70
71
72
73
74
75
76 public void addPerParticleParameter(String name) {
77 OpenMM_CustomNonbondedForce_addPerParticleParameter(pointer, name);
78 }
79
80
81
82
83
84
85 public void addParticle(DoubleArray parameters) {
86 OpenMM_CustomNonbondedForce_addParticle(pointer, parameters.getPointer());
87 }
88
89
90
91
92
93
94
95 public void addInteractionGroup(IntSet group1, IntSet group2) {
96 OpenMM_CustomNonbondedForce_addInteractionGroup(pointer, group1.getPointer(), group2.getPointer());
97 }
98
99
100
101
102
103
104 public void setNonbondedMethod(int method) {
105 OpenMM_CustomNonbondedForce_setNonbondedMethod(pointer, method);
106 }
107
108
109
110
111
112
113 public void setCutoffDistance(double off) {
114 OpenMM_CustomNonbondedForce_setCutoffDistance(pointer, off);
115 }
116
117
118
119
120
121
122 public void setUseSwitchingFunction(int useSwitchingFunction) {
123 OpenMM_CustomNonbondedForce_setUseSwitchingFunction(pointer, useSwitchingFunction);
124 }
125
126
127
128
129
130
131 public void setSwitchingDistance(double switchingDistance) {
132 OpenMM_CustomNonbondedForce_setSwitchingDistance(pointer, switchingDistance);
133 }
134
135
136
137
138
139
140
141 public void addExclusion(int particle1, int particle2) {
142 OpenMM_CustomNonbondedForce_addExclusion(pointer, particle1, particle2);
143 }
144
145
146
147
148 public void destroy() {
149 if (pointer != null) {
150 OpenMM_CustomNonbondedForce_destroy(pointer);
151 pointer = null;
152 }
153 }
154 }