NAMD
PressureProfile.h
Go to the documentation of this file.
1 
7 #include "common.h"
8 
9 /*
10  * 12/27/2005: switch to Harasima contour, in which the interaction is split
11  * evenly between the pairs of atoms, rather than distributed among the slabs
12  * between them.
13  */
14 
15 inline void pp_clamp(int &n, int nslabs) {
16  int a = n < 0 ? nslabs : 0;
17  int b = n >= nslabs ? nslabs : 0;
18  n += a-b;
19 }
20 
21 
22 inline void pp_reduction(int nslabs, int n1, int n2,
23  int atype1, int atype2, int numtypes,
24  BigReal vxx, BigReal vyy, BigReal vzz,
25  BigReal *reduction) {
26 
27  int slaboffset = atype1*numtypes + atype2;
28  reduction += slaboffset * 3*nslabs;
29 
30  vxx *= 0.5;
31  vyy *= 0.5;
32  vzz *= 0.5;
33  reduction[3*n1 ] += vxx;
34  reduction[3*n1+1] += vyy;
35  reduction[3*n1+2] += vzz;
36  reduction[3*n2 ] += vxx;
37  reduction[3*n2+1] += vyy;
38  reduction[3*n2+2] += vzz;
39 }
40 
void pp_reduction(int nslabs, int n1, int n2, int atype1, int atype2, int numtypes, BigReal vxx, BigReal vyy, BigReal vzz, BigReal *reduction)
void pp_clamp(int &n, int nslabs)
double BigReal
Definition: common.h:112