| 70 |
|
|
| 71 |
|
using namespace std; |
| 72 |
|
namespace OpenMD{ |
| 73 |
– |
enum CutoffMethod { |
| 74 |
– |
HARD, |
| 75 |
– |
SWITCHING_FUNCTION, |
| 76 |
– |
SHIFTED_POTENTIAL, |
| 77 |
– |
SHIFTED_FORCE |
| 78 |
– |
}; |
| 79 |
– |
|
| 73 |
|
//forward decalration |
| 74 |
|
class SnapshotManager; |
| 75 |
|
class Molecule; |
| 299 |
|
/** Overloaded version of gyrational volume that also returns |
| 300 |
|
det(I) so dV/dr can be calculated*/ |
| 301 |
|
void getGyrationalVolume(RealType &vol, RealType &detI); |
| 302 |
< |
/** main driver function to interact with fortran during the |
| 310 |
< |
initialization and molecule migration */ |
| 302 |
> |
|
| 303 |
|
void update(); |
| 304 |
+ |
/** |
| 305 |
+ |
* Setup Fortran Simulation |
| 306 |
+ |
*/ |
| 307 |
+ |
void setupFortran(); |
| 308 |
|
|
| 309 |
+ |
|
| 310 |
|
/** Returns the local index manager */ |
| 311 |
|
LocalIndexManager* getLocalIndexManager() { |
| 312 |
|
return &localIndexMan_; |
| 341 |
|
int getGlobalMolMembership(int id){ |
| 342 |
|
return globalMolMembership_[id]; |
| 343 |
|
} |
| 347 |
– |
|
| 348 |
– |
RealType getCutoffRadius() { |
| 349 |
– |
return cutoffRadius_; |
| 350 |
– |
} |
| 351 |
– |
|
| 352 |
– |
RealType getSwitchingRadius() { |
| 353 |
– |
return switchingRadius_; |
| 354 |
– |
} |
| 355 |
– |
|
| 356 |
– |
RealType getListRadius() { |
| 357 |
– |
return listRadius_; |
| 358 |
– |
} |
| 344 |
|
|
| 345 |
|
string getFinalConfigFileName() { |
| 346 |
|
return finalConfigFileName_; |
| 461 |
|
*/ |
| 462 |
|
void removeInteractionPairs(Molecule* mol); |
| 463 |
|
|
| 479 |
– |
|
| 480 |
– |
/** Returns the unique atom types of local processor in an array */ |
| 481 |
– |
set<AtomType*> getUniqueAtomTypes(); |
| 482 |
– |
|
| 464 |
|
/** Returns the set of atom types present in this simulation */ |
| 465 |
|
set<AtomType*> getSimulatedAtomTypes(); |
| 466 |
|
|
| 473 |
|
/** fill up the simtype struct and other simulation-related variables */ |
| 474 |
|
void setupSimVariables(); |
| 475 |
|
|
| 495 |
– |
/** |
| 496 |
– |
* Setup Fortran Simulation |
| 497 |
– |
* @see #setupFortranParallel |
| 498 |
– |
*/ |
| 499 |
– |
void setupFortranSim(); |
| 500 |
– |
|
| 501 |
– |
/** Figure out the cutoff radius and cutoff method */ |
| 502 |
– |
void setupCutoffs(); |
| 503 |
– |
/** Figure out the switching radius and polynomial type for the switching function */ |
| 504 |
– |
void setupSwitching(); |
| 505 |
– |
/** Figure out the simulation variables associated with electrostatics */ |
| 506 |
– |
void setupElectrostatics(); |
| 507 |
– |
/** Figure out the neighbor list skin thickness */ |
| 508 |
– |
void setupNeighborlists(); |
| 476 |
|
|
| 477 |
|
/** Determine if we need to accumulate the simulation box dipole */ |
| 478 |
|
void setupAccumulateBoxDipole(); |
| 528 |
|
bool requiresSkipCorrection_; /**< does this simulation require a skip-correction? */ |
| 529 |
|
bool requiresSelfCorrection_; /**< does this simulation require a self-correction? */ |
| 530 |
|
|
| 531 |
+ |
public: |
| 532 |
+ |
bool usesElectrostaticAtoms() { return usesElectrostaticAtoms_; } |
| 533 |
+ |
bool usesDirectionalAtoms() { return usesDirectionalAtoms_; } |
| 534 |
+ |
bool usesMetallicAtoms() { return usesMetallicAtoms_; } |
| 535 |
+ |
bool usesAtomicVirial() { return usesAtomicVirial_; } |
| 536 |
+ |
bool requiresPrepair() { return requiresPrepair_; } |
| 537 |
+ |
bool requiresSkipCorrection() { return requiresSkipCorrection_;} |
| 538 |
+ |
bool requiresSelfCorrection() { return requiresSelfCorrection_;} |
| 539 |
+ |
|
| 540 |
+ |
private: |
| 541 |
|
/// Data structures holding primary simulation objects |
| 542 |
|
map<int, Molecule*> molecules_; /**< map holding pointers to LOCAL molecules */ |
| 543 |
|
simtype fInfo_; /**< A dual struct shared by C++ |
| 545 |
|
information about what types |
| 546 |
|
of calculation are |
| 547 |
|
required */ |
| 548 |
< |
|
| 548 |
> |
|
| 549 |
|
/// Stamps are templates for objects that are then used to create |
| 550 |
|
/// groups of objects. For example, a molecule stamp contains |
| 551 |
|
/// information on how to build that molecule (i.e. the topology, |
| 561 |
|
* the simulation. It should be nGlobalAtoms_ in size. |
| 562 |
|
*/ |
| 563 |
|
vector<int> globalGroupMembership_; |
| 564 |
+ |
public: |
| 565 |
+ |
vector<int> getGlobalGroupMembership() { return globalGroupMembership_; } |
| 566 |
+ |
private: |
| 567 |
|
|
| 568 |
|
/** |
| 569 |
|
* A vector that maps between the global index of an atom and the |
| 571 |
|
* by SimCreator once and only once, since it is never changed |
| 572 |
|
* during the simulation. It shoudl be nGlobalAtoms_ in size. |
| 573 |
|
*/ |
| 574 |
< |
vector<int> globalMolMembership_; |
| 574 |
> |
vector<int> globalMolMembership_; |
| 575 |
> |
|
| 576 |
> |
/** |
| 577 |
> |
* A vector that maps between the local index of an atom and the |
| 578 |
> |
* index of the AtomType. |
| 579 |
> |
*/ |
| 580 |
> |
vector<int> identArray_; |
| 581 |
> |
public: |
| 582 |
> |
vector<int> getIdentArray() { return identArray_; } |
| 583 |
> |
private: |
| 584 |
|
|
| 585 |
|
/// lists to handle atoms needing special treatment in the non-bonded interactions |
| 586 |
|
PairList excludedInteractions_; /**< atoms excluded from interacting with each other */ |
| 610 |
|
string statFileName_; |
| 611 |
|
string restFileName_; |
| 612 |
|
|
| 624 |
– |
RealType cutoffRadius_; /**< cutoff radius for non-bonded interactions */ |
| 625 |
– |
RealType switchingRadius_; /**< inner radius of switching function */ |
| 626 |
– |
RealType listRadius_; /**< Verlet neighbor list radius */ |
| 627 |
– |
RealType skinThickness_; /**< Verlet neighbor list skin thickness */ |
| 628 |
– |
CutoffMethod cutoffMethod_; /**< Cutoff Method for most non-bonded interactions */ |
| 613 |
|
|
| 614 |
|
bool fortranInitialized_; /** flag to indicate whether the fortran side is initialized */ |
| 615 |
|
|
| 652 |
|
} |
| 653 |
|
|
| 654 |
|
private: |
| 671 |
– |
|
| 672 |
– |
void setupFortranParallel(); |
| 655 |
|
|
| 656 |
|
/** |
| 657 |
|
* The size of molToProcMap_ is equal to total number of molecules |