56 |
|
#include "UseTheForce/notifyCutoffs_interface.h" |
57 |
|
#include "utils/MemoryUtils.hpp" |
58 |
|
#include "utils/simError.h" |
59 |
+ |
#include "selection/SelectionManager.hpp" |
60 |
|
|
61 |
|
#ifdef IS_MPI |
62 |
|
#include "UseTheForce/mpiComponentPlan.h" |
73 |
|
nGlobalIntegrableObjects_(0), nGlobalRigidBodies_(0), |
74 |
|
nAtoms_(0), nBonds_(0), nBends_(0), nTorsions_(0), nRigidBodies_(0), |
75 |
|
nIntegrableObjects_(0), nCutoffGroups_(0), nConstraints_(0), |
76 |
< |
sman_(NULL), fortranInitialized_(false) { |
76 |
> |
sman_(NULL), fortranInitialized_(false), selectMan_(NULL) { |
77 |
|
|
78 |
|
|
79 |
|
std::vector<std::pair<MoleculeStamp*, int> >::iterator i; |
109 |
|
|
110 |
|
//calculate atoms in rigid bodies |
111 |
|
int nAtomsInRigidBodies = 0; |
112 |
< |
int nRigidBodiesInStamp = molStamp->getNCutoffGroups(); |
112 |
> |
int nRigidBodiesInStamp = molStamp->getNRigidBodies(); |
113 |
|
|
114 |
|
for (int j=0; j < nRigidBodiesInStamp; j++) { |
115 |
|
rbStamp = molStamp->getRigidBody(j); |
138 |
|
#ifdef IS_MPI |
139 |
|
molToProcMap_.resize(nGlobalMols_); |
140 |
|
#endif |
141 |
< |
|
141 |
> |
|
142 |
> |
selectMan_ = new SelectionManager(this); |
143 |
> |
selectMan_->selectAll(); |
144 |
|
} |
145 |
|
|
146 |
|
SimInfo::~SimInfo() { |
151 |
|
delete sman_; |
152 |
|
delete simParams_; |
153 |
|
delete forceField_; |
154 |
< |
|
154 |
> |
delete selectMan_; |
155 |
|
} |
156 |
|
|
157 |
|
int SimInfo::getNGlobalConstraints() { |
754 |
|
return maxCutoffRadius; |
755 |
|
} |
756 |
|
|
757 |
< |
void SimInfo::setupCutoff() { |
755 |
< |
double rcut_; //cutoff radius |
756 |
< |
double rsw_; //switching radius |
757 |
> |
void SimInfo::getCutoff(double& rcut, double& rsw) { |
758 |
|
|
759 |
|
if (fInfo_.SIM_uses_Charges | fInfo_.SIM_uses_Dipoles | fInfo_.SIM_uses_RF) { |
760 |
|
|
765 |
|
"\tfor the cutoffRadius.\n"); |
766 |
|
painCave.isFatal = 0; |
767 |
|
simError(); |
768 |
< |
rcut_ = 15.0; |
768 |
> |
rcut = 15.0; |
769 |
|
} else{ |
770 |
< |
rcut_ = simParams_->getRcut(); |
770 |
> |
rcut = simParams_->getRcut(); |
771 |
|
} |
772 |
|
|
773 |
|
if (!simParams_->haveRsw()){ |
777 |
|
"\t0.95 * cutoffRadius for the switchingRadius\n"); |
778 |
|
painCave.isFatal = 0; |
779 |
|
simError(); |
780 |
< |
rsw_ = 0.95 * rcut_; |
780 |
> |
rsw = 0.95 * rcut; |
781 |
|
} else{ |
782 |
< |
rsw_ = simParams_->getRsw(); |
782 |
> |
rsw = simParams_->getRsw(); |
783 |
|
} |
784 |
|
|
785 |
|
} else { |
787 |
|
//meta-data file, the maximum cutoff radius calculated from forcefiled will be used |
788 |
|
|
789 |
|
if (simParams_->haveRcut()) { |
790 |
< |
rcut_ = simParams_->getRcut(); |
790 |
> |
rcut = simParams_->getRcut(); |
791 |
|
} else { |
792 |
|
//set cutoff radius to the maximum cutoff radius based on atom types in the whole system |
793 |
< |
rcut_ = calcMaxCutoffRadius(); |
793 |
> |
rcut = calcMaxCutoffRadius(); |
794 |
|
} |
795 |
|
|
796 |
|
if (simParams_->haveRsw()) { |
797 |
< |
rsw_ = simParams_->getRsw(); |
797 |
> |
rsw = simParams_->getRsw(); |
798 |
|
} else { |
799 |
< |
rsw_ = rcut_; |
799 |
> |
rsw = rcut; |
800 |
|
} |
801 |
|
|
802 |
|
} |
803 |
< |
|
803 |
> |
} |
804 |
> |
|
805 |
> |
void SimInfo::setupCutoff() { |
806 |
> |
getCutoff(rcut_, rsw_); |
807 |
|
double rnblist = rcut_ + 1; // skin of neighbor list |
808 |
|
|
809 |
|
//Pass these cutoff radius etc. to fortran. This function should be called once and only once |
835 |
|
} |
836 |
|
|
837 |
|
void SimInfo::setSnapshotManager(SnapshotManager* sman) { |
838 |
+ |
//if (sman_ == sman_) { |
839 |
+ |
// return; |
840 |
+ |
//} |
841 |
+ |
|
842 |
+ |
//delete sman_; |
843 |
|
sman_ = sman; |
844 |
|
|
845 |
|
Molecule* mol; |