| 62 |
|
#include "UseTheForce/ForceField.hpp" |
| 63 |
|
#include "utils/PropertyMap.hpp" |
| 64 |
|
#include "utils/LocalIndexManager.hpp" |
| 65 |
+ |
#include "nonbonded/SwitchingFunction.hpp" |
| 66 |
|
|
| 67 |
< |
//another nonsense macro declaration |
| 67 |
< |
#define __OPENMD_C |
| 68 |
< |
#include "brains/fSimulation.h" |
| 69 |
< |
|
| 67 |
> |
using namespace std; |
| 68 |
|
namespace OpenMD{ |
| 69 |
< |
|
| 72 |
< |
//forward decalration |
| 69 |
> |
//forward declaration |
| 70 |
|
class SnapshotManager; |
| 71 |
|
class Molecule; |
| 72 |
|
class SelectionManager; |
| 73 |
|
class StuntDouble; |
| 74 |
+ |
|
| 75 |
|
/** |
| 76 |
< |
* @class SimInfo SimInfo.hpp "brains/SimInfo.hpp" |
| 77 |
< |
* @brief One of the heavy weight classes of OpenMD, SimInfo maintains a list of molecules. |
| 78 |
< |
* The Molecule class maintains all of the concrete objects |
| 79 |
< |
* (atoms, bond, bend, torsions, inversions, rigid bodies, cutoff groups, |
| 80 |
< |
* constraints). In both the single and parallel versions, atoms and |
| 81 |
< |
* rigid bodies have both global and local indices. The local index is |
| 82 |
< |
* not relevant to molecules or cutoff groups. |
| 83 |
< |
*/ |
| 76 |
> |
* @class SimInfo SimInfo.hpp "brains/SimInfo.hpp" |
| 77 |
> |
* |
| 78 |
> |
* @brief One of the heavy-weight classes of OpenMD, SimInfo |
| 79 |
> |
* maintains objects and variables relating to the current |
| 80 |
> |
* simulation. This includes the master list of Molecules. The |
| 81 |
> |
* Molecule class maintains all of the concrete objects (Atoms, |
| 82 |
> |
* Bond, Bend, Torsions, Inversions, RigidBodies, CutoffGroups, |
| 83 |
> |
* Constraints). In both the single and parallel versions, Atoms and |
| 84 |
> |
* RigidBodies have both global and local indices. |
| 85 |
> |
*/ |
| 86 |
|
class SimInfo { |
| 87 |
|
public: |
| 88 |
< |
typedef std::map<int, Molecule*>::iterator MoleculeIterator; |
| 89 |
< |
|
| 88 |
> |
typedef map<int, Molecule*>::iterator MoleculeIterator; |
| 89 |
> |
|
| 90 |
|
/** |
| 91 |
|
* Constructor of SimInfo |
| 92 |
< |
* @param molStampPairs MoleculeStamp Array. The first element of the pair is molecule stamp, the |
| 93 |
< |
* second element is the total number of molecules with the same molecule stamp in the system |
| 92 |
> |
* |
| 93 |
> |
* @param molStampPairs MoleculeStamp Array. The first element of |
| 94 |
> |
* the pair is molecule stamp, the second element is the total |
| 95 |
> |
* number of molecules with the same molecule stamp in the system |
| 96 |
> |
* |
| 97 |
|
* @param ff pointer of a concrete ForceField instance |
| 98 |
+ |
* |
| 99 |
|
* @param simParams |
| 96 |
– |
* @note |
| 100 |
|
*/ |
| 101 |
|
SimInfo(ForceField* ff, Globals* simParams); |
| 102 |
|
virtual ~SimInfo(); |
| 103 |
|
|
| 104 |
|
/** |
| 105 |
|
* Adds a molecule |
| 106 |
< |
* @return return true if adding successfully, return false if the molecule is already in SimInfo |
| 106 |
> |
* |
| 107 |
> |
* @return return true if adding successfully, return false if the |
| 108 |
> |
* molecule is already in SimInfo |
| 109 |
> |
* |
| 110 |
|
* @param mol molecule to be added |
| 111 |
|
*/ |
| 112 |
|
bool addMolecule(Molecule* mol); |
| 113 |
|
|
| 114 |
|
/** |
| 115 |
|
* Removes a molecule from SimInfo |
| 116 |
< |
* @return true if removing successfully, return false if molecule is not in this SimInfo |
| 116 |
> |
* |
| 117 |
> |
* @return true if removing successfully, return false if molecule |
| 118 |
> |
* is not in this SimInfo |
| 119 |
|
*/ |
| 120 |
|
bool removeMolecule(Molecule* mol); |
| 121 |
|
|
| 135 |
|
} |
| 136 |
|
|
| 137 |
|
/** |
| 138 |
< |
* Returns the total number of integrable objects (total number of rigid bodies plus the total number |
| 139 |
< |
* of atoms which do not belong to the rigid bodies) in the system |
| 138 |
> |
* Returns the total number of integrable objects (total number of |
| 139 |
> |
* rigid bodies plus the total number of atoms which do not belong |
| 140 |
> |
* to the rigid bodies) in the system |
| 141 |
|
*/ |
| 142 |
|
int getNGlobalIntegrableObjects() { |
| 143 |
|
return nGlobalIntegrableObjects_; |
| 144 |
|
} |
| 145 |
|
|
| 146 |
|
/** |
| 147 |
< |
* Returns the total number of integrable objects (total number of rigid bodies plus the total number |
| 148 |
< |
* of atoms which do not belong to the rigid bodies) in the system |
| 147 |
> |
* Returns the total number of integrable objects (total number of |
| 148 |
> |
* rigid bodies plus the total number of atoms which do not belong |
| 149 |
> |
* to the rigid bodies) in the system |
| 150 |
|
*/ |
| 151 |
|
int getNGlobalRigidBodies() { |
| 152 |
|
return nGlobalRigidBodies_; |
| 166 |
|
return nAtoms_; |
| 167 |
|
} |
| 168 |
|
|
| 169 |
+ |
/** Returns the number of effective cutoff groups on local processor */ |
| 170 |
+ |
unsigned int getNLocalCutoffGroups(); |
| 171 |
+ |
|
| 172 |
|
/** Returns the number of local bonds */ |
| 173 |
|
unsigned int getNBonds(){ |
| 174 |
|
return nBonds_; |
| 244 |
|
|
| 245 |
|
int getFdf(); |
| 246 |
|
|
| 247 |
< |
//getNZconstraint and setNZconstraint ruin the coherent of SimInfo class, need refactorying |
| 247 |
> |
//getNZconstraint and setNZconstraint ruin the coherence of |
| 248 |
> |
//SimInfo class, need refactoring |
| 249 |
|
|
| 250 |
|
/** Returns the total number of z-constraint molecules in the system */ |
| 251 |
|
int getNZconstraint() { |
| 281 |
|
|
| 282 |
|
/** Returns the center of the mass of the whole system.*/ |
| 283 |
|
Vector3d getCom(); |
| 284 |
< |
/** Returns the center of the mass and Center of Mass velocity of the whole system.*/ |
| 284 |
> |
/** Returns the center of the mass and Center of Mass velocity of |
| 285 |
> |
the whole system.*/ |
| 286 |
|
void getComAll(Vector3d& com,Vector3d& comVel); |
| 287 |
|
|
| 288 |
< |
/** Returns intertia tensor for the entire system and system Angular Momentum.*/ |
| 288 |
> |
/** Returns intertia tensor for the entire system and system |
| 289 |
> |
Angular Momentum.*/ |
| 290 |
|
void getInertiaTensor(Mat3x3d &intertiaTensor,Vector3d &angularMomentum); |
| 291 |
|
|
| 292 |
|
/** Returns system angular momentum */ |
| 293 |
|
Vector3d getAngularMomentum(); |
| 294 |
|
|
| 295 |
< |
/** Returns volume of system as estimated by an ellipsoid defined by the radii of gyration*/ |
| 295 |
> |
/** Returns volume of system as estimated by an ellipsoid defined |
| 296 |
> |
by the radii of gyration*/ |
| 297 |
|
void getGyrationalVolume(RealType &vol); |
| 298 |
< |
/** Overloaded version of gyrational volume that also returns det(I) so dV/dr can be calculated*/ |
| 298 |
> |
/** Overloaded version of gyrational volume that also returns |
| 299 |
> |
det(I) so dV/dr can be calculated*/ |
| 300 |
|
void getGyrationalVolume(RealType &vol, RealType &detI); |
| 301 |
< |
/** main driver function to interact with fortran during the initialization and molecule migration */ |
| 301 |
> |
|
| 302 |
|
void update(); |
| 303 |
+ |
/** |
| 304 |
+ |
* Do final bookkeeping before Force managers need their data. |
| 305 |
+ |
*/ |
| 306 |
+ |
void prepareTopology(); |
| 307 |
|
|
| 308 |
+ |
|
| 309 |
|
/** Returns the local index manager */ |
| 310 |
|
LocalIndexManager* getLocalIndexManager() { |
| 311 |
|
return &localIndexMan_; |
| 341 |
|
return globalMolMembership_[id]; |
| 342 |
|
} |
| 343 |
|
|
| 344 |
< |
RealType getRcut() { |
| 345 |
< |
return rcut_; |
| 346 |
< |
} |
| 344 |
> |
/** |
| 345 |
> |
* returns a vector which maps the local atom index on this |
| 346 |
> |
* processor to the global atom index. With only one processor, |
| 347 |
> |
* these should be identical. |
| 348 |
> |
*/ |
| 349 |
> |
vector<int> getGlobalAtomIndices(); |
| 350 |
|
|
| 351 |
< |
RealType getRsw() { |
| 352 |
< |
return rsw_; |
| 353 |
< |
} |
| 354 |
< |
|
| 355 |
< |
RealType getList() { |
| 356 |
< |
return rlist_; |
| 357 |
< |
} |
| 351 |
> |
/** |
| 352 |
> |
* returns a vector which maps the local cutoff group index on |
| 353 |
> |
* this processor to the global cutoff group index. With only one |
| 354 |
> |
* processor, these should be identical. |
| 355 |
> |
*/ |
| 356 |
> |
vector<int> getGlobalGroupIndices(); |
| 357 |
> |
|
| 358 |
|
|
| 359 |
< |
std::string getFinalConfigFileName() { |
| 359 |
> |
string getFinalConfigFileName() { |
| 360 |
|
return finalConfigFileName_; |
| 361 |
|
} |
| 362 |
|
|
| 363 |
< |
void setFinalConfigFileName(const std::string& fileName) { |
| 363 |
> |
void setFinalConfigFileName(const string& fileName) { |
| 364 |
|
finalConfigFileName_ = fileName; |
| 365 |
|
} |
| 366 |
|
|
| 367 |
< |
std::string getRawMetaData() { |
| 367 |
> |
string getRawMetaData() { |
| 368 |
|
return rawMetaData_; |
| 369 |
|
} |
| 370 |
< |
void setRawMetaData(const std::string& rawMetaData) { |
| 370 |
> |
void setRawMetaData(const string& rawMetaData) { |
| 371 |
|
rawMetaData_ = rawMetaData; |
| 372 |
|
} |
| 373 |
|
|
| 374 |
< |
std::string getDumpFileName() { |
| 374 |
> |
string getDumpFileName() { |
| 375 |
|
return dumpFileName_; |
| 376 |
|
} |
| 377 |
|
|
| 378 |
< |
void setDumpFileName(const std::string& fileName) { |
| 378 |
> |
void setDumpFileName(const string& fileName) { |
| 379 |
|
dumpFileName_ = fileName; |
| 380 |
|
} |
| 381 |
|
|
| 382 |
< |
std::string getStatFileName() { |
| 382 |
> |
string getStatFileName() { |
| 383 |
|
return statFileName_; |
| 384 |
|
} |
| 385 |
|
|
| 386 |
< |
void setStatFileName(const std::string& fileName) { |
| 386 |
> |
void setStatFileName(const string& fileName) { |
| 387 |
|
statFileName_ = fileName; |
| 388 |
|
} |
| 389 |
|
|
| 390 |
< |
std::string getRestFileName() { |
| 390 |
> |
string getRestFileName() { |
| 391 |
|
return restFileName_; |
| 392 |
|
} |
| 393 |
|
|
| 394 |
< |
void setRestFileName(const std::string& fileName) { |
| 394 |
> |
void setRestFileName(const string& fileName) { |
| 395 |
|
restFileName_ = fileName; |
| 396 |
|
} |
| 397 |
|
|
| 399 |
|
* Sets GlobalGroupMembership |
| 400 |
|
* @see #SimCreator::setGlobalIndex |
| 401 |
|
*/ |
| 402 |
< |
void setGlobalGroupMembership(const std::vector<int>& globalGroupMembership) { |
| 402 |
> |
void setGlobalGroupMembership(const vector<int>& globalGroupMembership) { |
| 403 |
|
assert(globalGroupMembership.size() == static_cast<size_t>(nGlobalAtoms_)); |
| 404 |
|
globalGroupMembership_ = globalGroupMembership; |
| 405 |
|
} |
| 408 |
|
* Sets GlobalMolMembership |
| 409 |
|
* @see #SimCreator::setGlobalIndex |
| 410 |
|
*/ |
| 411 |
< |
void setGlobalMolMembership(const std::vector<int>& globalMolMembership) { |
| 411 |
> |
void setGlobalMolMembership(const vector<int>& globalMolMembership) { |
| 412 |
|
assert(globalMolMembership.size() == static_cast<size_t>(nGlobalAtoms_)); |
| 413 |
|
globalMolMembership_ = globalMolMembership; |
| 414 |
|
} |
| 415 |
|
|
| 416 |
|
|
| 417 |
< |
bool isFortranInitialized() { |
| 418 |
< |
return fortranInitialized_; |
| 417 |
> |
bool isTopologyDone() { |
| 418 |
> |
return topologyDone_; |
| 419 |
|
} |
| 420 |
|
|
| 421 |
|
bool getCalcBoxDipole() { |
| 426 |
|
return useAtomicVirial_; |
| 427 |
|
} |
| 428 |
|
|
| 403 |
– |
//below functions are just forward functions |
| 404 |
– |
//To compose or to inherit is always a hot debate. In general, is-a relation need subclassing, in the |
| 405 |
– |
//the other hand, has-a relation need composing. |
| 429 |
|
/** |
| 430 |
|
* Adds property into property map |
| 431 |
|
* @param genData GenericData to be added into PropertyMap |
| 436 |
|
* Removes property from PropertyMap by name |
| 437 |
|
* @param propName the name of property to be removed |
| 438 |
|
*/ |
| 439 |
< |
void removeProperty(const std::string& propName); |
| 439 |
> |
void removeProperty(const string& propName); |
| 440 |
|
|
| 441 |
|
/** |
| 442 |
|
* clear all of the properties |
| 447 |
|
* Returns all names of properties |
| 448 |
|
* @return all names of properties |
| 449 |
|
*/ |
| 450 |
< |
std::vector<std::string> getPropertyNames(); |
| 450 |
> |
vector<string> getPropertyNames(); |
| 451 |
|
|
| 452 |
|
/** |
| 453 |
|
* Returns all of the properties in PropertyMap |
| 454 |
|
* @return all of the properties in PropertyMap |
| 455 |
|
*/ |
| 456 |
< |
std::vector<GenericData*> getProperties(); |
| 456 |
> |
vector<GenericData*> getProperties(); |
| 457 |
|
|
| 458 |
|
/** |
| 459 |
|
* Returns property |
| 461 |
|
* @return a pointer point to property with propName. If no property named propName |
| 462 |
|
* exists, return NULL |
| 463 |
|
*/ |
| 464 |
< |
GenericData* getPropertyByName(const std::string& propName); |
| 464 |
> |
GenericData* getPropertyByName(const string& propName); |
| 465 |
|
|
| 466 |
|
/** |
| 467 |
|
* add all special interaction pairs (including excluded |
| 475 |
|
*/ |
| 476 |
|
void removeInteractionPairs(Molecule* mol); |
| 477 |
|
|
| 478 |
< |
|
| 479 |
< |
/** Returns the unique atom types of local processor in an array */ |
| 457 |
< |
std::set<AtomType*> getUniqueAtomTypes(); |
| 478 |
> |
/** Returns the set of atom types present in this simulation */ |
| 479 |
> |
set<AtomType*> getSimulatedAtomTypes(); |
| 480 |
|
|
| 481 |
< |
friend std::ostream& operator <<(std::ostream& o, SimInfo& info); |
| 481 |
> |
friend ostream& operator <<(ostream& o, SimInfo& info); |
| 482 |
|
|
| 483 |
|
void getCutoff(RealType& rcut, RealType& rsw); |
| 484 |
|
|
| 485 |
|
private: |
| 486 |
|
|
| 487 |
< |
/** fill up the simtype struct*/ |
| 488 |
< |
void setupSimType(); |
| 487 |
> |
/** fill up the simtype struct and other simulation-related variables */ |
| 488 |
> |
void setupSimVariables(); |
| 489 |
|
|
| 468 |
– |
/** |
| 469 |
– |
* Setup Fortran Simulation |
| 470 |
– |
* @see #setupFortranParallel |
| 471 |
– |
*/ |
| 472 |
– |
void setupFortranSim(); |
| 490 |
|
|
| 474 |
– |
/** Figure out the radius of cutoff, radius of switching function and pass them to fortran */ |
| 475 |
– |
void setupCutoff(); |
| 476 |
– |
|
| 477 |
– |
/** Figure out which coulombic correction method to use and pass to fortran */ |
| 478 |
– |
void setupElectrostaticSummationMethod( int isError ); |
| 479 |
– |
|
| 480 |
– |
/** Figure out which polynomial type to use for the switching function */ |
| 481 |
– |
void setupSwitchingFunction(); |
| 482 |
– |
|
| 491 |
|
/** Determine if we need to accumulate the simulation box dipole */ |
| 492 |
|
void setupAccumulateBoxDipole(); |
| 493 |
|
|
| 496 |
|
void calcNdfRaw(); |
| 497 |
|
void calcNdfTrans(); |
| 498 |
|
|
| 491 |
– |
ForceField* forceField_; |
| 492 |
– |
Globals* simParams_; |
| 493 |
– |
|
| 494 |
– |
std::map<int, Molecule*> molecules_; /**< Molecule array */ |
| 495 |
– |
|
| 499 |
|
/** |
| 500 |
< |
* Adds molecule stamp and the total number of the molecule with same molecule stamp in the whole |
| 501 |
< |
* system. |
| 500 |
> |
* Adds molecule stamp and the total number of the molecule with |
| 501 |
> |
* same molecule stamp in the whole system. |
| 502 |
|
*/ |
| 503 |
|
void addMoleculeStamp(MoleculeStamp* molStamp, int nmol); |
| 501 |
– |
|
| 502 |
– |
//degress of freedom |
| 503 |
– |
int ndf_; /**< number of degress of freedom (excludes constraints), ndf_ is local */ |
| 504 |
– |
int fdf_local; /**< number of frozen degrees of freedom */ |
| 505 |
– |
int fdf_; /**< number of frozen degrees of freedom */ |
| 506 |
– |
int ndfRaw_; /**< number of degress of freedom (includes constraints), ndfRaw_ is local */ |
| 507 |
– |
int ndfTrans_; /**< number of translation degress of freedom, ndfTrans_ is local */ |
| 508 |
– |
int nZconstraint_; /** number of z-constraint molecules, nZconstraint_ is global */ |
| 509 |
– |
|
| 510 |
– |
//number of global objects |
| 511 |
– |
int nGlobalMols_; /**< number of molecules in the system */ |
| 512 |
– |
int nGlobalAtoms_; /**< number of atoms in the system */ |
| 513 |
– |
int nGlobalCutoffGroups_; /**< number of cutoff groups in this system */ |
| 514 |
– |
int nGlobalIntegrableObjects_; /**< number of integrable objects in this system */ |
| 515 |
– |
int nGlobalRigidBodies_; /**< number of rigid bodies in this system */ |
| 516 |
– |
/** |
| 517 |
– |
* the size of globalGroupMembership_ is nGlobalAtoms. Its index is global index of an atom, and the |
| 518 |
– |
* corresponding content is the global index of cutoff group this atom belong to. |
| 519 |
– |
* It is filled by SimCreator once and only once, since it never changed during the simulation. |
| 520 |
– |
*/ |
| 521 |
– |
std::vector<int> globalGroupMembership_; |
| 504 |
|
|
| 505 |
< |
/** |
| 506 |
< |
* the size of globalMolMembership_ is nGlobalAtoms. Its index is global index of an atom, and the |
| 507 |
< |
* corresponding content is the global index of molecule this atom belong to. |
| 526 |
< |
* It is filled by SimCreator once and only once, since it is never changed during the simulation. |
| 527 |
< |
*/ |
| 528 |
< |
std::vector<int> globalMolMembership_; |
| 505 |
> |
// Other classes holdingn important information |
| 506 |
> |
ForceField* forceField_; /**< provides access to defined atom types, bond types, etc. */ |
| 507 |
> |
Globals* simParams_; /**< provides access to simulation parameters set by user */ |
| 508 |
|
|
| 509 |
< |
|
| 531 |
< |
std::vector<int> molStampIds_; /**< stamp id array of all molecules in the system */ |
| 532 |
< |
std::vector<MoleculeStamp*> moleculeStamps_; /**< molecule stamps array */ |
| 533 |
< |
|
| 534 |
< |
//number of local objects |
| 509 |
> |
/// Counts of local objects |
| 510 |
|
int nAtoms_; /**< number of atoms in local processor */ |
| 511 |
|
int nBonds_; /**< number of bonds in local processor */ |
| 512 |
|
int nBends_; /**< number of bends in local processor */ |
| 516 |
|
int nIntegrableObjects_; /**< number of integrable objects in local processor */ |
| 517 |
|
int nCutoffGroups_; /**< number of cutoff groups in local processor */ |
| 518 |
|
int nConstraints_; /**< number of constraints in local processors */ |
| 519 |
+ |
|
| 520 |
+ |
/// Counts of global objects |
| 521 |
+ |
int nGlobalMols_; /**< number of molecules in the system (GLOBAL) */ |
| 522 |
+ |
int nGlobalAtoms_; /**< number of atoms in the system (GLOBAL) */ |
| 523 |
+ |
int nGlobalCutoffGroups_; /**< number of cutoff groups in this system (GLOBAL) */ |
| 524 |
+ |
int nGlobalIntegrableObjects_; /**< number of integrable objects in this system */ |
| 525 |
+ |
int nGlobalRigidBodies_; /**< number of rigid bodies in this system (GLOBAL) */ |
| 526 |
+ |
|
| 527 |
+ |
/// Degress of freedom |
| 528 |
+ |
int ndf_; /**< number of degress of freedom (excludes constraints) (LOCAL) */ |
| 529 |
+ |
int fdf_local; /**< number of frozen degrees of freedom (LOCAL) */ |
| 530 |
+ |
int fdf_; /**< number of frozen degrees of freedom (GLOBAL) */ |
| 531 |
+ |
int ndfRaw_; /**< number of degress of freedom (includes constraints), (LOCAL) */ |
| 532 |
+ |
int ndfTrans_; /**< number of translation degress of freedom, (LOCAL) */ |
| 533 |
+ |
int nZconstraint_; /**< number of z-constraint molecules (GLOBAL) */ |
| 534 |
|
|
| 535 |
< |
simtype fInfo_; /**< A dual struct shared by c++/fortran which indicates the atom types in simulation*/ |
| 536 |
< |
PairList excludedInteractions_; |
| 537 |
< |
PairList oneTwoInteractions_; |
| 538 |
< |
PairList oneThreeInteractions_; |
| 539 |
< |
PairList oneFourInteractions_; |
| 540 |
< |
PropertyMap properties_; /**< Generic Property */ |
| 541 |
< |
SnapshotManager* sman_; /**< SnapshotManager */ |
| 535 |
> |
/// logicals |
| 536 |
> |
bool usesPeriodicBoundaries_; /**< use periodic boundary conditions? */ |
| 537 |
> |
bool usesDirectionalAtoms_; /**< are there atoms with position AND orientation? */ |
| 538 |
> |
bool usesMetallicAtoms_; /**< are there transition metal atoms? */ |
| 539 |
> |
bool usesElectrostaticAtoms_; /**< are there electrostatic atoms? */ |
| 540 |
> |
bool usesAtomicVirial_; /**< are we computing atomic virials? */ |
| 541 |
> |
bool requiresPrepair_; /**< does this simulation require a pre-pair loop? */ |
| 542 |
> |
bool requiresSkipCorrection_; /**< does this simulation require a skip-correction? */ |
| 543 |
> |
bool requiresSelfCorrection_; /**< does this simulation require a self-correction? */ |
| 544 |
|
|
| 545 |
+ |
public: |
| 546 |
+ |
bool usesElectrostaticAtoms() { return usesElectrostaticAtoms_; } |
| 547 |
+ |
bool usesDirectionalAtoms() { return usesDirectionalAtoms_; } |
| 548 |
+ |
bool usesMetallicAtoms() { return usesMetallicAtoms_; } |
| 549 |
+ |
bool usesAtomicVirial() { return usesAtomicVirial_; } |
| 550 |
+ |
bool requiresPrepair() { return requiresPrepair_; } |
| 551 |
+ |
bool requiresSkipCorrection() { return requiresSkipCorrection_;} |
| 552 |
+ |
bool requiresSelfCorrection() { return requiresSelfCorrection_;} |
| 553 |
+ |
|
| 554 |
+ |
private: |
| 555 |
+ |
/// Data structures holding primary simulation objects |
| 556 |
+ |
map<int, Molecule*> molecules_; /**< map holding pointers to LOCAL molecules */ |
| 557 |
+ |
|
| 558 |
+ |
/// Stamps are templates for objects that are then used to create |
| 559 |
+ |
/// groups of objects. For example, a molecule stamp contains |
| 560 |
+ |
/// information on how to build that molecule (i.e. the topology, |
| 561 |
+ |
/// the atoms, the bonds, etc.) Once the system is built, the |
| 562 |
+ |
/// stamps are no longer useful. |
| 563 |
+ |
vector<int> molStampIds_; /**< stamp id for molecules in the system */ |
| 564 |
+ |
vector<MoleculeStamp*> moleculeStamps_; /**< molecule stamps array */ |
| 565 |
+ |
|
| 566 |
+ |
/** |
| 567 |
+ |
* A vector that maps between the global index of an atom, and the |
| 568 |
+ |
* global index of cutoff group the atom belong to. It is filled |
| 569 |
+ |
* by SimCreator once and only once, since it never changed during |
| 570 |
+ |
* the simulation. It should be nGlobalAtoms_ in size. |
| 571 |
+ |
*/ |
| 572 |
+ |
vector<int> globalGroupMembership_; |
| 573 |
+ |
public: |
| 574 |
+ |
vector<int> getGlobalGroupMembership() { return globalGroupMembership_; } |
| 575 |
+ |
private: |
| 576 |
+ |
|
| 577 |
+ |
/** |
| 578 |
+ |
* A vector that maps between the global index of an atom and the |
| 579 |
+ |
* global index of the molecule the atom belongs to. It is filled |
| 580 |
+ |
* by SimCreator once and only once, since it is never changed |
| 581 |
+ |
* during the simulation. It shoudl be nGlobalAtoms_ in size. |
| 582 |
+ |
*/ |
| 583 |
+ |
vector<int> globalMolMembership_; |
| 584 |
+ |
|
| 585 |
|
/** |
| 586 |
< |
* The reason to have a local index manager is that when molecule is migrating to other processors, |
| 587 |
< |
* the atoms and the rigid-bodies will release their local indices to LocalIndexManager. Combining the |
| 588 |
< |
* information of molecule migrating to current processor, Migrator class can query the LocalIndexManager |
| 589 |
< |
* to make a efficient data moving plan. |
| 586 |
> |
* A vector that maps between the local index of an atom and the |
| 587 |
> |
* index of the AtomType. |
| 588 |
> |
*/ |
| 589 |
> |
vector<int> identArray_; |
| 590 |
> |
public: |
| 591 |
> |
vector<int> getIdentArray() { return identArray_; } |
| 592 |
> |
private: |
| 593 |
> |
|
| 594 |
> |
/** |
| 595 |
> |
* A vector which contains the fractional contribution of an |
| 596 |
> |
* atom's mass to the total mass of the cutoffGroup that atom |
| 597 |
> |
* belongs to. In the case of single atom cutoff groups, the mass |
| 598 |
> |
* factor for that atom is 1. For massless atoms, the factor is |
| 599 |
> |
* also 1. |
| 600 |
> |
*/ |
| 601 |
> |
vector<RealType> massFactors_; |
| 602 |
> |
public: |
| 603 |
> |
vector<RealType> getMassFactors() { return massFactors_; } |
| 604 |
> |
|
| 605 |
> |
PairList getExcludedInteractions() { return excludedInteractions_; } |
| 606 |
> |
PairList getOneTwoInteractions() { return oneTwoInteractions_; } |
| 607 |
> |
PairList getOneThreeInteractions() { return oneThreeInteractions_; } |
| 608 |
> |
PairList getOneFourInteractions() { return oneFourInteractions_; } |
| 609 |
> |
|
| 610 |
> |
private: |
| 611 |
> |
|
| 612 |
> |
/// lists to handle atoms needing special treatment in the non-bonded interactions |
| 613 |
> |
PairList excludedInteractions_; /**< atoms excluded from interacting with each other */ |
| 614 |
> |
PairList oneTwoInteractions_; /**< atoms that are directly Bonded */ |
| 615 |
> |
PairList oneThreeInteractions_; /**< atoms sharing a Bend */ |
| 616 |
> |
PairList oneFourInteractions_; /**< atoms sharing a Torsion */ |
| 617 |
> |
|
| 618 |
> |
PropertyMap properties_; /**< Generic Properties can be added */ |
| 619 |
> |
SnapshotManager* sman_; /**< SnapshotManager (handles particle positions, etc.) */ |
| 620 |
> |
|
| 621 |
> |
/** |
| 622 |
> |
* The reason to have a local index manager is that when molecule |
| 623 |
> |
* is migrating to other processors, the atoms and the |
| 624 |
> |
* rigid-bodies will release their local indices to |
| 625 |
> |
* LocalIndexManager. Combining the information of molecule |
| 626 |
> |
* migrating to current processor, Migrator class can query the |
| 627 |
> |
* LocalIndexManager to make a efficient data moving plan. |
| 628 |
|
*/ |
| 629 |
|
LocalIndexManager localIndexMan_; |
| 630 |
|
|
| 631 |
|
// unparsed MetaData block for storing in Dump and EOR files: |
| 632 |
< |
std::string rawMetaData_; |
| 632 |
> |
string rawMetaData_; |
| 633 |
|
|
| 634 |
< |
//file names |
| 635 |
< |
std::string finalConfigFileName_; |
| 636 |
< |
std::string dumpFileName_; |
| 637 |
< |
std::string statFileName_; |
| 638 |
< |
std::string restFileName_; |
| 634 |
> |
// file names |
| 635 |
> |
string finalConfigFileName_; |
| 636 |
> |
string dumpFileName_; |
| 637 |
> |
string statFileName_; |
| 638 |
> |
string restFileName_; |
| 639 |
|
|
| 570 |
– |
RealType rcut_; /**< cutoff radius*/ |
| 571 |
– |
RealType rsw_; /**< radius of switching function*/ |
| 572 |
– |
RealType rlist_; /**< neighbor list radius */ |
| 640 |
|
|
| 641 |
< |
int ljsp_; /**< use shifted potential for LJ*/ |
| 642 |
< |
int ljsf_; /**< use shifted force for LJ*/ |
| 643 |
< |
|
| 577 |
< |
bool fortranInitialized_; /**< flag indicate whether fortran side |
| 578 |
< |
is initialized */ |
| 641 |
> |
bool topologyDone_; /** flag to indicate whether the topology has |
| 642 |
> |
been scanned and all the relevant |
| 643 |
> |
bookkeeping has been done*/ |
| 644 |
|
|
| 645 |
|
bool calcBoxDipole_; /**< flag to indicate whether or not we calculate |
| 646 |
|
the simulation box dipole moment */ |
| 647 |
|
|
| 648 |
|
bool useAtomicVirial_; /**< flag to indicate whether or not we use |
| 649 |
|
Atomic Virials to calculate the pressure */ |
| 650 |
< |
|
| 651 |
< |
public: |
| 587 |
< |
/** |
| 588 |
< |
* return an integral objects by its global index. In MPI version, if the StuntDouble with specified |
| 589 |
< |
* global index does not belong to local processor, a NULL will be return. |
| 590 |
< |
*/ |
| 591 |
< |
StuntDouble* getIOIndexToIntegrableObject(int index); |
| 592 |
< |
void setIOIndexToIntegrableObject(const std::vector<StuntDouble*>& v); |
| 593 |
< |
private: |
| 594 |
< |
std::vector<StuntDouble*> IOIndexToIntegrableObject; |
| 595 |
< |
//public: |
| 596 |
< |
//void setStuntDoubleFromGlobalIndex(std::vector<StuntDouble*> v); |
| 650 |
> |
|
| 651 |
> |
public: |
| 652 |
|
/** |
| 653 |
< |
* return a StuntDouble by its global index. In MPI version, if the StuntDouble with specified |
| 654 |
< |
* global index does not belong to local processor, a NULL will be return. |
| 655 |
< |
*/ |
| 656 |
< |
//StuntDouble* getStuntDoubleFromGlobalIndex(int index); |
| 657 |
< |
//private: |
| 658 |
< |
//std::vector<StuntDouble*> sdByGlobalIndex_; |
| 653 |
> |
* return an integral objects by its global index. In MPI |
| 654 |
> |
* version, if the StuntDouble with specified global index does |
| 655 |
> |
* not belong to local processor, a NULL will be return. |
| 656 |
> |
*/ |
| 657 |
> |
StuntDouble* getIOIndexToIntegrableObject(int index); |
| 658 |
> |
void setIOIndexToIntegrableObject(const vector<StuntDouble*>& v); |
| 659 |
|
|
| 660 |
< |
//in Parallel version, we need MolToProc |
| 660 |
> |
private: |
| 661 |
> |
vector<StuntDouble*> IOIndexToIntegrableObject; |
| 662 |
> |
|
| 663 |
|
public: |
| 664 |
|
|
| 665 |
|
/** |
| 671 |
|
//assert(globalIndex < molToProcMap_.size()); |
| 672 |
|
return molToProcMap_[globalIndex]; |
| 673 |
|
} |
| 674 |
< |
|
| 674 |
> |
|
| 675 |
|
/** |
| 676 |
|
* Set MolToProcMap array |
| 677 |
|
* @see #SimCreator::divideMolecules |
| 678 |
|
*/ |
| 679 |
< |
void setMolToProcMap(const std::vector<int>& molToProcMap) { |
| 679 |
> |
void setMolToProcMap(const vector<int>& molToProcMap) { |
| 680 |
|
molToProcMap_ = molToProcMap; |
| 681 |
|
} |
| 682 |
|
|
| 683 |
|
private: |
| 627 |
– |
|
| 628 |
– |
void setupFortranParallel(); |
| 684 |
|
|
| 685 |
|
/** |
| 686 |
|
* The size of molToProcMap_ is equal to total number of molecules |
| 687 |
|
* in the system. It maps a molecule to the processor on which it |
| 688 |
|
* resides. it is filled by SimCreator once and only once. |
| 689 |
|
*/ |
| 690 |
< |
std::vector<int> molToProcMap_; |
| 690 |
> |
vector<int> molToProcMap_; |
| 691 |
|
|
| 637 |
– |
|
| 692 |
|
}; |
| 693 |
|
|
| 694 |
|
} //namespace OpenMD |