| 35 | 
  | 
 *                                                                       | 
| 36 | 
  | 
 * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).              | 
| 37 | 
  | 
 * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).           | 
| 38 | 
< | 
 * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).           | 
| 38 | 
> | 
 * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008).           | 
| 39 | 
  | 
 * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010). | 
| 40 | 
  | 
 * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). | 
| 41 | 
  | 
 */ | 
| 91 | 
  | 
    /** | 
| 92 | 
  | 
     * Constructor of SimInfo | 
| 93 | 
  | 
     * | 
| 94 | 
< | 
     * @param molStampPairs MoleculeStamp Array. The first element of | 
| 95 | 
< | 
     * the pair is molecule stamp, the second element is the total | 
| 96 | 
< | 
     * number of molecules with the same molecule stamp in the system | 
| 94 | 
> | 
     * @param ff pointer to a concrete ForceField instance | 
| 95 | 
  | 
     * | 
| 96 | 
< | 
     * @param ff pointer of a concrete ForceField instance | 
| 99 | 
< | 
     * | 
| 100 | 
< | 
     * @param simParams  | 
| 96 | 
> | 
     * @param simParams pointer to the simulation parameters in a Globals object | 
| 97 | 
  | 
     */ | 
| 98 | 
  | 
    SimInfo(ForceField* ff, Globals* simParams); | 
| 99 | 
  | 
    virtual ~SimInfo(); | 
| 104 | 
  | 
     * @return return true if adding successfully, return false if the | 
| 105 | 
  | 
     * molecule is already in SimInfo | 
| 106 | 
  | 
     * | 
| 107 | 
< | 
     * @param mol molecule to be added | 
| 107 | 
> | 
     * @param mol Molecule to be added | 
| 108 | 
  | 
     */ | 
| 109 | 
  | 
    bool addMolecule(Molecule* mol); | 
| 110 | 
  | 
 | 
| 149 | 
  | 
      return nGlobalRigidBodies_; | 
| 150 | 
  | 
    } | 
| 151 | 
  | 
 | 
| 152 | 
< | 
    int getNGlobalConstraints(); | 
| 152 | 
> | 
    /** Returns the number of global bonds */         | 
| 153 | 
> | 
    unsigned int getNGlobalBonds(){ | 
| 154 | 
> | 
      return nGlobalBonds_; | 
| 155 | 
> | 
    } | 
| 156 | 
> | 
 | 
| 157 | 
> | 
    /** Returns the number of global bends */         | 
| 158 | 
> | 
    unsigned int getNGlobalBends() { | 
| 159 | 
> | 
      return nGlobalBends_; | 
| 160 | 
> | 
    } | 
| 161 | 
> | 
 | 
| 162 | 
> | 
    /** Returns the number of global torsions */         | 
| 163 | 
> | 
    unsigned int getNGlobalTorsions() { | 
| 164 | 
> | 
      return nGlobalTorsions_; | 
| 165 | 
> | 
    } | 
| 166 | 
> | 
 | 
| 167 | 
> | 
    /** Returns the number of global inversions */         | 
| 168 | 
> | 
    unsigned int getNGlobalInversions() { | 
| 169 | 
> | 
      return nGlobalInversions_; | 
| 170 | 
> | 
    } | 
| 171 | 
> | 
 | 
| 172 | 
> | 
    unsigned int getNGlobalConstraints() { | 
| 173 | 
> | 
      if (!hasNGlobalConstraints_) calcNConstraints(); | 
| 174 | 
> | 
      return nGlobalConstraints_; | 
| 175 | 
> | 
    } | 
| 176 | 
  | 
    /**  | 
| 177 | 
  | 
     * Returns the number of local molecules. | 
| 178 | 
  | 
     * @return the number of local molecules  | 
| 204 | 
  | 
      return nTorsions_; | 
| 205 | 
  | 
    } | 
| 206 | 
  | 
 | 
| 207 | 
< | 
    /** Returns the number of local torsions */         | 
| 207 | 
> | 
    /** Returns the number of local inversions */         | 
| 208 | 
  | 
    unsigned int getNInversions() { | 
| 209 | 
  | 
      return nInversions_; | 
| 210 | 
  | 
    } | 
| 293 | 
  | 
    SnapshotManager* getSnapshotManager() { | 
| 294 | 
  | 
      return sman_; | 
| 295 | 
  | 
    } | 
| 296 | 
< | 
 | 
| 296 | 
> | 
    /** Returns the storage layout (computed by SimCreator) */ | 
