System
-
class System
System is a facade design pattern in order to constrain and/or simplify the interface with multiple configurations and multiple lists of potentials. The typing and grouping of multiple configurations should be the same, but the domain and particle which physically exist may be different. There are three types of potentials.
The first is without optimizations.
The second is with optimizations, which may be periodically compared with the first.
The remaining potentials are used for reference. For example, cheap energy calculations in dual-cut configurational bias. Also Mayer-sampling.
Finally, the System also contains the ThermoParams.
ThermoParams
Store and retreive the thermodynamic parameters such as temperature, pressure, etc.
Set the thermodynamic parameters.
-
const ThermoParams &thermo_params() const
Return the thermodynamic parameters.
-
void set_beta(const double beta)
Set the inverse temperature, \(\beta\).
-
void change_volume(const double delta_volume, argtype args = argtype())
Change the volume.
args:
configuration: index of configuration (default: 0)
see Configuration for remaining arguments.
-
double delta_volume_previous() const
Return the previous delta_volume.
-
double total_volume() const
Return the total volume of all Configurations.
-
void revert(const Select &select, const int config = 0)
Revert changes due to energy computation of perturbations.
-
void finalize(const Select &select, const int config = 0)
Finalize changes due to energy computation of perturbations.
-
void load_cache(const bool load)
Set cache to load energy calculations.
-
std::string status_header() const
Return the header of the status for periodic output.
-
std::string status() const
Return the brief status for periodic output.
-
void serialize(std::ostream &sstr) const
Serialize.
-
System(std::istream &sstr)
Deserialize.
Configurations
Store and retrieve a list of configurations.
Add a configuration.
-
int num_configurations() const
Return the number of configurations.
-
const Configuration &configuration(const int config = 0) const
Return the configuration.
-
int dimension(const int config = 0) const
Return the dimensionality of the system.
Potentails
Store and retrieve a list of potentials.
Add a potential. By default, the potential is considered unoptimized.
Set an unoptimized potential.
Add an unoptimized potential.
-
const PotentialFactory &unoptimized(const int config = 0) const
Return the unoptimized potentials.
-
const Potential &potential(const int index, const int config = 0) const
Return an unoptimized potential.
Add an optimized potential.
-
const PotentialFactory &optimized(const int config = 0) const
Return the optimized potentials.
Add a reference potential.
- param index:
Store different references by index.
-
int num_references(const int config = 0) const
Return the number of reference potentials.
-
const Potential &reference(const int ref, const int potential, const int config = 0) const
Return a reference potential.
-
const std::vector<std::vector<PotentialFactory>> references() const
Return the list of reference potentials.
-
const PotentialFactory &potentials(const int config = 0) const
Return a constant reference to the full potentials.
-
void remove_opt_overlap()
Remove optimization when overlap is detected, which is default.
Neighbor Criteria
Define and store various criteria used for defining neighbors
Add a NeighborCriteria.
-
const NeighborCriteria &neighbor_criteria(const int index, const int config) const
Return a NeighborCriteria by index in order added.
-
const std::vector<std::shared_ptr<NeighborCriteria>> &neighbor_criteria(const int config) const
Return a NeighborCriteria by index in order added.
Energy
Compute energies using a combination of configurations and potentials.
-
void precompute()
Precompute quantities for optimizations before calculation of energies.
-
double unoptimized_energy(const int config)
Return the unoptimized energy. The following use optimized if available.
-
double energy(const int config = 0)
Return the energy of all.
-
double perturbed_energy(const Select &select, const int config = 0)
Return the energy of the selection. But do not finalize this energy (e.g., Ewald, neighbors, etc).
-
double stored_energy(const int config = 0) const
Return the last computed energy.
-
std::vector<double> stored_energy_profile(const int config = 0) const
Return the profile of energies that were last computed.
-
double reference_energy(const int ref = 0, const int config = 0)
Return the reference energy.
-
double reference_energy(const Select &select, const int ref = 0, const int config = 0)
Return the reference energy of the selection.
-
double initialize(const int config = 0)
Initialize and return total energy.
Public Functions
-
System()
Empty constructor.