-
Notifications
You must be signed in to change notification settings - Fork 0
/
MoleculeKind.h
143 lines (113 loc) · 2.74 KB
/
MoleculeKind.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*******************************************************************************
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 FF_MOLECULE_H
#define FF_MOLECULE_H
#include "BasicTypes.h" //For uint
#include "EnsemblePreprocessor.h"
#include "SubdividedArray.h"
#include "Geometry.h" //members
#include "CBMC.h"
#include <string>
#include <vector>
#include <cassert>
namespace mol_setup
{
class Atom;
class MolKind;
}
namespace ff_setup
{
class Bond;
class FFBase;
}
namespace cbmc
{
class TrialMol;
}
class FFSetup;
class PRNG;
struct MolPick;
class System;
class Forcefield;
class Setup;
class MoleculeKind
{
public:
MoleculeKind();
~MoleculeKind();
uint NumAtoms() const
{
return numAtoms;
}
uint NumBonds() const
{
return bondList.count;
}
uint NumAngles() const
{
return angles.Count();
}
uint NumDihs() const
{
return dihedrals.Count();
}
uint AtomKind(const uint a) const
{
return atomKind[a];
}
double AtomCharge(const uint a) const
{
return atomCharge[a];
}
//Initialize this kind
//Exits program if param and psf files don't match
void Init(std::string const& l_name,
Setup const& setup,
Forcefield const& forcefield,
System & sys);
//Invoke CBMC, oldMol and newMol will be modified
void Build(cbmc::TrialMol& oldMol, cbmc::TrialMol& newMol,
const uint molIndex)
{
builder->Build(oldMol, newMol, molIndex);
}
//CBMC for regrowth move
void Regrowth(cbmc::TrialMol& oldMol, cbmc::TrialMol& newMol,
const uint molIndex)
{
builder->Regrowth(oldMol, newMol, molIndex);
}
double GetMoleculeCharge();
SortedNonbond sortedNB, sortedNB_1_4, sortedNB_1_3, sortedEwaldNB;
//these are used for total energy calculations, see Geometry.h/cpp
Nonbond nonBonded;
Nonbond_1_4 nonBonded_1_4;
Nonbond_1_3 nonBonded_1_3;
EwaldNonbond nonEwaldBonded;
BondList bondList;
GeomFeature angles;
GeomFeature dihedrals;
bool oneThree, oneFour;
std::string name;
std::vector<std::string> atomNames, atomTypeNames;
double molMass;
double * atomMass;
#if ENSEMBLE == GCMC
double chemPot;
#endif
private:
void InitAtoms(mol_setup::MolKind const& molData);
//uses buildBonds to check if molecule is branched
//bool CheckBranches();
void InitCBMC(System& sys, Forcefield& ff,
Setup& set);
cbmc::CBMC* builder;
uint numAtoms;
uint * atomKind;
double * atomCharge;
};
#endif /*FF_MOLECULE_H*/