| 297 | 
> | 
    int getStorageLayout() { | 
| 298 | 
> | 
      return storageLayout_; | 
| 299 | 
> | 
    } | 
| 300 | 
> | 
    /** Sets the storage layout (computed by SimCreator) */ | 
| 301 | 
> | 
    void setStorageLayout(int sl) { | 
| 302 | 
> | 
      storageLayout_ = sl; | 
| 303 | 
> | 
    } | 
| 304 | 
> | 
     | 
| 305 | 
  | 
    /** Sets the snapshot manager. */ | 
| 306 | 
  | 
    void setSnapshotManager(SnapshotManager* sman); | 
| 307 | 
  | 
         | 
| 412 | 
  | 
 | 
| 413 | 
  | 
    /**  | 
| 414 | 
  | 
     * Sets GlobalGroupMembership | 
| 388 | 
– | 
     * @see #SimCreator::setGlobalIndex | 
| 415 | 
  | 
     */   | 
| 416 | 
< | 
    void setGlobalGroupMembership(const vector<int>& globalGroupMembership) { | 
| 417 | 
< | 
      assert(globalGroupMembership.size() == static_cast<size_t>(nGlobalAtoms_)); | 
| 418 | 
< | 
      globalGroupMembership_ = globalGroupMembership; | 
| 416 | 
> | 
    void setGlobalGroupMembership(const vector<int>& ggm) { | 
| 417 | 
> | 
      assert(ggm.size() == static_cast<size_t>(nGlobalAtoms_)); | 
| 418 | 
> | 
      globalGroupMembership_ = ggm; | 
| 419 | 
  | 
    } | 
| 420 | 
  | 
 | 
| 421 | 
  | 
    /**  | 
| 422 | 
  | 
     * Sets GlobalMolMembership | 
| 397 | 
– | 
     * @see #SimCreator::setGlobalIndex | 
| 423 | 
  | 
     */         | 
| 424 | 
< | 
    void setGlobalMolMembership(const vector<int>& globalMolMembership) { | 
| 425 | 
< | 
      assert(globalMolMembership.size() == static_cast<size_t>(nGlobalAtoms_)); | 
| 426 | 
< | 
      globalMolMembership_ = globalMolMembership; | 
| 424 | 
> | 
    void setGlobalMolMembership(const vector<int>& gmm) { | 
| 425 | 
> | 
      assert(gmm.size() == (static_cast<size_t>(nGlobalAtoms_ +  | 
| 426 | 
> | 
                                                nGlobalRigidBodies_))); | 
| 427 | 
> | 
      globalMolMembership_ = gmm; | 
| 428 | 
  | 
    } | 
| 429 | 
  | 
 | 
| 430 | 
  | 
 | 
| 435 | 
  | 
    bool getCalcBoxDipole() { | 
| 436 | 
  | 
      return calcBoxDipole_; | 
| 437 | 
  | 
    } | 
| 438 | 
+ | 
    bool getCalcBoxQuadrupole() { | 
| 439 | 
+ | 
      return calcBoxQuadrupole_; | 
| 440 | 
+ | 
    } | 
| 441 | 
  | 
 | 
| 442 | 
  | 
    bool getUseAtomicVirial() { | 
| 443 | 
  | 
      return useAtomicVirial_; | 
| 494 | 
  | 
 | 
| 495 | 
  | 
    /** Returns the set of atom types present in this simulation */ | 
| 496 | 
  | 
    set<AtomType*> getSimulatedAtomTypes(); | 
| 497 | 
+ | 
 | 
| 498 | 
+ | 
    /** Returns the global count of atoms of a particular type */ | 
| 499 | 
+ | 
    int getGlobalCountOfType(AtomType* atype); | 
| 500 | 
  | 
         | 
| 501 | 
  | 
    friend ostream& operator <<(ostream& o, SimInfo& info); | 
| 502 | 
  | 
 | 
| 508 | 
  | 
    void setupSimVariables(); | 
| 509 | 
  | 
 | 
| 510 | 
  | 
 | 
| 479 | 
– | 
    /** Determine if we need to accumulate the simulation box dipole */ | 
| 480 | 
– | 
    void setupAccumulateBoxDipole(); | 
| 481 | 
– | 
 | 
| 511 | 
  | 
    /** Calculates the number of degress of freedom in the whole system */ | 
| 512 | 
  | 
    void calcNdf(); | 
| 513 | 
  | 
    void calcNdfRaw(); | 
| 514 | 
  | 
    void calcNdfTrans(); | 
| 515 | 
+ | 
    void calcNConstraints(); | 
| 516 | 
  | 
 | 
| 517 | 
  | 
    /** | 
| 518 | 
  | 
     * Adds molecule stamp and the total number of the molecule with | 
| 543 | 
  | 
    int nGlobalIntegrableObjects_; /**< number of integrable objects in this system */ | 
| 544 | 
  | 
    int nGlobalRigidBodies_;       /**< number of rigid bodies in this system (GLOBAL) */ | 
| 545 | 
  | 
    int nGlobalFluctuatingCharges_;/**< number of fluctuating charges in this system (GLOBAL) */ | 
| 546 | 
< | 
     | 
| 547 | 
< | 
        | 
| 546 | 
> | 
    int nGlobalBonds_;              /**< number of bonds in the system */ | 
| 547 | 
> | 
    int nGlobalBends_;              /**< number of bends in the system */ | 
| 548 | 
> | 
    int nGlobalTorsions_;           /**< number of torsions in the system */ | 
| 549 | 
> | 
    int nGlobalInversions_;         /**< number of inversions in the system */ | 
| 550 | 
> | 
    int nGlobalConstraints_;        /**< number of constraints in the system */ | 
| 551 | 
> | 
    bool hasNGlobalConstraints_; | 
| 552 | 
> | 
 | 
| 553 | 
  | 
    /// Degress of freedom | 
| 554 | 
  | 
    int ndf_;          /**< number of degress of freedom (excludes constraints) (LOCAL) */ | 
| 555 | 
  | 
    int ndfLocal_;     /**< number of degrees of freedom (LOCAL, excludes constraints) */ | 
| 617 | 
  | 
    vector<int> identArray_; | 
| 618 | 
  | 
  public: | 
| 619 | 
  | 
    vector<int> getIdentArray() { return identArray_; } | 
| 620 | 
+ | 
 | 
| 621 | 
+ | 
    /**  | 
| 622 | 
+ | 
     * A vector that contains information about the local region of an | 
| 623 | 
+ | 
     * atom (used for fluctuating charges, etc.)  | 
| 624 | 
+ | 
     */ | 
| 625 | 
  | 
  private: | 
| 626 | 
< | 
     | 
| 626 | 
> | 
    vector<int> regions_; | 
| 627 | 
> | 
  public: | 
| 628 | 
> | 
    vector<int> getRegions() { return regions_; } | 
| 629 | 
> | 
  private: | 
| 630 | 
  | 
    /**  | 
| 631 | 
  | 
     * A vector which contains the fractional contribution of an | 
| 632 | 
  | 
     * atom's mass to the total mass of the cutoffGroup that atom | 
| 653 | 
  | 
 | 
| 654 | 
  | 
    PropertyMap properties_;       /**< Generic Properties can be added */ | 
| 655 | 
  | 
    SnapshotManager* sman_;        /**< SnapshotManager (handles particle positions, etc.) */ | 
| 656 | 
+ | 
    int storageLayout_;            /**< Bits to tell how much data to store on each object */ | 
| 657 | 
  | 
 | 
| 658 | 
  | 
    /**  | 
| 659 | 
  | 
     * The reason to have a local index manager is that when molecule | 
| 673 | 
  | 
    string dumpFileName_; | 
| 674 | 
  | 
    string statFileName_; | 
| 675 | 
  | 
    string restFileName_; | 
| 632 | 
– | 
         | 
| 676 | 
  | 
 | 
| 677 | 
  | 
    bool topologyDone_;  /** flag to indicate whether the topology has | 
| 678 | 
  | 
                             been scanned and all the relevant | 
| 680 | 
  | 
     | 
| 681 | 
  | 
    bool calcBoxDipole_; /**< flag to indicate whether or not we calculate  | 
| 682 | 
  | 
                            the simulation box dipole moment */ | 
| 683 | 
+ | 
    bool calcBoxQuadrupole_; /**< flag to indicate whether or not we calculate  | 
| 684 | 
+ | 
                                the simulation box quadrupole moment */ | 
| 685 | 
  | 
     | 
| 686 | 
  | 
    bool useAtomicVirial_; /**< flag to indicate whether or not we use  | 
| 687 | 
  | 
                              Atomic Virials to calculate the pressure */ | 
| 712 | 
  | 
     | 
| 713 | 
  | 
    /**  | 
| 714 | 
  | 
     * Set MolToProcMap array | 
| 670 | 
– | 
     * @see #SimCreator::divideMolecules | 
| 715 | 
  | 
     */ | 
| 716 | 
  | 
    void setMolToProcMap(const vector<int>& molToProcMap) { | 
| 717 | 
  | 
      molToProcMap_ = molToProcMap; |