109 |
|
//file plus the number of rigid bodies defined in meta-data file |
110 |
|
nGlobalIntegrableObjects_ = nGlobalAtoms_ - nRigidAtoms + nGlobalRigidBodies_; |
111 |
|
|
112 |
– |
//initialize globalGroupMembership_, every element of this array will be 0 |
113 |
– |
globalGroupMembership_.insert(globalGroupMembership_.end(), nGlobalAtoms_, 0); |
114 |
– |
|
112 |
|
nGlobalMols_ = molStampIds_.size(); |
113 |
|
|
114 |
|
#ifdef IS_MPI |
146 |
|
nCutoffGroups_ += mol->getNCutoffGroups(); |
147 |
|
nConstraints_ += mol->getNConstraints(); |
148 |
|
|
149 |
+ |
addExcludePairs(mol); |
150 |
+ |
|
151 |
|
return true; |
152 |
|
} else { |
153 |
|
return false; |
171 |
|
nCutoffGroups_ -= mol->getNCutoffGroups(); |
172 |
|
nConstraints_ -= mol->getNConstraints(); |
173 |
|
|
174 |
+ |
removeExcludePairs(mol); |
175 |
|
molecules_.erase(mol->getGlobalIndex()); |
176 |
|
|
177 |
|
delete mol; |
605 |
|
//molMembershipArray is filled by SimCreator |
606 |
|
std::vector<int> molMembershipArray(nGlobalAtoms_); |
607 |
|
for (int i = 0; i < nGlobalAtoms_; i++) { |
608 |
< |
molMembershipArray.push_back(globalMolMembership_[i] + 1); |
608 |
> |
molMembershipArray[i] = globalMolMembership_[i] + 1; |
609 |
|
} |
610 |
|
|
611 |
|
//setup fortran simulation |
820 |
|
|
821 |
|
} |
822 |
|
|
823 |
+ |
Vector3d SimInfo::getComVel(){ |
824 |
+ |
SimInfo::MoleculeIterator i; |
825 |
+ |
Molecule* mol; |
826 |
+ |
|
827 |
+ |
Vector3d comVel(0.0); |
828 |
+ |
double totalMass = 0.0; |
829 |
+ |
|
830 |
+ |
|
831 |
+ |
for (mol = beginMolecule(i); mol != NULL; mol = nextMolecule(i)) { |
832 |
+ |
double mass = mol->getMass(); |
833 |
+ |
totalMass += mass; |
834 |
+ |
comVel += mass * mol->getComVel(); |
835 |
+ |
} |
836 |
+ |
|
837 |
+ |
comVel /= totalMass; |
838 |
+ |
|
839 |
+ |
return comVel; |
840 |
+ |
} |
841 |
+ |
|
842 |
+ |
Vector3d SimInfo::getCom(){ |
843 |
+ |
SimInfo::MoleculeIterator i; |
844 |
+ |
Molecule* mol; |
845 |
+ |
|
846 |
+ |
Vector3d com(0.0); |
847 |
+ |
double totalMass = 0.0; |
848 |
+ |
|
849 |
+ |
for (mol = beginMolecule(i); mol != NULL; mol = nextMolecule(i)) { |
850 |
+ |
double mass = mol->getMass(); |
851 |
+ |
totalMass += mass; |
852 |
+ |
com += mass * mol->getCom(); |
853 |
+ |
} |
854 |
+ |
|
855 |
+ |
com /= totalMass; |
856 |
+ |
|
857 |
+ |
return com; |
858 |
+ |
|
859 |
+ |
} |
860 |
+ |
|
861 |
|
std::ostream& operator <<(std::ostream& o, SimInfo& info) { |
862 |
|
|
863 |
|
return o; |
864 |
|
} |
865 |
|
|
866 |
|
}//end namespace oopse |
867 |
+ |
|