8 #include "EnergyEnsemble.h" 10 #include <util/mpi/MpiStructBuilder.h> 51 read<Type>(in,
"type", type_);
53 read<double>(in,
"temperature", temperature_);
54 beta_ = 1.0/temperature_;
63 loadParameter<Type>(ar,
"type", type_);
65 loadParameter<double>(ar,
"temperature", temperature_);
89 if (buffer ==
"ADIABATIC" || buffer ==
"adiabatic") {
90 type = EnergyEnsemble::ADIABATIC;
92 if (buffer ==
"ISOTHERMAL" || buffer ==
"isothermal") {
93 type = EnergyEnsemble::ISOTHERMAL;
95 UTIL_THROW(
"Invalid EnergyEnsemble::Type value input");
105 if (type == EnergyEnsemble::ADIABATIC) {
108 if (type == EnergyEnsemble::ISOTHERMAL) {
125 builder.
addMember(&
object.temperature_, MPI::DOUBLE);
126 builder.
addMember(&
object.beta_, MPI::DOUBLE);
127 builder.
addMember(&
object.type_, MPI::INT);
void addMember(void *memberAddress, MPI::Datatype type, int count=1)
Add a new member variable to the type map.
Classes used by all simpatico molecular simulations.
std::istream & operator>>(std::istream &in, MonoclinicBoundary &boundary)
istream extractor for a MonoclinicBoundary.
void setBase(void *objectAddress)
Set address of an class instance.
virtual void loadParameters(Serializable::IArchive &ar)
Load internal state from an archive.
void commit(MPI::Datatype &newType)
Build and commit a user-defined MPI Struct datatype.
Saving / output archive for binary ostream.
A statistical ensemble for energy.
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
bool isIsothermal() const
Is this an Isothermal ensemble?
Utility classes for scientific computation.
~EnergyEnsemble()
Destructor.
std::ostream & operator<<(std::ostream &out, const MonoclinicBoundary &boundary)
ostream inserter for an MonoclinicBoundary.
void setTemperature(double temperature)
Set the temperature.
A MpiStructBuilder objects is used to create an MPI Struct datatype.
virtual void save(Serializable::OArchive &ar)
Save internal state to an archive.
Type
Enumeration of the allowed types of EnergyEnsemble.
EnergyEnsemble(Type type=UNKNOWN)
Constructor.
Saving archive for binary istream.
void setClassName(const char *className)
Set class name string.
virtual void readParameters(std::istream &in)
Read the type and (if necessary) temperature from file.
double temperature() const
Return the temperature.
static void commitMpiType()
Commit MPI data type for an EnergyEnsemble.