"openmmapi/vscode:/vscode.git/clone" did not exist on "881df1a5d917293966585ded4c33074cd95f8805"
PME.h 3.35 KB
Newer Older
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
/* 
 * Reference implementation of PME reciprocal space interactions.
 * 
 * Copyright (c) 2009, Erik Lindahl, Rossen Apostolov, Szilard Pall
 * All rights reserved.
 * Contact: lindahl@cbr.su.se Stockholm University, Sweden.
 * 
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice, this 
 * list of conditions and the following disclaimer. Redistributions in binary 
 * form must reproduce the above copyright notice, this list of conditions and 
 * the following disclaimer in the documentation and/or other materials provided 
 * with the distribution.
 * Neither the name of the author/university nor the names of its contributors may 
 * be used to endorse or promote products derived from this software without 
 * specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include "../SimTKUtilities/SimTKOpenMMCommon.h"
33
#include <vector>
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

typedef RealOpenMM rvec[3];


typedef struct pme *
pme_t;

/*
 * Initialize a PME calculation and set up data structures
 *
 * Arguments:
 * 
 * ppme        Pointer to an opaque pme_t object
 * ewaldcoeff  Coefficient derived from the beta factor to participate
 *             direct/reciprocal space. See gromacs code for documentation!
 *             We assume that you are using nm units...
 * natoms      Number of atoms to set up data structure sof
 * ngrid       Size of the full pme grid
 * pme_order   Interpolation order, almost always 4
 * epsilon_r   Dielectric coefficient, typically 1.0.
 */
int 
pme_init(pme_t *       ppme,
		 RealOpenMM        ewaldcoeff,
		 int           natoms,
59
		 const int           ngrid[3],
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
		 int           pme_order,
	         RealOpenMM        epsilon_r);

/*
 * Evaluate reciprocal space PME energy and forces.
 *
 * Args:
 *
 * pme         Opaque pme_t object, must have been initialized with pme_init()
 * x           Pointer to coordinate data array (nm)
 * f           Pointer to force data array (will be written as kJ/mol/nm)
 * charge      Array of charges (units of e)
 * box         Simulation cell dimensions (nm)
 * energy      Total energy (will be written in units of kJ/mol)
 * pme_virial  Long-range part of the virial, output.
 */
int
pme_exec(pme_t       pme,
78
79
		 std::vector<OpenMM::RealVec>&  atomCoordinates,
		 std::vector<OpenMM::RealVec>&  forces,
80
81
82
83
84
85
86
87
88
89
		 RealOpenMM **  atomParameters,
		 const RealOpenMM  periodicBoxSize[3],
		 RealOpenMM *    energy,
		 RealOpenMM      pme_virial[3][3]);



/* Release all memory in pme structure */
int
pme_destroy(pme_t    pme);