View Javadoc
1   // ******************************************************************************
2   //
3   // Title:       Force Field X.
4   // Description: Force Field X - Software for Molecular Biophysics.
5   // Copyright:   Copyright (c) Michael J. Schnieders 2001-2024.
6   //
7   // This file is part of Force Field X.
8   //
9   // Force Field X is free software; you can redistribute it and/or modify it
10  // under the terms of the GNU General Public License version 3 as published by
11  // the Free Software Foundation.
12  //
13  // Force Field X is distributed in the hope that it will be useful, but WITHOUT
14  // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15  // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16  // details.
17  //
18  // You should have received a copy of the GNU General Public License along with
19  // Force Field X; if not, write to the Free Software Foundation, Inc., 59 Temple
20  // Place, Suite 330, Boston, MA 02111-1307 USA
21  //
22  // Linking this library statically or dynamically with other modules is making a
23  // combined work based on this library. Thus, the terms and conditions of the
24  // GNU General Public License cover the whole combination.
25  //
26  // As a special exception, the copyright holders of this library give you
27  // permission to link this library with independent modules to produce an
28  // executable, regardless of the license terms of these independent modules, and
29  // to copy and distribute the resulting executable under terms of your choice,
30  // provided that you also meet, for each linked independent module, the terms
31  // and conditions of the license of that module. An independent module is a
32  // module which is not derived from or based on this library. If you modify this
33  // library, you may extend this exception to your version of the library, but
34  // you are not obligated to do so. If you do not wish to do so, delete this
35  // exception statement from your version.
36  //
37  // ******************************************************************************
38  package ffx.potential.groovy;
39  
40  import org.junit.runner.RunWith;
41  import org.junit.runners.Parameterized;
42  import org.junit.runners.Parameterized.Parameters;
43  
44  import java.util.Arrays;
45  import java.util.Collection;
46  
47  /**
48   * Test the Energy script.
49   */
50  @RunWith(Parameterized.class)
51  public class EnergyTest extends ParentEnergyTest {
52  
53    public EnergyTest(String info, String filename, int nAtoms, double bondEnergy, int nBonds,
54                      double angleEnergy, int nAngles, double stretchBendEnergy, int nStretchBends,
55                      double ureyBradleyEnergy, int nUreyBradleys, double outOfPlaneBendEnergy,
56                      int nOutOfPlaneBends, double torsionEnergy, int nTorsions, double improperTorsionEnergy,
57                      int nImproperTorsions, double piOrbitalTorsionEnergy, int nPiOrbitalTorsions,
58                      double torsionTorsionEnergy, int nTorsionTorsions, double stretchTorsionEnergy,
59                      int nStretchTorsions, double angleTorsionEnergy, int nAngleTorsions, double vanDerWaalsEnergy,
60                      int nVanDerWaals, double permanentEnergy, int nPermanent, double polarizationEnergy,
61                      int nPolar, double gkEnergy, int nGK, boolean testOpenMM) {
62      super(info, filename, nAtoms, bondEnergy, nBonds, angleEnergy, nAngles, stretchBendEnergy, nStretchBends,
63          ureyBradleyEnergy, nUreyBradleys, outOfPlaneBendEnergy, nOutOfPlaneBends, torsionEnergy,
64          nTorsions, improperTorsionEnergy, nImproperTorsions, piOrbitalTorsionEnergy,
65          nPiOrbitalTorsions, torsionTorsionEnergy, nTorsionTorsions, stretchTorsionEnergy,
66          nStretchTorsions, angleTorsionEnergy, nAngleTorsions, vanDerWaalsEnergy, nVanDerWaals,
67          permanentEnergy, nPermanent, polarizationEnergy, nPolar, gkEnergy, nGK, testOpenMM);
68    }
69  
70    @Parameters
71    public static Collection<Object[]> data() {
72      return Arrays.asList(
73          new Object[][]{
74              {
75                  "SNARE P212121",
76                  "1n7s.P212121.xyz",
77                  5357,
78                  351.32142483,
79                  5040,
80                  744.19251364,
81                  8255,
82                  6.42015744,
83                  6924,
84                  2.50163831,
85                  322,
86                  135.24919366,
87                  2487,
88                  417.89244418,
89                  11449,
90                  0.0,
91                  0,
92                  39.85643934,
93                  370,
94                  -560.99576469,
95                  268,
96                  0.0,
97                  0,
98                  0.0,
99                  0,
100                 4003.27183547,
101                 741643,
102                 -12303.93157019,
103                 332114,
104                 -2811.45683671,
105                 332114,
106                 0.0,
107                 0,
108                 false
109             },
110             {
111                 // OpenMM does not handle this correctly yet.
112                 "SNARE P1",
113                 "1n7s.P1.xyz",
114                 21428,
115                 1405.28569930,
116                 20160,
117                 2976.77005458,
118                 33020,
119                 25.68062976,
120                 27696,
121                 10.00655326,
122                 1288,
123                 540.99677465,
124                 9948,
125                 1671.56977674,
126                 45796,
127                 0.0,
128                 0,
129                 159.42575736,
130                 1480,
131                 -2243.98305878,
132                 1072,
133                 0.0,
134                 0,
135                 0.0,
136                 0,
137                 16013.08734188,
138                 2966572,
139                 -49215.72628076,
140                 1328456,
141                 -11245.82734685,
142                 1328456,
143                 0.0,
144                 0,
145                 false
146             },
147             {
148                 "DHFR Benchmark",
149                 "dhfr.xyz",
150                 23558,
151                 6623.70878543,
152                 16569,
153                 4748.78155255,
154                 11584,
155                 -19.78973386,
156                 4031,
157                 -132.74781407,
158                 7023,
159                 110.84355342,
160                 1566,
161                 433.69593807,
162                 6701,
163                 0.0,
164                 0,
165                 58.75073806,
166                 292,
167                 -41.99981847,
168                 147,
169                 0.0,
170                 0,
171                 0.0,
172                 0,
173                 31718.84803063,
174                 3480619,
175                 -78751.36662993,
176                 1463589,
177                 -31790.15161303,
178                 1463589,
179                 0.0,
180                 0,
181                 true
182             },
183             {
184                 "AMBER99SB GB (no dispersion) Capped DMHD",
185                 "dmhd-amber99sb.xyz",
186                 71,
187                 1.56331971,
188                 71,
189                 25.07578077,
190                 124,
191                 0.0,
192                 0,
193                 0.0,
194                 0,
195                 0.0,
196                 0,
197                 27.92653816,
198                 169,
199                 0.15162117,
200                 20,
201                 0.0,
202                 0,
203                 0.0,
204                 0,
205                 0.0,
206                 0,
207                 0.0,
208                 0,
209                 -4.31922323,
210                 2290,
211                 -71.00737570,
212                 2290,
213                 0.0,
214                 2290,
215                 -184.01591119210968,
216                 2556,
217                 true
218             },
219             {
220                 "AMOEBA Bio 2018 Crambin GK/SA",
221                 "crambin.xyz",
222                 642,
223                 134.83946761,
224                 652,
225                 133.94053912,
226                 1183,
227                 -4.81704334,
228                 1044,
229                 0.0,
230                 0,
231                 29.92634330,
232                 375,
233                 18.82386314,
234                 1747,
235                 0.0,
236                 0,
237                 12.01761948,
238                 66,
239                 -23.33097186,
240                 4,
241                 0.0,
242                 0,
243                 0.0,
244                 0,
245                 308.55702420206063,
246                 203926,
247                 -1208.3841483371093, // -1208.54202510
248                 203926,
249                 -127.5927132059615,  // -127.41736039
250                 203926,
251                 -203.68131916301343, // -203.76192317960601
252                 206403,
253                 false
254             },
255             {
256                 "AMOEBA Protein 2013 GK Capped DMHD",
257                 "dmhd-amoebapro13.xyz",
258                 71,
259                 4.00030221,
260                 71,
261                 15.27574588,
262                 124,
263                 -0.23989418,
264                 110,
265                 0.0,
266                 0,
267                 0.39337245,
268                 51,
269                 3.40745668,
270                 169,
271                 0.0,
272                 0,
273                 0.09663007,
274                 10,
275                 0.0,
276                 0,
277                 0.0,
278                 0,
279                 0.0,
280                 0,
281                 20.36671513,
282                 2290,
283                 -169.05487037936405, // -169.03958434,
284                 2290,
285                 -25.8482461594885, // -25.85878386
286                 2290,
287                 -207.4485546982137, // -207.47535790184864
288                 2556,
289                 true
290             },
291             {
292                 "AMOEBA 2009 Tetra-Alanine GK",
293                 "alatet.int",
294                 42,
295                 1.66598227,
296                 41,
297                 3.41765862,
298                 72,
299                 -0.07860298,
300                 57,
301                 0.0,
302                 0,
303                 0.29369677,
304                 24,
305                 7.99325266,
306                 91,
307                 0.0,
308                 0,
309                 0.01292169,
310                 4,
311                 1.95288364,
312                 3,
313                 0.0,
314                 0,
315                 0.0,
316                 0,
317                 20.39805900,
318                 748,
319                 -78.53945229,
320                 748,
321                 -8.62910979,
322                 748,
323                 -59.70833911386979,
324                 903,
325                 false
326             },
327             {
328                 "Amber99sb Peptide",
329                 "peptide-amber99sb.xyz",
330                 328,
331                 41.19699756,
332                 333,
333                 54.88751601,
334                 596,
335                 0.0,
336                 0,
337                 0.0,
338                 0,
339                 0.0,
340                 0,
341                 189.34195768,
342                 875,
343                 1.59062194,
344                 101,
345                 0.0,
346                 0,
347                 0.0,
348                 0,
349                 0.0,
350                 0,
351                 0.0,
352                 0,
353                 111362.79687915,
354                 52696,
355                 -413.52897447,
356                 52699,
357                 0.0,
358                 52699,
359                 0.0,
360                 0,
361                 true
362             },
363             {
364                 "Ubiquitin Benchmark",
365                 "ubiquitin.xyz",
366                 9737,
367                 2856.59378034,
368                 6908,
369                 2018.16571190,
370                 5094,
371                 -6.98794687,
372                 1958,
373                 -55.63461732,
374                 2835,
375                 65.00809012,
376                 651,
377                 224.37608631,
378                 3297,
379                 0.0,
380                 0,
381                 20.43063520,
382                 106,
383                 -31.48011891,
384                 71,
385                 0.0,
386                 0,
387                 0.0,
388                 0,
389                 12862.34983956,
390                 1482946,
391                 -32737.08497141565, // or -32736.92207773 (with no FFT factors of 6 & 7)
392                 623627,
393                 -12934.94219259, // or -12934.93512829 (with no FFT factors of 6 & 7)
394                 623627,
395                 0.0,
396                 0,
397                 true
398             },
399             {
400                 "Ubiquitin Amber 1999 Benchmark",
401                 "ubiquitin-amber99.xyz",
402                 9737,
403                 3496.26834781,
404                 6908,
405                 2056.15089674,
406                 5094,
407                 0.0,
408                 0,
409                 0.0,
410                 0,
411                 0.0,
412                 0,
413                 705.79420086,
414                 3297,
415                 27.59366005,
416                 287,
417                 0.0,
418                 0,
419                 0.0,
420                 0,
421                 0.0,
422                 0,
423                 0.0,
424                 0,
425                 4860.41072437,
426                 2279196,
427                 -40036.04804903,
428                 3562034,
429                 0.0,
430                 3562034,
431                 0.0,
432                 0,
433                 true
434             },
435             {
436                 "Acetanilide Benchmark",
437                 "acetanilide.xyz",
438                 19,
439                 0.67814832,
440                 19,
441                 1.06817134,
442                 30,
443                 -0.06290501,
444                 26,
445                 0.0,
446                 0,
447                 0.13033970,
448                 24,
449                 -8.01262794,
450                 38,
451                 0.0,
452                 0,
453                 0.0,
454                 0,
455                 0.0,
456                 0,
457                 0.0,
458                 0,
459                 0.0,
460                 0,
461                 -3.62572228,
462                 7295,
463                 -26.0720131242538,
464                 2231,
465                 -1.9856761645305,
466                 2231,
467                 0.0,
468                 0,
469                 false
470             },
471             {
472                 "Ethylparaben Benchmark",
473                 "ethylparaben.xyz",
474                 44,
475                 1.37991170,
476                 44,
477                 2.43600964,
478                 70,
479                 0.20006782,
480                 58,
481                 0.0,
482                 0,
483                 0.04434686,
484                 42,
485                 -7.14298308,
486                 88,
487                 0.0,
488                 0,
489                 0.0,
490                 0,
491                 0.0,
492                 0,
493                 0.0,
494                 0,
495                 0.0,
496                 0,
497                 -4.816366774263829,
498                 32644,
499                 -45.55012417320137,
500                 5012,
501                 -3.97079858673400,
502                 5012,
503                 0.0,
504                 0,
505                 false
506             },
507             {
508                 "Methylparaben Benchmark",
509                 "methylparaben.xyz",
510                 19,
511                 0.42501694,
512                 19,
513                 1.23611203,
514                 29,
515                 0.00351228,
516                 24,
517                 0.0,
518                 0,
519                 0.01058196,
520                 21,
521                 -3.72750990,
522                 35,
523                 0.0,
524                 0,
525                 0.0,
526                 0,
527                 0.0,
528                 0,
529                 0.0,
530                 0,
531                 0.0,
532                 0,
533                 0.20573979,
534                 7639,
535                 -26.558577471708134,
536                 2314,
537                 -2.35904592,
538                 2314,
539                 0.0,
540                 0,
541                 false
542             },
543             {
544                 "Paracetamol Benchmark",
545                 "paracetamol.xyz",
546                 20,
547                 0.55316710,
548                 20,
549                 1.51848706,
550                 31,
551                 0.05096337,
552                 27,
553                 0.0,
554                 0,
555                 0.46651316,
556                 24,
557                 -7.40125527,
558                 40,
559                 0.0,
560                 0,
561                 0.0,
562                 0,
563                 0.0,
564                 0,
565                 0.0,
566                 0,
567                 0.0,
568                 0,
569                 0.76621272,
570                 7832,
571                 -32.02011297249507,
572                 2357,
573                 -4.96649992387851,
574                 2357,
575                 0.0,
576                 0,
577                 false
578             },
579             {
580                 "Phenacetin Benchmark",
581                 "phenacetin.xyz",
582                 26,
583                 0.56492623,
584                 26,
585                 2.68273715,
586                 43,
587                 0.00409248,
588                 35,
589                 0.0,
590                 0,
591                 0.33385711,
592                 24,
593                 -6.49787814,
594                 52,
595                 0.0,
596                 0,
597                 0.0,
598                 0,
599                 0.0,
600                 0,
601                 0.0,
602                 0,
603                 0.0,
604                 0,
605                 -5.792072251098926,
606                 20384,
607                 -25.42173449818894,
608                 3138,
609                 -2.09385416786188,
610                 3138,
611                 0.0,
612                 0,
613                 false
614             }
615 
616         });
617   }
618 
619 
620 }