8 #include "SpecialPotentialFacade.h" 9 #include <mcMd/simulation/System.h> 19 template <
class PotentialType,
class FactoryType>
30 template <
class PotentialType,
class FactoryType>
41 template <
class PotentialType,
class FactoryType>
45 read(in,
"style", style_);
48 FactoryType factory(*systemPtr_);
49 potentialPtr_ = factory.factory(style_);
55 potentialPtr_->readParameters(in);
61 template <
class PotentialType,
class FactoryType>
64 if (!energy_.
isSet()) {
65 potentialPtr_->computeEnergy();
67 energy_.
set(potentialPtr_->energy());
73 template <
class PotentialType,
class FactoryType>
75 { potentialPtr_->addForces(); }
void set(const T &value)
Set the value and mark as set.
bool isSet() const
Is this object set (is the value known)?
void addForces()
Add forces from this potential to all atomic forces.
A set of interacting Molecules enclosed by a Boundary.
void readParameters(std::istream &in)
Read parameters.
Specialized potential for an MD simulation.
SpecialPotentialFacade(System &system)
Constructor.
virtual ~SpecialPotentialFacade()
Destructor.
Utility classes for scientific computation.
void computeEnergy()
Compute total energy.
Single-processor Monte Carlo (MC) and molecular dynamics (MD).
void addParamComposite(ParamComposite &child, bool next=true)
Add a child ParamComposite object to the format array.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
void setClassName(const char *className)
Set class name string.
ScalarParam< Type > & read(std::istream &in, const char *label, Type &value)
Add and read a new required ScalarParam < Type > object.