-
Notifications
You must be signed in to change notification settings - Fork 0
/
NoEwald.h
113 lines (84 loc) · 3.22 KB
/
NoEwald.h
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*******************************************************************************
GPU OPTIMIZED MONTE CARLO (GOMC) 2.31
Copyright (C) 2018 GOMC Group
A copy of the GNU General Public License can be found in the COPYRIGHT.txt
along with this program, also can be found at <http://www.gnu.org/licenses/>.
********************************************************************************/
#ifndef NOEWALD_H
#define NOEWALD_H
#include "BasicTypes.h"
#include "EnergyTypes.h"
#include "Ewald.h"
#include <vector>
#include <stdio.h>
#include <cstring>
#include <cassert>
#ifdef _OPENMP
#include <omp.h>
#endif
//
// Called when Ewlad method was not used.
// Energy Calculation functions for Ewald summation method
// Calculating self, correction and reciprocate part of ewald
//
// Developed by Y. Li and Mohammad S. Barhaghi
//
//
class StaticVals;
class System;
class Forcefield;
class Molecules;
class MoleculeLookup;
class MoleculeKind;
class Coordinates;
class COM;
class XYZArray;
class BoxDimensions;
class CalculateEnergy;
class NoEwald : public Ewald
{
//friend class CalculateEnergy;
public:
NoEwald(StaticVals & stat, System & sys);
virtual void Init();
virtual void AllocMem();
//initiliazie term used for ewald calculation
virtual void RecipInit(uint box, BoxDimensions const& boxAxes);
//calculate self term for a box
virtual double BoxSelf(BoxDimensions const& boxAxes, uint box) const;
//setup reciprocate term for a box
virtual void BoxReciprocalSetup(uint box, XYZArray const& molCoords);
//calculate reciprocate energy term for a box
virtual double BoxReciprocal(uint box) const;
//calculate reciprocate force term for a box
virtual Virial ForceReciprocal(Virial& virial, uint box) const;
//calculate correction force term for a box
virtual Virial ForceCorrection(Virial& virial, uint box) const;
//calculate correction term for a molecule
virtual double MolCorrection(uint molIndex, uint box)const;
//calculate reciprocate term for displacement and rotation move
virtual double MolReciprocal(XYZArray const& molCoords, const uint molIndex,
const uint box, XYZ const*const newCOM = NULL);
//calculate self term after swap move
virtual double SwapSelf(const cbmc::TrialMol& trialMo) const;
//calculate correction term after swap move
virtual double SwapCorrection(const cbmc::TrialMol& trialMol) const;
//calculate reciprocate term in destination box for swap move
virtual double SwapDestRecip(const cbmc::TrialMol &newMol, const uint box,
const int sourceBox, const int molIndex);
//calculate reciprocate term in source box for swap move
virtual double SwapSourceRecip(const cbmc::TrialMol &oldMol,
const uint box, const int molIndex);
//back up reciptocate value to Ref (will be called during initialization)
virtual void SetRecipRef(uint box);
//update reciprocate values
virtual void UpdateRecip(uint box);
//update the hx,y,z hsqr and prefact
virtual void UpdateRecipVec(uint box);
//restore cosMol and sinMol
virtual void RestoreMol(int molIndex);
//update sinMol and cosMol
virtual void exgMolCache();
virtual void UpdateVectorsAndRecipTerms();
};
#endif /*NOEWALD_H*/