-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsimple_action_noImage.c
57 lines (41 loc) · 1.77 KB
/
simple_action_noImage.c
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//this is only used for cuda-chill
//heavy simplification
#define NsolventMolecules_ 1024
#define NsolventAtoms_ 1024
// struct MolDist {
// int mol; ///< Original solvent molecule number (starts from 1).
// double D; ///< Closest distance of solvent molecule to atoms in distanceMask.
// //AtomMask mask; ///< Original topology solvent molecule atom mask.
// double solventAtoms[NsolventAtoms_][3]; ///< Actual solvent atom #s to loop over.
// };
//using dist for no image
// and kernel for when we use solute molecule center
//extracting pulling out arrays out from struct
void Action_NoImage_Center(double SolventMols_[NsolventMolecules_][NsolventAtoms_][3],
double D_[NsolventMolecules_], double maskCenter[3] ,double maxD)
{
double Dist;
int solventMol, solventAtom;
//Vec3 maskCenter = frmIn.VGeometricCenter( distanceMask_ );
for (solventMol=0; solventMol < NsolventMolecules_; solventMol++) { //standard loop
D_[solventMol] = maxD;
for (solventAtom = 0; solventAtom < NsolventAtoms_; solventAtom++)
{
//main dist2_noImage code
//double *a1 = maskCenter.Dptr(); //center of solute molecule
//double *a2 = frmIn.XYZ(*solvent_atom);
//double *a1 = maskCenter; //center of solute molecule
//double *a2 = SolventMols_[solventMol][solventAtom];
//double x = a1[0] - a2[0];
//double y = a1[1] - a2[1];
//double z = a1[2] - a2[2];
//Dist = (x*x + y*y + z*z);
Dist = (maskCenter[0] * SolventMols_[solventMol][solventAtom][0]) +
(maskCenter[1] * SolventMols_[solventMol][solventAtom][1]) +
(maskCenter[2] *SolventMols_[solventMol][solventAtom][2]);
//D_[solventMol] = Dist < D_[solventMol] ? Dist : D_[solventMol];
if (Dist < D_[solventMol])
D_[solventMol] = Dist;
}
}
}