10 #include "MdSimulation.h" 11 #include <mcMd/configIos/MdConfigIo.h> 12 #include <mcMd/mcSimulation/McSystem.h> 13 #include <mcMd/neighbor/PairIterator.h> 14 #include <mcMd/neighbor/CellList.h> 15 #include <mcMd/mdIntegrators/MdIntegratorFactory.h> 16 #include <mcMd/generators/Generator.h> 17 #include <mcMd/generators/generatorFactory.h> 18 #include <mcMd/potentials/pair/MdPairPotential.h> 19 #include <mcMd/potentials/pair/PairFactory.h> 20 #include <mcMd/simulation/stress.h> 23 #include <mcMd/potentials/bond/BondPotential.h> 24 #include <mcMd/potentials/bond/BondFactory.h> 27 #include <mcMd/potentials/angle/AnglePotential.h> 28 #include <mcMd/potentials/angle/AngleFactory.h> 31 #include <mcMd/potentials/dihedral/DihedralPotential.h> 34 #include <mcMd/potentials/coulomb/MdCoulombPotential.h> 35 #include <mcMd/potentials/coulomb/CoulombFactory.h> 38 #include <mcMd/potentials/external/ExternalPotential.h> 41 #include <mcMd/potentials/special/SpecialPotential.h> 42 #include <mcMd/potentials/special/SpecialFactory.h> 45 #include <mcMd/links/LinkMaster.h> 48 #include <mcMd/potentials/tether/TetherPotential.h> 49 #include <mcMd/tethers/TetherMaster.h> 52 #include <simp/ensembles/BoundaryEnsemble.h> 53 #include <simp/ensembles/EnergyEnsemble.h> 55 #include <util/param/Factory.h> 56 #include <util/space/Vector.h> 57 #include <util/space/Dimension.h> 59 #include <util/space/Tensor.h> 60 #include <util/accumulators/setToZero.h> 82 anglePotentialPtr_(0),
85 dihedralPotentialPtr_(0),
88 coulombPotentialPtr_(0),
91 externalPotentialPtr_(0),
94 specialPotentialPtr_(0),
100 tetherPotentialPtr_(0),
103 mdIntegratorFactoryPtr_(0),
104 createdMdIntegratorFactory_(false)
119 pairPotentialPtr_(0),
122 bondPotentialPtr_(0),
125 anglePotentialPtr_(0),
128 dihedralPotentialPtr_(0),
131 coulombPotentialPtr_(0),
134 externalPotentialPtr_(0),
137 specialPotentialPtr_(0),
140 linkPotentialPtr_(0),
143 tetherPotentialPtr_(0),
146 mdIntegratorFactoryPtr_(0),
147 createdMdIntegratorFactory_(false)
159 assert(pairPotentialPtr_ == 0);
161 if (pairPotentialPtr_ == 0) {
162 UTIL_THROW(
"Failed attempt to clone McPairPotential");
170 assert(bondPotentialPtr_ == 0);
176 assert(anglePotentialPtr_ == 0);
182 assert(dihedralPotentialPtr_ == 0);
189 assert(coulombPotentialPtr_ == 0);
211 if (system.hasTetherPotential()) {
212 tetherPotentialPtr_ = &system.tetherPotential();
227 if (pairPotentialPtr_)
delete pairPotentialPtr_;
230 if (!
isCopy() && bondPotentialPtr_)
delete bondPotentialPtr_;
233 if (!
isCopy() && anglePotentialPtr_)
delete anglePotentialPtr_;
236 if (!
isCopy() && dihedralPotentialPtr_)
delete dihedralPotentialPtr_;
239 if (!
isCopy() && coulombPotentialPtr_)
delete coulombPotentialPtr_;
242 if (!
isCopy() && externalPotentialPtr_)
delete externalPotentialPtr_;
245 if (!
isCopy() && specialPotentialPtr_)
delete specialPotentialPtr_;
248 if (!
isCopy() && linkPotentialPtr_)
delete linkPotentialPtr_;
251 if (!
isCopy() && tetherPotentialPtr_)
delete tetherPotentialPtr_;
254 if (mdIntegratorFactoryPtr_ && createdMdIntegratorFactory_) {
255 delete mdIntegratorFactoryPtr_;
257 if (mdIntegratorPtr_) {
258 delete mdIntegratorPtr_;
267 if (mdIntegratorFactoryPtr_ == 0) {
269 createdMdIntegratorFactory_ =
true;
271 return *mdIntegratorFactoryPtr_;
288 assert(coulombPotentialPtr_ == 0);
290 coulombPotentialPtr_ =
292 if (coulombPotentialPtr_ == 0) {
293 UTIL_THROW(
"Failed attempt to create CoulombPotential");
302 assert(pairPotentialPtr_ == 0);
304 if (pairPotentialPtr_ == 0) {
305 UTIL_THROW(
"Failed attempt to create PairPotential");
314 assert(bondPotentialPtr_ == 0);
317 if (bondPotentialPtr_ == 0) {
318 UTIL_THROW(
"Failed attempt to create bondPotential");
325 assert(anglePotentialPtr_ == 0);
329 if (anglePotentialPtr_ == 0) {
330 UTIL_THROW(
"Failed attempt to create anglePotential");
337 assert(dihedralPotentialPtr_ == 0);
339 dihedralPotentialPtr_ =
341 if (dihedralPotentialPtr_ == 0) {
342 UTIL_THROW(
"Failed attempt to create dihedralPotential");
349 assert(externalPotentialPtr_ == 0);
351 externalPotentialPtr_ =
353 if (externalPotentialPtr_ == 0) {
354 UTIL_THROW(
"Failed attempt to create externalPotential");
361 assert(specialPotentialPtr_ == 0);
363 specialPotentialPtr_ =
364 specialFactory().mdFactory(specialStyle(), *
this);
365 if (specialPotentialPtr_ == 0) {
366 UTIL_THROW(
"Failed attempt to create specialPotential");
373 assert(linkPotentialPtr_ == 0);
377 if (linkPotentialPtr_ == 0) {
378 UTIL_THROW(
"Failed attempt to create linkPotential");
386 readTetherMaster(in);
387 tetherPotentialPtr_ =
388 tetherFactory().factory(tetherStyle(), *
this);
389 if (tetherPotentialPtr_ == 0) {
390 UTIL_THROW(
"Failed attempt to create tetherPotential");
401 if (mdIntegratorFactoryPtr_ == 0) {
403 createdMdIntegratorFactory_ =
true;
405 assert(mdIntegratorFactoryPtr_);
406 assert(mdIntegratorPtr_ == 0);
412 mdIntegratorFactoryPtr_->
readObject(in, *
this, className, isEnd);
413 if (!mdIntegratorPtr_) {
414 std::string msg(
"Unknown MdIntegrator subclass name: ");
440 assert(coulombPotentialPtr_ == 0);
442 coulombPotentialPtr_ =
444 if (coulombPotentialPtr_ == 0) {
445 UTIL_THROW(
"Failed attempt to create CoulombPotential");
454 assert(pairPotentialPtr_ == 0);
456 if (pairPotentialPtr_ == 0) {
457 UTIL_THROW(
"Failed attempt to create PairPotential");
466 assert(bondPotentialPtr_ == 0);
469 if (bondPotentialPtr_ == 0) {
470 UTIL_THROW(
"Failed attempt to create bondPotential");
477 assert(anglePotentialPtr_ == 0);
481 if (anglePotentialPtr_ == 0) {
482 UTIL_THROW(
"Failed attempt to create anglePotential");
489 assert(dihedralPotentialPtr_ == 0);
491 dihedralPotentialPtr_ =
493 if (dihedralPotentialPtr_ == 0) {
494 UTIL_THROW(
"Failed attempt to create dihedralPotential");
501 assert(externalPotentialPtr_ == 0);
503 externalPotentialPtr_ =
505 if (externalPotentialPtr_ == 0) {
506 UTIL_THROW(
"Failed attempt to create externalPotential");
513 assert(specialPotentialPtr_ == 0);
515 specialPotentialPtr_ =
516 specialFactory().mdFactory(specialStyle(), *
this);
517 if (specialPotentialPtr_ == 0) {
518 UTIL_THROW(
"Failed attempt to create specialPotential");
525 assert(linkPotentialPtr_ == 0);
529 if (linkPotentialPtr_ == 0) {
530 UTIL_THROW(
"Failed attempt to create linkPotential");
537 assert(tetherPotentialPtr_ == 0);
539 loadTetherMaster(ar);
540 tetherPotentialPtr_ =
541 tetherFactory().factory(tetherStyle(), *
this);
542 if (tetherPotentialPtr_ == 0) {
543 UTIL_THROW(
"Failed attempt to create tetherPotential");
554 if (mdIntegratorFactoryPtr_ == 0) {
556 createdMdIntegratorFactory_ =
true;
558 assert(mdIntegratorFactoryPtr_);
559 assert(mdIntegratorPtr_ == 0);
564 mdIntegratorFactoryPtr_->
loadObject(ar, *
this, className);
565 if (!mdIntegratorPtr_) {
566 std::string msg(
"Unknown MdIntegrator subclass name: ");
592 coulombPotentialPtr_->
save(ar);
630 specialPotential().save(ar);
635 saveTetherMaster(ar);
636 tetherPotentialPtr_->save(ar);
643 mdIntegratorPtr_->
save(ar);
666 Log::file() <<
"Initial coulombPotential nWave = " 708 bool success =
false;
709 for (
int iSpecies = 0; iSpecies < nSpecies; ++iSpecies) {
710 if (capacities[iSpecies] > 0) {
713 success = ptr->
generate(capacities[iSpecies],
714 diameters, cellList);
717 Log::file() <<
"Failed to complete species " 748 for (
begin(iSpec, molIter); molIter.
notEnd(); ++molIter) {
749 molIter->begin(atomIter);
750 for ( ; atomIter.
notEnd(); ++atomIter) {
769 for (
begin(iSpec, molIter); molIter.
notEnd(); ++molIter) {
770 for (molIter->begin(atomIter); atomIter.
notEnd(); ++atomIter) {
771 atomIter->force().zero();
785 for (
begin(iSpec, molIter); molIter.
notEnd(); ++molIter) {
786 for (molIter->begin(atomIter); atomIter.
notEnd(); ++atomIter) {
787 atomIter->velocity().zero();
808 for (iSpec = 0; iSpec < nSpec; ++iSpec) {
809 for (
begin(iSpec, molIter); molIter.
notEnd(); ++molIter) {
810 for (molIter->begin(atomIter); atomIter.
notEnd(); ++atomIter) {
811 mass = sim.
atomType(atomIter->typeId()).mass();
812 scale = sqrt(temperature/mass);
814 atomIter->velocity()[j] = scale*random.
gaussian();
834 for (iSpec = 0; iSpec < nSpec; ++iSpec) {
835 for (
begin(iSpec, molIter); molIter.
notEnd(); ++molIter) {
836 for (molIter->begin(atomIter); atomIter.
notEnd(); ++atomIter) {
837 average += atomIter->velocity();
842 average /= double(nAtom);
843 for (iSpec = 0; iSpec < nSpec; ++iSpec) {
844 for (
begin(iSpec, molIter); molIter.
notEnd(); ++molIter) {
845 for (molIter->begin(atomIter); atomIter.
notEnd(); ++atomIter) {
846 atomIter->velocity() -= average;
891 if (hasSpecialPotential()) {
892 specialPotential().addForces();
901 if (tetherPotentialPtr_) {
902 tetherPotential().addForces();
943 if (hasSpecialPotential()) {
944 energy += specialPotential().energy();
953 if (tetherPotentialPtr_) {
954 energy += tetherPotential().energy();
994 if (hasSpecialPotential()) {
995 specialPotential().unsetEnergy();
1012 for (iSpec=0; iSpec < sim.
nSpecies(); ++iSpec) {
1013 for (
begin(iSpec, molIter); molIter.
notEnd(); ++molIter) {
1014 for (molIter->begin(atomIter); atomIter.
notEnd(); ++atomIter) {
1015 typeId = atomIter->typeId();
1017 KE += atomIter->velocity().square()*mass;
1030 template <
typename T>
1031 void MdSystem::computeKineticStressImpl(T& stress)
const 1041 for (
int iSpec=0; iSpec < sim.
nSpecies(); ++iSpec) {
1042 for (
begin(iSpec, molIter); molIter.
notEnd(); ++molIter) {
1043 for (molIter->begin(atomIter); atomIter.
notEnd(); ++atomIter) {
1044 vPtr = &atomIter->velocity();
1045 mass = sim.
atomType(atomIter->typeId()).mass();
1047 incrementPairStress(*vPtr, p, stress);
1052 normalizeStress(stress);
1056 void MdSystem::computeKineticStress<double>(
double& stress)
const 1057 { computeKineticStressImpl(stress); }
1060 void MdSystem::computeKineticStress<Util::Vector>(
Util::Vector& stress)
const 1061 { computeKineticStressImpl(stress); }
1064 void MdSystem::computeKineticStress<Util::Tensor>(
Util::Tensor& stress)
const 1065 { computeKineticStressImpl(stress); }
1069 template <
typename T>
1070 void MdSystem::computeVirialStressImpl(T& stress)
const 1091 #ifdef SIMP_DIHEDRAL 1104 if (hasSpecialPotential()) {
1105 if (specialPotential().createsStress()) {
1106 specialPotential().computeStress(dStress);
1121 void MdSystem::computeVirialStress<double>(
double& stress)
const 1122 { computeVirialStressImpl(stress); }
1125 void MdSystem::computeVirialStress<Util::Vector>(
Util::Vector& stress)
1127 { computeVirialStressImpl(stress); }
1130 void MdSystem::computeVirialStress<Util::Tensor>(
Util::Tensor& stress)
1132 { computeVirialStressImpl(stress); }
1137 void MdSystem::computeStress<double>(
double& stress)
const 1141 double kineticStress;
1143 stress += kineticStress;
1147 void MdSystem::computeStress<Util::Vector>(
Util::Vector& stress)
const 1153 stress += kineticStress;
1158 void MdSystem::computeStress<Util::Tensor>(
Util::Tensor& stress)
const 1164 stress += kineticStress;
1185 #ifdef SIMP_DIHEDRAL 1196 if (hasSpecialPotential()) {
1197 if (specialPotential().createsStress()) {
1198 specialPotential().unsetStress();
virtual void loadParameters(Serializable::IArchive &ar)
Load parameters from an archive, without configuration.
void saveFileMaster(Serializable::OArchive &ar)
If necessary, save FileMaster to archive.
static void setupCellList(int atomCapacity, Boundary &boundary, const Array< double > &diameters, CellList &cellList)
Allocate any required memory for the cell list.
void computeKineticStress(T &stress) const
Compute kinetic stress mvv, arising from velocities.
const int Dimension
Dimensionality of space.
A System for use in a Markov chain Monte Carlo simulation.
A Vector is a Cartesian vector.
CoulombFactory & coulombFactory()
Get the associated Coulomb Factory by reference.
DihedralPotential & dihedralPotential() const
Return DihedralPotential by reference.
bool isCopy() const
Was this System instantiated with the copy constructor?
virtual double energy(double rsq, int iAtomType, int jAtomType) const =0
Return pair energy for a single pair.
MdCoulombPotential * factory(const std::string &subclass) const
Return a pointer to a new CoulombPotential, if possible.
void calculateForces()
Compute all forces in this System.
bool hasLinkPotential() const
Does a link potential exist?.
void begin(int speciesId, MoleculeIterator &iterator)
Initialize an iterator for molecules of one species in this System.
Factory< MdIntegrator > & mdIntegratorFactory()
Return the MdIntegrator Factory by reference.
void generateMolecules(Array< int > const &capacities, Array< double > const &diameters)
Generate molecules for all species.
void loadFileMaster(Serializable::IArchive &ar)
Load FileMaster data from archive, if necessary.
int nAtom() const
Return the total number of atoms in this System.
bool isValid() const
Return true if valid, or throw Exception.
bool notEnd() const
Is the current pointer not at the end of the array?
BondPotential & bondPotential() const
Return the BondPotential by reference.
bool hasDihedralPotential() const
Does a dihedral potential exist?.
Signal & positionSignal()
Signal to indicate change in atomic positions.
double volume() const
Return unit cell volume.
void loadPerturbation(Serializable::IArchive &ar)
Load the perturbation parameter block (if any)
Vector & multiply(const Vector &v, double s)
Multiply a vector v by a scalar s.
Vector removeDriftVelocity()
Subtract average velocity from all atomic velocities.
void shiftAtoms()
Shift all atoms into primary cell.
bool hasLinkPotential() const
Does a link potential exist?.
Data * readObject(std::istream &in, ParamComposite &parent, std::string &className, bool &isEnd)
Read a class name, instantiate an object, and read its parameters.
void loadParamComposite(Serializable::IArchive &ar, ParamComposite &child, bool next=true)
Add and load a required child ParamComposite.
void saveLinkMaster(Serializable::OArchive &ar)
Save the LinkMaster.
bool hasAnglePotential() const
Does angle potential exist?.
Factory< AnglePotential > & angleFactory()
Get the associated AngleFactory by reference.
A set of interacting Molecules enclosed by a Boundary.
void addObserver(Observer &observer, void(Observer::*methodPtr)(const T &))
Register an observer.
Forward iterator for a PArray.
virtual void computeStress()=0
Compute kspace part of Coulomb stress.
MdSystem()
Default constructor.
File containing preprocessor macros for error handling.
void readEnsembles(std::istream &in)
Read energy and boundary ensemble parameters.
void unsetVirialStress()
Unset precomputed virial stress components.
double potentialEnergy()
Compute and return total potential energy.
Classes used by all simpatico molecular simulations.
Generator * generatorFactory(Species &species, McSystem &system)
Instantiates generator for on species in an McSystem.
bool hasBondPotential() const
Does a bond potential exist?.
A Tensor represents a Cartesian tensor.
ExternalPotential & externalPotential() const
Return ExternalPotential by reference.
virtual void unsetEnergy()
Unset k-space energy.
virtual void addForces()=0
Add dihedral potential forces to all atomic forces.
std::string linkStyle() const
Return link potential style string.
virtual void addForces()=0
Add external force of an Atom to the total force acting on it.
The main object in a simulation, which coordinates others.
void allocateMoleculeSets()
Allocate and initialize molecule sets for all species.
std::string dihedralStyle() const
Return dihedral potential style string.
bool hasExternalPotential() const
Does an external potential exist?.
void savePotentialStyles(Serializable::OArchive &ar)
Save potential style strings.
Forward const iterator for an Array or a C array.
Data * loadObject(Serializable::IArchive &ar, ParamComposite &parent, std::string &className)
Load a class name, instantiate an object, and load the object.
Saving / output archive for binary ostream.
virtual double energy(const Vector &R1, const Vector &R2, const Vector &R3, int type) const =0
Returns potential energy for one dihedral.
MdPairPotential & pairPotential() const
Return MdPairPotential by reference.
PairFactory & pairFactory()
Get the PairFactory by reference.
Default Factory for subclasses of MdIntegrator.
virtual void loadConfig(Serializable::IArchive &ar)
Load configuration.
const AtomType & atomType(int i) const
Get a single AtomType object by const reference.
virtual double energy(const Vector &position, int i) const =0
Returns external potential energy of a single particle.
std::string bondStyle() const
Return covalent bond style string.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
std::string className() const
Get class name string.
Factory< BondPotential > & linkFactory()
Get the associated Link factory by reference.
const PairList & pairList() const
Return a const reference to the internal PairList.
Simulation & simulation() const
Get the parent Simulation by reference.
virtual void addForces()=0
Add angle forces to all atomic forces.
bool hasBondPotential() const
Does a bond potential exist?.
virtual void unsetEnergy()
Mark the energy as unknown.
ExternalPotential & externalPotential() const
Return ExternalPotential by reference.
void computeVirialStress(T &stress) const
Compute total virial stress, from all forces.
virtual void save(Serializable::OArchive &ar)
Saves all parameters to an archive.
std::string coulombStyle() const
Return coulomb potential style string.
BondPotential & linkPotential() const
Return link potential by reference.
void setToZero(int &value)
Set an int variable to zero.
Factory< BondPotential > & bondFactory()
Get the associated Factory<BondPotential> by reference.
bool notEnd() const
Is the current pointer not at the end of the PArray?
Utility classes for scientific computation.
void setBoltzmannVelocities(double temperature)
Set all velocities to Boltzmann distributed random values.
bool hasAnglePotential() const
Does angle potential exist?.
AnglePotential & anglePotential() const
Return AnglePotential by reference.
void readLinkMaster(std::istream &in)
Read the LinkMaster parameters.
Generates initial configurations for molecules of one species.
CoulombPotential & coulombPotential() const
Return CoulombPotential by reference.
double gaussian(void)
Return a Gaussian random number with zero average and unit variance.
virtual void makeWaves()=0
Generate wavevectors and influence function for this boundary.
void shift(Vector &r) const
Shift Cartesian Vector r to its primary image.
virtual void addForces()=0
Add bond forces to all atomic forces.
bool hasCoulombPotential() const
Does a Coulomb potential exist?.
Forward iterator for an Array or a C array.
double kineticEnergy() const
Compute and return total kinetic energy.
Forward iterator for a PArray.
void savePerturbation(Serializable::OArchive &ar)
Save the perturbation parameter block (if any)
std::string externalStyle() const
Return external potential style string.
McPairPotential & pairPotential() const
Return the McPairPotential by reference.
void unsetPotentialEnergy()
Unset all precomputed potential energy components.
virtual double energy(double cosTheta, int type) const =0
Returns potential energy for one angle.
virtual MdPairPotential * mdFactory(const std::string &subclass, System &system) const
Return a pointer to a new McPairPotential, if possible.
A cell list for Atom objects in a periodic system boundary.
virtual double energy(double rSq, int type) const =0
Returns potential energy for one bond.
virtual void readConfig(std::istream &in)
Read system configuration from file.
static std::ostream & file()
Get log ostream by reference.
bool notEnd() const
Is the current pointer not at the end of the array?
bool hasDihedralPotential() const
Does a dihedral potential exist?.
std::string pairStyle() const
Return nonbonded pair style string.
void loadLinkMaster(Serializable::IArchive &ar)
Load the LinkMaster.
void saveEnsembles(Serializable::OArchive &ar)
Save energy and boundary ensembles.
virtual void addForces()=0
Add k-space Coulomb forces to forces on all atoms.
Boundary & boundary() const
Get the Boundary by reference.
virtual ConfigIo * newDefaultConfigIo()
Return a pointer to a new MdConfigIo object.
virtual int nWave() const =0
Current number of wavevectors.
BondPotential & linkPotential() const
Return the McLinkPotential by reference.
Saving archive for binary istream.
virtual bool isValid() const
Return true if valid, or throw Exception.
bool hasCoulombPotential() const
Does a Coulomb potential exist?.
double mass() const
Get the mass.
virtual void loadConfig(Serializable::IArchive &ar)
Load the MdSystem configuration from an archive.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
int nSpecies() const
Get the number of Species in this Simulation.
void buildPairList()
Build the internal PairList.
bool hasExternalPotential() const
Does an external potential exist?.
void clearPairListStatistics()
Clear all statistical accumulators stored in PairList.
virtual bool isValid() const
Return true if valid, or throw Exception.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
void setClassName(const char *className)
Set class name string.
void readParamComposite(std::istream &in, ParamComposite &child, bool next=true)
Add and read a required child ParamComposite.
Factory< ExternalPotential > & externalFactory()
Get the associated ExternalPotential factory by reference.
virtual ~MdSystem()
Destructor.
void readPerturbation(std::istream &in)
Read the perturbation parameter block (if any)
AnglePotential & anglePotential() const
Return AnglePotential by reference.
virtual Data * factory(const std::string &className) const =0
Returns a pointer to a new instance of specified subclass.
virtual bool generate(int nMolecule, Array< double > const &diameters, CellList &cellList)
Generate nMolecule molecules of the associated Species.
virtual void unsetStress()
Unset k-space stress.
void readFileMaster(std::istream &in)
Read FileMaster parameters, if none yet exists.
void readPotentialStyles(std::istream &in)
Read potential style parameter strings.
virtual void readConfig(std::istream &in)
Read system configuration from file.
ConfigIo for MD simulations (includes velocities).
bool notEnd() const
Is this not the end of the array?
Factory< DihedralPotential > & dihedralFactory()
Get the associated Dihedral Factory by reference.
double energy()
Get total Coulomb energy.
void loadEnsembles(Serializable::IArchive &ar)
Load energy and boundary ensembles from archive.
virtual void readParameters(std::istream &in)
Read parameters from input file.
void setZeroForces()
Set all atomic forces to zero.
virtual void unsetStress()
Mark the stress as unknown.
void loadPotentialStyles(Serializable::IArchive &ar)
Load potential style strings from an archive.
virtual void computeStress()
Compute and store the stress tensor.
std::string angleStyle() const
Return angle potential style string.
void setZeroVelocities()
Set all atomic velocities to zero.
virtual void saveParameters(Serializable::OArchive &ar)
Save parameters to an archive, without configuration.
virtual void addForces()=0
Calculate non-bonded pair forces for all atoms in this System.
System configuration file reader and writer.
BondPotential & bondPotential() const
Return BondPotential by reference.
MdCoulombPotential & coulombPotential() const
Return CoulombPotential by reference.
Random & random()
Get the random number generator by reference.
DihedralPotential & dihedralPotential() const
Return the DihedralPotential by reference.