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.

  1. The first is without optimizations.

  2. The second is with optimizations, which may be periodically compared with the first.

  3. 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.

Configurations

Store and retrieve a list of configurations.

void add(const Configuration &configuration)

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.

void add(std::shared_ptr<Potential> potential)

Add a potential. By default, the potential is considered unoptimized.

void set_unoptimized(const int index, std::shared_ptr<Potential> potential)

Set an unoptimized potential.

void add_to_unoptimized(std::shared_ptr<Potential> potential)

Add an unoptimized potential.

const PotentialFactory &unoptimized() const

Return the unoptimized potentials.

const Potential &potential(const int index) const

Return an unoptimized potential.

void add_to_optimized(std::shared_ptr<Potential> potential)

Add an optimized potential.

const PotentialFactory &optimized() const

Return the optimized potentials.

void add_to_reference(std::shared_ptr<Potential> ref, const int index = 0)

Add a reference potential.

Parameters
  • index: Store different references by index.

const Potential &reference(const int ref, const int potential) const

Return a reference potential.

const std::vector<PotentialFactory> references() const

Return the list of reference potentials.

const PotentialFactory &potentials() const

Return a constant reference to the full potentials.

Neighbor Criteria

Define and store various criteria used for defining neighbors

void add(std::shared_ptr<NeighborCriteria> neighbor_criteria)

Add a NeighborCriteria.

const NeighborCriteria &neighbor_criteria(const int index) const

Return a NeighborCriteria by index in order added.

const std::vector<NeighborCriteria> &neighbor_criteria() 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 = 0)

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

Return the last computed energy.

std::vector<double> stored_energy_profile() 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.

ThermoParams

Store and retreive the thermodynamic parameters such as temperature, pressure, etc.

void set(std::shared_ptr<ThermoParams> thermo_params)

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 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.

void unload_cache(const System &system)

Set cache to unload energy calclatuions.

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 check() const

Run checks.

void serialize(std::ostream &sstr) const

Serialize.

System(std::istream &sstr)

Deserialize.

Public Functions

System()

Empty constructor.