ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/brains/SimCreator.cpp
(Generate patch)

Comparing branches/development/src/brains/SimCreator.cpp (file contents):
Revision 1725 by gezelter, Sat May 26 18:13:43 2012 UTC vs.
Revision 1794 by gezelter, Thu Sep 6 19:44:06 2012 UTC

# Line 256 | Line 256 | namespace OpenMD {
256      int metaDataBlockStart = -1;
257      int metaDataBlockEnd = -1;
258      int i;
259 <    int mdOffset;
259 >    streamoff mdOffset;
260      int mdFileVersion;
261  
262 +
263   #ifdef IS_MPI            
264      const int masterNode = 0;
265      if (worldRank == masterNode) {
266   #endif
267  
268 <      std::ifstream mdFile_(mdFileName.c_str());
268 >      std::ifstream mdFile_;
269 >      mdFile_.open(mdFileName.c_str(), ifstream::in | ifstream::binary);
270        
271        if (mdFile_.fail()) {
272          sprintf(painCave.errMsg,
# Line 673 | Line 675 | namespace OpenMD {
675      set<AtomType*>::iterator i;
676      bool hasDirectionalAtoms = false;
677      bool hasFixedCharge = false;
678 <    bool hasMultipoles = false;    
678 >    bool hasDipoles = false;    
679 >    bool hasQuadrupoles = false;    
680      bool hasPolarizable = false;    
681      bool hasFluctuatingCharge = false;    
682      bool hasMetallic = false;
# Line 695 | Line 698 | namespace OpenMD {
698        if (da.isDirectional()){
699          hasDirectionalAtoms = true;
700        }
701 <      if (ma.isMultipole()){
702 <        hasMultipoles = true;
701 >      if (ma.isDipole()){
702 >        hasDipoles = true;
703        }
704 +      if (ma.isQuadrupole()){
705 +        hasQuadrupoles = true;
706 +      }
707        if (ea.isEAM() || sca.isSuttonChen()){
708          hasMetallic = true;
709        }
# Line 721 | Line 727 | namespace OpenMD {
727          storageLayout |= DataStorage::dslTorque;
728        }
729      }
730 <    if (hasMultipoles) {
731 <      storageLayout |= DataStorage::dslElectroFrame;
730 >    if (hasDipoles) {
731 >      storageLayout |= DataStorage::dslDipole;
732      }
733 +    if (hasQuadrupoles) {
734 +      storageLayout |= DataStorage::dslQuadrupole;
735 +    }
736      if (hasFixedCharge || hasFluctuatingCharge) {
737        storageLayout |= DataStorage::dslSkippedCharge;
738      }
# Line 761 | Line 770 | namespace OpenMD {
770      if (simParams->getOutputElectricField()) {
771        storageLayout |= DataStorage::dslElectricField;
772      }
773 +
774      if (simParams->getOutputFluctuatingCharges()) {
775        storageLayout |= DataStorage::dslFlucQPosition;
776        storageLayout |= DataStorage::dslFlucQVelocity;
# Line 786 | Line 796 | namespace OpenMD {
796      int nGlobalAtoms = info->getNGlobalAtoms();
797      
798      beginAtomIndex = 0;
799 <    beginRigidBodyIndex = 0;
799 >    //rigidbody's index begins right after atom's
800 >    beginRigidBodyIndex = info->getNGlobalAtoms();
801      beginCutoffGroupIndex = 0;
802  
803      for(int i = 0; i < info->getNGlobalMolecules(); i++) {
# Line 904 | Line 915 | namespace OpenMD {
915      for (mol = info->beginMolecule(mi); mol != NULL; mol = info->nextMolecule(mi)) {
916        int myGlobalIndex = mol->getGlobalIndex();
917        int globalIO = startingIOIndexForMol[myGlobalIndex];
918 <      for (StuntDouble* integrableObject = mol->beginIntegrableObject(ioi); integrableObject != NULL;
919 <           integrableObject = mol->nextIntegrableObject(ioi)) {
920 <        integrableObject->setGlobalIntegrableObjectIndex(globalIO);
921 <        IOIndexToIntegrableObject[globalIO] = integrableObject;
918 >      for (StuntDouble* sd = mol->beginIntegrableObject(ioi); sd != NULL;
919 >           sd = mol->nextIntegrableObject(ioi)) {
920 >        sd->setGlobalIntegrableObjectIndex(globalIO);
921 >        IOIndexToIntegrableObject[globalIO] = sd;
922          globalIO++;
923        }
924      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines