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 |
68 |
|
#define __OPENMD_C |
70 |
|
|
71 |
|
using namespace std; |
72 |
|
namespace OpenMD{ |
72 |
– |
|
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 |
|
|
470 |
|
|
471 |
|
private: |
472 |
|
|
473 |
< |
/** fill up the simtype struct*/ |
474 |
< |
void setupSimType(); |
494 |
< |
|
495 |
< |
/** |
496 |
< |
* Setup Fortran Simulation |
497 |
< |
* @see #setupFortranParallel |
498 |
< |
*/ |
499 |
< |
void setupFortranSim(); |
473 |
> |
/** fill up the simtype struct and other simulation-related variables */ |
474 |
> |
void setupSimVariables(); |
475 |
|
|
501 |
– |
/** Figure out the cutoff radius */ |
502 |
– |
void setupCutoffRadius(); |
503 |
– |
/** Figure out the cutoff method */ |
504 |
– |
void setupCutoffMethod(); |
505 |
– |
/** Figure out the switching radius */ |
506 |
– |
void setupSwitchingRadius(); |
507 |
– |
/** Figure out the neighbor list skin thickness */ |
508 |
– |
void setupSkinThickness(); |
509 |
– |
/** Figure out which polynomial type to use for the switching function */ |
510 |
– |
void setupSwitchingFunction(); |
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 |
+ |
|
536 |
+ |
private: |
537 |
|
/// Data structures holding primary simulation objects |
538 |
|
map<int, Molecule*> molecules_; /**< map holding pointers to LOCAL molecules */ |
539 |
|
simtype fInfo_; /**< A dual struct shared by C++ |
541 |
|
information about what types |
542 |
|
of calculation are |
543 |
|
required */ |
544 |
< |
|
544 |
> |
|
545 |
|
/// Stamps are templates for objects that are then used to create |
546 |
|
/// groups of objects. For example, a molecule stamp contains |
547 |
|
/// information on how to build that molecule (i.e. the topology, |
564 |
|
* by SimCreator once and only once, since it is never changed |
565 |
|
* during the simulation. It shoudl be nGlobalAtoms_ in size. |
566 |
|
*/ |
567 |
< |
vector<int> globalMolMembership_; |
567 |
> |
vector<int> globalMolMembership_; |
568 |
> |
|
569 |
> |
/** |
570 |
> |
* A vector that maps between the local index of an atom and the |
571 |
> |
* index of the AtomType. |
572 |
> |
*/ |
573 |
> |
vector<int> identArray_; |
574 |
> |
vector<int> getIdentArray() { return identArray_; } |
575 |
> |
|
576 |
|
|
577 |
|
/// lists to handle atoms needing special treatment in the non-bonded interactions |
578 |
|
PairList excludedInteractions_; /**< atoms excluded from interacting with each other */ |
602 |
|
string statFileName_; |
603 |
|
string restFileName_; |
604 |
|
|
626 |
– |
RealType cutoffRadius_; /**< cutoff radius for non-bonded interactions */ |
627 |
– |
RealType switchingRadius_; /**< inner radius of switching function */ |
628 |
– |
RealType listRadius_; /**< Verlet neighbor list radius */ |
629 |
– |
RealType skinThickness_; /**< Verlet neighbor list skin thickness */ |
630 |
– |
CutoffMethod cutoffMethod_; /**< Cutoff Method for most non-bonded interactions */ |
605 |
|
|
606 |
|
bool fortranInitialized_; /** flag to indicate whether the fortran side is initialized */ |
607 |
|
|
644 |
|
} |
645 |
|
|
646 |
|
private: |
673 |
– |
|
674 |
– |
void setupFortranParallel(); |
647 |
|
|
648 |
|
/** |
649 |
|
* The size of molToProcMap_ is equal to total number of molecules |