1 #ifndef DDMD_SIMULATION_H 2 #define DDMD_SIMULATION_H 11 #include <util/param/ParamComposite.h> 12 #include <ddMd/communicate/Domain.h> 13 #include <ddMd/communicate/Buffer.h> 14 #include <ddMd/communicate/Exchanger.h> 15 #include <ddMd/storage/AtomStorage.h> 16 #include <ddMd/storage/BondStorage.h> 17 #include <ddMd/storage/AngleStorage.h> 18 #include <ddMd/storage/DihedralStorage.h> 19 #include <ddMd/chemistry/AtomType.h> 20 #include <ddMd/chemistry/MaskPolicy.h> 21 #include <simp/boundary/Boundary.h> 22 #include <util/random/Random.h> 23 #include <util/space/Tensor.h> 24 #include <util/containers/DArray.h> 25 #include <util/containers/DMatrix.h> 26 #include <util/misc/Setable.h> 27 #include <util/signal/Signal.h> 28 #include <util/archives/Serializable.h> 34 template <
typename T>
class Factory;
39 class BoundaryEnsemble;
47 class SerializeConfigIo;
49 class ModifierManager;
51 class AnalyzerManager;
60 class DihedralPotential;
63 class ExternalPotential;
100 Simulation(MPI::Intracomm& communicator = MPI::COMM_WORLD);
156 void setOptions(
int argc,
char*
const * argv);
161 virtual void readParam();
169 virtual void readParam(std::istream& in);
177 virtual void readParameters(std::istream& in);
193 void setReverseUpdateFlag(
bool reverseUpdateFlag);
209 void load(
const std::string& filename);
233 void save(
const std::string& filename);
264 void readCommands(std::istream &in);
271 void setBoltzmannVelocities(
double temperature);
280 Vector removeDriftVelocity();
303 void readConfig(
const std::string& filename);
312 void writeConfig(
const std::string& filename);
327 void setConfigIo(std::string& classname);
343 void computeForces();
357 void computeForcesAndVirial();
365 void computeKineticEnergy();
374 double kineticEnergy();
379 void unsetKineticEnergy();
386 void computePotentialEnergies();
396 double potentialEnergy()
const;
401 void unsetPotentialEnergies();
408 void computePairEnergies();
424 void computeKineticStress();
433 Tensor kineticStress()
const;
442 double kineticPressure()
const;
447 void unsetKineticStress();
455 void computeVirialStress();
466 Tensor virialStress()
const;
477 double virialPressure()
const;
484 void unsetVirialStress();
503 std::string pairStyle()
const;
524 std::string bondStyle()
const;
546 std::string angleStyle()
const;
568 std::string dihedralStyle()
const;
590 std::string externalStyle()
const;
684 #ifdef DDMD_MODIFIERS 746 bool reverseUpdateFlag()
const;
779 void outputOptions(std::ostream& out)
const;
793 void readFileMaster(std::istream& in);
814 void readPotentialStyles(std::istream& in);
835 void readEnsembles(std::istream& in);
939 #ifdef DDMD_MODIFIERS 977 std::string pairStyle_;
980 std::string bondStyle_;
985 std::string angleStyle_;
990 std::string dihedralStyle_;
995 std::string externalStyle_;
1012 #ifdef SIMP_DIHEDRAL 1017 #ifdef SIMP_EXTERNAL 1023 bool hasAtomContext_;
1036 bool reverseUpdateFlag_;
1039 MPI::Intracomm communicator_;
1056 std::ofstream logFile_;
1059 bool isInitialized_;
1070 void setGroup(std::stringstream& inBuffer);
1081 {
return boundary_; }
1087 {
return atomStorage_; }
1091 {
return bondStorage_; }
1096 {
return angleStorage_; }
1099 #ifdef SIMP_DIHEDRAL 1101 {
return dihedralStorage_; }
1105 {
return exchanger_; }
1112 assert(pairPotentialPtr_);
1113 return *pairPotentialPtr_;
1118 assert(pairPotentialPtr_);
1119 return *pairPotentialPtr_;
1125 assert(bondPotentialPtr_);
1126 return *bondPotentialPtr_;
1131 assert(bondPotentialPtr_);
1132 return *bondPotentialPtr_;
1139 assert(anglePotentialPtr_);
1140 return *anglePotentialPtr_;
1145 assert(anglePotentialPtr_);
1146 return *anglePotentialPtr_;
1150 #ifdef SIMP_DIHEDRAL 1153 assert(dihedralPotentialPtr_);
1154 return *dihedralPotentialPtr_;
1159 assert(dihedralPotentialPtr_);
1160 return *dihedralPotentialPtr_;
1164 #ifdef SIMP_EXTERNAL 1167 assert(externalPotentialPtr_);
1168 return *externalPotentialPtr_;
1173 assert(externalPotentialPtr_);
1174 return *externalPotentialPtr_;
1181 assert(integratorPtr_);
1182 return *integratorPtr_;
1192 assert(energyEnsemblePtr_);
1193 return *energyEnsemblePtr_;
1199 assert(boundaryEnsemblePtr_);
1200 return *boundaryEnsemblePtr_;
1206 assert(fileMasterPtr_);
1207 return *fileMasterPtr_;
1210 #ifdef DDMD_MODIFIERS 1214 assert(modifierManagerPtr_);
1215 return *modifierManagerPtr_;
1222 assert(analyzerManagerPtr_);
1223 return *analyzerManagerPtr_;
1227 inline int Simulation::nAtomType()
1228 {
return nAtomType_; }
1231 inline int Simulation::nBondType()
1233 {
return nBondType_; }
1237 inline int Simulation::nAngleType()
1239 {
return nAngleType_; }
1242 #ifdef SIMP_DIHEDRAL 1243 inline int Simulation::nDihedralType()
1245 {
return nDihedralType_; }
1248 #ifdef SIMP_EXTERNAL 1249 inline bool Simulation::hasExternal()
1251 {
return hasExternal_; }
1256 {
return atomTypes_[i]; }
1260 {
return maskedPairPolicy_; }
1263 inline bool Simulation::reverseUpdateFlag()
const 1264 {
return reverseUpdateFlag_; }
1270 {
return modifySignal_; }
1274 {
return positionSignal_; }
1278 {
return velocitySignal_; }
1282 {
return exchangeSignal_; }
Provides access to members of Simulation object.
A Vector is a Cartesian vector.
Abstract base class for computation of angle force and energies.
An orthorhombic periodic unit cell.
Calculates external forces and energies for a parent Simulation.
Manager for a list of Analyzer objects.
Statistical ensemble for changes in the periodic unit cell size.
Abstract base class for computing bond forces and energies.
Parallel domain decomposition (DD) MD simulation.
Classes used by all simpatico molecular simulations.
Main object for a domain-decomposition MD simulation.
A Tensor represents a Cartesian tensor.
Saving / output archive for binary ostream.
A statistical ensemble for energy.
An Integrator numerically integrates the equations of motion.
Utility classes for scientific computation.
MaskPolicy
Enumeration of policies for suppressing ("masking") some pair interactions.
Abstract base class for computing dihedral forces and energies.
A container for all the atoms and ghost atoms on this processor.
Buffer for interprocessor communication.
Decomposition of the system into domains associated with processors.
A FileMaster manages input and output files for a simulation.
Manager for a set of Modifier objects.
Dynamically allocatable contiguous array template.
virtual void load(Serializable::IArchive &ar)
Load all parameters from an input archive.
Saving archive for binary istream.
Abstract reader/writer for configuration files.
Class for exchanging Atoms, Ghosts and Groups between processors.
virtual void readParam(std::istream &in)
Read the parameter file block.
Container for Group<3> (angle) objects.
Save / load configuration from / to an archive.
Notifier (or subject) in the Observer design pattern.
Container for Group<4> (dihedral) objects.
An object that can read multiple parameters from file.
Descriptor for a type of Atom.
Abstract base class for computing nonbonded pair forces and energies.
Container for for Group<2> (bond) objects.