45 |
|
fortranInitialized_(false) { |
46 |
|
|
47 |
|
std::vector<std::pair<MoleculeStamp*, int> >::iterator i; |
48 |
– |
int nCutoffAtoms; // number of atoms belong to cutoff groups |
49 |
– |
int ngroups; //total cutoff groups defined in meta-data file |
48 |
|
MoleculeStamp* molStamp; |
49 |
|
int nMolWithSameStamp; |
50 |
+ |
int nCutoffAtoms; // number of atoms belong to cutoff groups |
51 |
+ |
int nGroups; //total cutoff groups defined in meta-data file |
52 |
|
CutoffGroupStamp* cgStamp; |
53 |
< |
int nAtomsIngroups; |
54 |
< |
int nCutoffGroupsInStamp; |
55 |
< |
|
53 |
> |
int nAtomsInGroups; |
54 |
> |
int nCutoffGroupsInStamp; |
55 |
> |
|
56 |
> |
RigidBodyStamp* rbStamp; |
57 |
> |
int nAtomsInRigidBodies; |
58 |
> |
int nRigidBodiesInStamp; |
59 |
> |
int nRigidAtoms; |
60 |
> |
int nRigidBodies; |
61 |
> |
|
62 |
|
nGlobalAtoms_ = 0; |
57 |
– |
ngroups = 0; |
63 |
|
|
64 |
+ |
nGroups = 0; |
65 |
+ |
nCutoffAtoms = 0; |
66 |
+ |
|
67 |
+ |
nRigidBodies |
68 |
+ |
nRigidBodies = 0; |
69 |
+ |
|
70 |
|
for (i = molStampPairs.begin(); i !=molStampPairs.end(); ++i) { |
71 |
|
molStamp = i->first; |
72 |
|
nMolWithSameStamp = i->second; |
73 |
|
|
74 |
|
addMoleculeStamp(molStamp, nMolWithSameStamp); |
75 |
< |
|
75 |
> |
|
76 |
> |
//calculate atoms in molecules |
77 |
|
nGlobalAtoms_ += molStamp->getNAtoms() *nMolWithSameStamp; |
78 |
< |
|
79 |
< |
nAtomsIngroups = 0; |
78 |
> |
|
79 |
> |
|
80 |
> |
//calculate atoms in cutoff groups |
81 |
> |
nAtomsInGroups = 0; |
82 |
|
nCutoffGroupsInStamp = molStamp->getNCutoffGroups(); |
83 |
|
|
84 |
|
for (int j=0; j < nCutoffGroupsInStamp; j++) { |
85 |
|
cgStamp = molStamp->getCutoffGroup(j); |
86 |
< |
nAtomsIngroups += cgStamp->getNMembers(); |
86 |
> |
nAtomsInGroups += cgStamp->getNMembers(); |
87 |
|
} |
88 |
|
|
89 |
< |
ngroups += *nMolWithSameStamp; |
90 |
< |
nCutoffAtoms += nAtomsIngroups * nMolWithSameStamp; |
89 |
> |
nGroups += nCutoffGroupsInStamp * nMolWithSameStamp; |
90 |
> |
nCutoffAtoms += nAtomsInGroups * nMolWithSameStamp; |
91 |
> |
|
92 |
> |
//calculate atoms in rigid bodies |
93 |
> |
nAtomsInRigidBodies = 0; |
94 |
> |
nRigidBodiesInStamp = molStamp->getNCutoffGroups(); |
95 |
> |
|
96 |
> |
for (int j=0; j < nRigidBodiesInStamp; j++) { |
97 |
> |
rbStamp = molStamp->getRigidBody(j); |
98 |
> |
nRigidBodiesInStamp += rbStamp->getNMembers(); |
99 |
> |
} |
100 |
> |
|
101 |
> |
nRigidBodies += nRigidBodiesInStamp * nMolWithSameStamp; |
102 |
> |
nRigidAtoms += nAtomsInRigidBodies * nMolWithSameStamp; |
103 |
> |
|
104 |
|
} |
105 |
|
|
106 |
|
//every free atom (atom does not belong to cutoff groups) is a cutoff group |
107 |
|
//therefore the total number of cutoff groups in the system is equal to |
108 |
|
//the total number of atoms minus number of atoms belong to cutoff group defined in meta-data |
109 |
|
//file plus the number of cutoff groups defined in meta-data file |
110 |
< |
nGlobalCutoffGroups_ = nGlobalAtoms_ - nCutoffAtoms + ngroups; |
110 |
> |
nGlobalCutoffGroups_ = nGlobalAtoms_ - nCutoffAtoms + nGroups; |
111 |
> |
|
112 |
> |
//every free atom (atom does not belong to rigid bodies) is a rigid body |
113 |
> |
//therefore the total number of cutoff groups in the system is equal to |
114 |
> |
//the total number of atoms minus number of atoms belong to rigid body defined in meta-data |
115 |
> |
//file plus the number of rigid bodies defined in meta-data file |
116 |
> |
nGlobalIntegrableObjects_ = nGlobalAtoms_ - nRigidAtoms + nRigidBodies; |
117 |
|
|
118 |
|
//initialize globalGroupMembership_, every element of this array will be 0 |
119 |
|
globalGroupMembership_.insert(globalGroupMembership_.end(), nGlobalAtoms_, 0); |