RASPA3 3.0.12
A molecular simulation code for computing adsorption and diffusion in nanoporous materials
|
Accumulates energy components during simulation. More...
Public Member Functions | |
RunningEnergy () | |
Default constructor initializing all energy components to zero. | |
std::string | printMC () const |
Generates a formatted string of Monte Carlo energy components. | |
std::string | printMD () const |
Generates a formatted string of molecular dynamics energy components. | |
std::string | printMCDiff (RunningEnergy &other) const |
Generates a formatted string comparing energy components between two Monte Carlo states. | |
std::string | printMDDiff (RunningEnergy &other) const |
Generates a formatted string comparing energy components between two molecular dynamics states. | |
std::string | printMC (const std::string &label) const |
Generates a labeled formatted string of Monte Carlo energy components. | |
std::string | printMD (const std::string &label, double referenceEnergy) const |
Generates a labeled formatted string of molecular dynamics energy components, including conserved energy and drift. | |
nlohmann::json | jsonMC () const |
Generates a JSON object of Monte Carlo energy components. | |
nlohmann::json | jsonMD () const |
Generates a JSON object of molecular dynamics energy components. | |
double | potentialEnergy () const |
Computes the total potential energy. | |
double | CoulombEnergy () const |
Computes the total Coulombic energy. | |
double | kineticEnergy () const |
Computes the total kinetic energy. | |
double | ewaldFourier () const |
Computes the total Ewald Fourier energy. | |
double | conservedEnergy () const |
Computes the conserved energy in molecular dynamics simulations. | |
double | dudlambda (double lambda) const |
Computes the derivative of the potential energy with respect to lambda. | |
void | zero () |
Resets all energy components to zero. | |
RunningEnergy & | operator+= (const RunningEnergy &b) |
RunningEnergy & | operator-= (const RunningEnergy &b) |
RunningEnergy | operator- () const |
Friends | |
Archive< std::ofstream > & | operator<< (Archive< std::ofstream > &archive, const RunningEnergy &c) |
Archive< std::ifstream > & | operator>> (Archive< std::ifstream > &archive, RunningEnergy &c) |
Accumulates energy components during simulation.
The RunningEnergy struct stores various components of energy calculated during a simulation run, including potential and kinetic energies, as well as contributions from various interactions such as van der Waals and Coulomb forces. It provides methods to calculate total energies, perform arithmetic operations, and output energy information.
|
inline |
Default constructor initializing all energy components to zero.
Initializes all the energy components and related terms to zero, preparing the RunningEnergy object for accumulation during simulation.
|
inline |
Computes the conserved energy in molecular dynamics simulations.
Sums up the total potential energy, kinetic energy, and energy associated with the Nose-Hoover thermostat/barostat to compute the conserved energy in molecular dynamics simulations.
|
inline |
Computes the total Coulombic energy.
Sums up the Coulombic energy components, including framework-molecule Coulomb interactions, molecule-molecule Coulomb interactions, and Ewald sums.
|
inline |
Computes the derivative of the potential energy with respect to lambda.
Calculates the derivative of the potential energy with respect to the scaling parameter lambda, considering both van der Waals and Coulombic interactions.
lambda | The scaling parameter. |
|
inline |
Computes the total Ewald Fourier energy.
Sums up the Fourier components of the Ewald sum, including the Fourier term, self-interaction correction, and exclusion term.
nlohmann::json RunningEnergy::jsonMC | ( | ) | const |
Generates a JSON object of Monte Carlo energy components.
Returns a JSON object containing the total potential energy and individual energy components relevant for Monte Carlo simulations.
nlohmann::json RunningEnergy::jsonMD | ( | ) | const |
Generates a JSON object of molecular dynamics energy components.
Returns a JSON object containing the total potential and kinetic energies, as well as individual energy components relevant for molecular dynamics simulations.
|
inline |
Computes the total kinetic energy.
Sums up the translational and rotational kinetic energies.
|
inline |
Computes the total potential energy.
Sums up all the potential energy components, including interactions with external fields, framework-molecule interactions, molecule-molecule interactions, Ewald sums, intramolecular energies, tail corrections, and polarization.
std::string RunningEnergy::printMC | ( | ) | const |
Generates a formatted string of Monte Carlo energy components.
Returns a string containing the total potential energy and individual energy components relevant for Monte Carlo simulations, formatted for display.
std::string RunningEnergy::printMC | ( | const std::string & | label | ) | const |
Generates a labeled formatted string of Monte Carlo energy components.
Returns a string containing the total potential energy and individual energy components relevant for Monte Carlo simulations, with an additional label for identification.
label | A string label to include in the output. |
std::string RunningEnergy::printMCDiff | ( | RunningEnergy & | other | ) | const |
Generates a formatted string comparing energy components between two Monte Carlo states.
Computes the difference between the current RunningEnergy and another instance, and returns a string that shows the comparison of energy components, highlighting any drifts or discrepancies.
other | Another RunningEnergy instance to compare with. |
std::string RunningEnergy::printMD | ( | ) | const |
Generates a formatted string of molecular dynamics energy components.
Returns a string containing the total potential and kinetic energies, as well as individual energy components relevant for molecular dynamics simulations, formatted for display.
std::string RunningEnergy::printMD | ( | const std::string & | label, |
double | referenceEnergy | ||
) | const |
Generates a labeled formatted string of molecular dynamics energy components, including conserved energy and drift.
Returns a string containing the total potential and kinetic energies, conserved energy, drift from a reference energy, and individual energy components relevant for molecular dynamics simulations, with an additional label for identification.
label | A string label to include in the output. |
referenceEnergy | The reference energy to compute the drift. |
std::string RunningEnergy::printMDDiff | ( | RunningEnergy & | other | ) | const |
Generates a formatted string comparing energy components between two molecular dynamics states.
Computes the difference between the current RunningEnergy and another instance, and returns a string that shows the comparison of energy components, highlighting any drifts or discrepancies in molecular dynamics simulations.
other | Another RunningEnergy instance to compare with. |
|
inline |
Resets all energy components to zero.
Sets all the energy components and related terms to zero, effectively clearing the accumulated energies.