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.
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.
Add a potential. By default, the potential is considered unoptimized.
Set an unoptimized potential.
Add an unoptimized potential.
-
const PotentialFactory &
unoptimized
() const¶ Return the unoptimized potentials.
Add an optimized potential.
-
const PotentialFactory &
optimized
() const¶ Return the optimized potentials.
Add a reference potential.
- Parameters
index
: Store different references by index.
-
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
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.
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
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
check
() const¶ Run checks.
-
void
serialize
(std::ostream &sstr) const¶ Serialize.
-
System
(std::istream &sstr)¶ Deserialize.
Public Functions
-
System
()¶ Empty constructor.