| 75 |  | class SelectionManager; | 
| 76 |  | /** | 
| 77 |  | * @class SimInfo SimInfo.hpp "brains/SimInfo.hpp" | 
| 78 | < | * @brief As one of the heavy weight class of OOPSE, SimInfo | 
| 79 | < | * One of the major changes in SimInfo class is the data struct. It only maintains a list of molecules. | 
| 80 | < | * And the Molecule class will maintain all of the concrete objects (atoms, bond, bend, torsions, rigid bodies, | 
| 81 | < | * cutoff groups, constrains). | 
| 82 | < | * Another major change is the index. No matter single version or parallel version,  atoms and | 
| 83 | < | * rigid bodies have both global index and local index. Local index is not important to molecule as well as | 
| 84 | < | * cutoff group. | 
| 78 | > | * @brief One of the heavy weight classes of OOPSE, SimInfo maintains a list of molecules. | 
| 79 | > | * The Molecule class maintains all of the concrete objects | 
| 80 | > | * (atoms, bond, bend, torsions, rigid bodies, cutoff groups, constrains). | 
| 81 | > | * In both the  single and parallel versions,  atoms and | 
| 82 | > | * rigid bodies have both global and local indices.  The local index is | 
| 83 | > | * not relevant to molecules or cutoff groups. | 
| 84 |  | */ | 
| 85 |  | class SimInfo { | 
| 86 |  | public: | 
| 94 |  | * @param simParams | 
| 95 |  | * @note | 
| 96 |  | */ | 
| 97 | < | SimInfo(MakeStamps* stamps, std::vector<std::pair<MoleculeStamp*, int> >& molStampPairs, ForceField* ff, Globals* simParams); | 
| 97 | > | SimInfo(ForceField* ff, Globals* simParams); | 
| 98 |  | virtual ~SimInfo(); | 
| 99 |  |  | 
| 100 |  | /** | 
| 206 |  |  | 
| 207 |  | /** Returns the number of degrees of freedom */ | 
| 208 |  | int getNdf() { | 
| 209 | < | return ndf_; | 
| 209 | > | return ndf_ - getFdf(); | 
| 210 |  | } | 
| 211 |  |  | 
| 212 |  | /** Returns the number of raw degrees of freedom */ | 
| 217 |  | /** Returns the number of translational degrees of freedom */ | 
| 218 |  | int getNdfTrans() { | 
| 219 |  | return ndfTrans_; | 
| 220 | + | } | 
| 221 | + |  | 
| 222 | + | /** sets the current number of frozen degrees of freedom */ | 
| 223 | + | void setFdf(int fdf) { | 
| 224 | + | fdf_local = fdf; | 
| 225 |  | } | 
| 226 |  |  | 
| 227 | + | int getFdf(); | 
| 228 | + |  | 
| 229 |  | //getNZconstraint and setNZconstraint ruin the coherent of SimInfo class, need refactorying | 
| 230 |  |  | 
| 231 |  | /** Returns the total number of z-constraint molecules in the system */ | 
| 305 |  | return i != molecules_.end() ? i->second : NULL; | 
| 306 |  | } | 
| 307 |  |  | 
| 308 | < | /** Calculate the maximum cutoff radius based on the atom types */ | 
| 303 | < | double calcMaxCutoffRadius(); | 
| 304 | < |  | 
| 305 | < | double getRcut() { | 
| 308 | > | RealType getRcut() { | 
| 309 |  | return rcut_; | 
| 310 |  | } | 
| 311 |  |  | 
| 312 | < | double getRsw() { | 
| 312 | > | RealType getRsw() { | 
| 313 |  | return rsw_; | 
| 314 |  | } | 
| 315 | + |  | 
| 316 | + | RealType getList() { | 
| 317 | + | return rlist_; | 
| 318 | + | } | 
| 319 |  |  | 
| 320 |  | std::string getFinalConfigFileName() { | 
| 321 |  | return finalConfigFileName_; | 
| 372 |  | return fortranInitialized_; | 
| 373 |  | } | 
| 374 |  |  | 
| 375 | + | bool getCalcBoxDipole() { | 
| 376 | + | return calcBoxDipole_; | 
| 377 | + | } | 
| 378 | + |  | 
| 379 |  | //below functions are just forward functions | 
| 380 |  | //To compose or to inherit is always a hot debate. In general, is-a relation need subclassing, in the | 
| 381 |  | //the other hand, has-a relation need composing. | 
| 433 |  |  | 
| 434 |  | friend std::ostream& operator <<(std::ostream& o, SimInfo& info); | 
| 435 |  |  | 
| 436 | < | void getCutoff(double& rcut, double& rsw); | 
| 436 | > | void getCutoff(RealType& rcut, RealType& rsw); | 
| 437 |  |  | 
| 438 |  | private: | 
| 439 |  |  | 
| 450 |  | void setupCutoff(); | 
| 451 |  |  | 
| 452 |  | /** Figure out which coulombic correction method to use and pass to fortran */ | 
| 453 | < | void setupCoulombicCorrection( int isError ); | 
| 453 | > | void setupElectrostaticSummationMethod( int isError ); | 
| 454 |  |  | 
| 455 | + | /** Figure out which polynomial type to use for the switching function */ | 
| 456 | + | void setupSwitchingFunction(); | 
| 457 | + |  | 
| 458 | + | /** Determine if we need to accumulate the simulation box dipole */ | 
| 459 | + | void setupAccumulateBoxDipole(); | 
| 460 | + |  | 
| 461 |  | /** Calculates the number of degress of freedom in the whole system */ | 
| 462 |  | void calcNdf(); | 
| 463 |  | void calcNdfRaw(); | 
| 464 |  | void calcNdfTrans(); | 
| 465 |  |  | 
| 466 | + | ForceField* forceField_; | 
| 467 | + | Globals* simParams_; | 
| 468 | + |  | 
| 469 | + | std::map<int, Molecule*>  molecules_; /**< Molecule array */ | 
| 470 | + |  | 
| 471 |  | /** | 
| 472 |  | * Adds molecule stamp and the total number of the molecule with same molecule stamp in the whole | 
| 473 |  | * system. | 
| 474 |  | */ | 
| 475 |  | void addMoleculeStamp(MoleculeStamp* molStamp, int nmol); | 
| 454 | – |  | 
| 455 | – | MakeStamps* stamps_; | 
| 456 | – | ForceField* forceField_; | 
| 457 | – | Globals* simParams_; | 
| 458 | – |  | 
| 459 | – | std::map<int, Molecule*>  molecules_; /**< Molecule array */ | 
| 476 |  |  | 
| 477 |  | //degress of freedom | 
| 478 |  | int ndf_;           /**< number of degress of freedom (excludes constraints),  ndf_ is local */ | 
| 479 | + | int fdf_local;       /**< number of frozen degrees of freedom */ | 
| 480 | + | int fdf_;            /**< number of frozen degrees of freedom */ | 
| 481 |  | int ndfRaw_;    /**< number of degress of freedom (includes constraints),  ndfRaw_ is local */ | 
| 482 |  | int ndfTrans_; /**< number of translation degress of freedom, ndfTrans_ is local */ | 
| 483 |  | int nZconstraint_; /** number of  z-constraint molecules, nZconstraint_ is global */ | 
| 535 |  | std::string statFileName_; | 
| 536 |  | std::string restFileName_; | 
| 537 |  |  | 
| 538 | < | double rcut_;       /**< cutoff radius*/ | 
| 539 | < | double rsw_;        /**< radius of switching function*/ | 
| 538 | > | RealType rcut_;       /**< cutoff radius*/ | 
| 539 | > | RealType rsw_;        /**< radius of switching function*/ | 
| 540 | > | RealType rlist_;      /**< neighbor list radius */ | 
| 541 |  |  | 
| 542 |  | bool fortranInitialized_; /**< flag indicate whether fortran side is initialized */ | 
| 543 |  |  | 
| 544 | + | bool calcBoxDipole_; /**< flag to indicate whether or not we calculate the simulation box dipole moment */ | 
| 545 | + |  | 
| 546 |  | #ifdef IS_MPI | 
| 547 |  | //in Parallel version, we need MolToProc | 
| 548 |  | public: |