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