ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
Observable_stat Class Reference

Observable for the pressure and energy. More...

#include <Observable_stat.hpp>

Collaboration diagram for Observable_stat:

Public Member Functions

 Observable_stat (std::size_t chunk_size, std::size_t n_bonded, int max_type)
void reset (std::size_t n_bonded, int max_type)
 Reinitialize the underlying storage.
auto get_chunk_size () const
double accumulate (double acc=0.0, std::size_t column=0ul) const
 Accumulate values.
void rescale (double volume)
 Rescale values.
std::span< double > bonded_contribution (int bond_id) const
 Get contribution from a bonded interaction.
void add_non_bonded_contribution (int type1, int type2, int molid1, int molid2, std::span< const double > data)
void add_non_bonded_contribution (int type1, int type2, int molid1, int molid2, double data)
auto non_bonded_intra_contribution (int type1, int type2) const
 Get contribution from a non-bonded intramolecular interaction.
auto non_bonded_inter_contribution (int type1, int type2) const
 Get contribution from a non-bonded intermolecular interaction.
void mpi_reduce ()
 MPI reduction.

Public Attributes

std::span< double > kinetic_lin
 Contribution from linear kinetic energy.
std::span< double > kinetic_rot
 Contribution from angular kinetic energy.
std::span< double > bonded
 Contribution(s) from bonded interactions.
std::span< double > coulomb
 Contribution(s) from Coulomb interactions.
std::span< double > dipolar
 Contribution(s) from dipolar interactions.
std::span< double > virtual_sites
 Contribution from virtual sites (accumulated).
std::span< double > dpd
 Contribution from DPD.
std::span< double > external_fields
 Contribution from external fields (accumulated).
std::span< double > non_bonded_intra
 Contribution(s) from non-bonded intramolecular interactions.
std::span< double > non_bonded_inter
 Contribution(s) from non-bonded intermolecular interactions.

Detailed Description

Observable for the pressure and energy.

Definition at line 31 of file Observable_stat.hpp.

Constructor & Destructor Documentation

◆ Observable_stat()

Observable_stat::Observable_stat ( std::size_t chunk_size,
std::size_t n_bonded,
int max_type )
inline

Definition at line 51 of file Observable_stat.hpp.

References reset().

Member Function Documentation

◆ accumulate()

double Observable_stat::accumulate ( double acc = 0.0,
std::size_t column = 0ul ) const
inline

Accumulate values.

Parameters
accInitial value for the accumulator.
columnWhich column to sum up (only relevant for multi-dimensional observables).

Definition at line 70 of file Observable_stat.hpp.

Referenced by ScriptInterface::Analysis::get_summary(), and Observables::Energy::operator()().

◆ add_non_bonded_contribution() [1/2]

void Observable_stat::add_non_bonded_contribution ( int type1,
int type2,
int molid1,
int molid2,
double data )
inline

Definition at line 123 of file Observable_stat.hpp.

References add_non_bonded_contribution().

◆ add_non_bonded_contribution() [2/2]

void Observable_stat::add_non_bonded_contribution ( int type1,
int type2,
int molid1,
int molid2,
std::span< const double > data )
inline

◆ bonded_contribution()

std::span< double > Observable_stat::bonded_contribution ( int bond_id) const
inline

Get contribution from a bonded interaction.

Definition at line 109 of file Observable_stat.hpp.

References bonded.

Referenced by ScriptInterface::Analysis::get_summary(), reduce_cabana_energy(), and reduce_cabana_pressure().

◆ get_chunk_size()

auto Observable_stat::get_chunk_size ( ) const
inline

Definition at line 63 of file Observable_stat.hpp.

Referenced by ScriptInterface::Analysis::get_summary().

◆ mpi_reduce()

void Observable_stat::mpi_reduce ( )

MPI reduction.

Definition at line 95 of file Observable_stat.cpp.

References comm_cart.

◆ non_bonded_inter_contribution()

auto Observable_stat::non_bonded_inter_contribution ( int type1,
int type2 ) const
inline

Get contribution from a non-bonded intermolecular interaction.

Definition at line 134 of file Observable_stat.hpp.

References non_bonded_inter.

Referenced by ScriptInterface::Analysis::get_summary(), reduce_cabana_energy(), and reduce_cabana_pressure().

◆ non_bonded_intra_contribution()

auto Observable_stat::non_bonded_intra_contribution ( int type1,
int type2 ) const
inline

Get contribution from a non-bonded intramolecular interaction.

Definition at line 129 of file Observable_stat.hpp.

References non_bonded_intra.

Referenced by ScriptInterface::Analysis::get_summary(), reduce_cabana_energy(), and reduce_cabana_pressure().

◆ rescale()

void Observable_stat::rescale ( double volume)
inline

Rescale values.

Definition at line 82 of file Observable_stat.hpp.

◆ reset()

void Observable_stat::reset ( std::size_t n_bonded,
int max_type )

Reinitialize the underlying storage.

If the new data layout is unchanged, no reallocation takes place.

Definition at line 40 of file Observable_stat.cpp.

References bonded, coulomb, dipolar, dpd, external_fields, kinetic_lin, kinetic_rot, non_bonded_inter, non_bonded_intra, and virtual_sites.

Referenced by Observable_stat().

Member Data Documentation

◆ bonded

std::span<double> Observable_stat::bonded

Contribution(s) from bonded interactions.

Definition at line 92 of file Observable_stat.hpp.

Referenced by bonded_contribution(), and reset().

◆ coulomb

std::span<double> Observable_stat::coulomb

Contribution(s) from Coulomb interactions.

Definition at line 94 of file Observable_stat.hpp.

Referenced by ScriptInterface::Analysis::get_summary(), reduce_cabana_energy(), reduce_cabana_pressure(), and reset().

◆ dipolar

std::span<double> Observable_stat::dipolar

◆ dpd

std::span<double> Observable_stat::dpd

Contribution from DPD.

Definition at line 100 of file Observable_stat.hpp.

Referenced by ScriptInterface::Analysis::get_summary(), reduce_cabana_pressure(), and reset().

◆ external_fields

std::span<double> Observable_stat::external_fields

Contribution from external fields (accumulated).

Definition at line 102 of file Observable_stat.hpp.

Referenced by Constraints::ExternalPotential< Coupling, Field >::add_energy(), ScriptInterface::Analysis::get_summary(), and reset().

◆ kinetic_lin

std::span<double> Observable_stat::kinetic_lin

Contribution from linear kinetic energy.

Definition at line 88 of file Observable_stat.hpp.

Referenced by ScriptInterface::Analysis::get_summary(), and reset().

◆ kinetic_rot

std::span<double> Observable_stat::kinetic_rot

Contribution from angular kinetic energy.

Definition at line 90 of file Observable_stat.hpp.

Referenced by ScriptInterface::Analysis::get_summary(), and reset().

◆ non_bonded_inter

std::span<double> Observable_stat::non_bonded_inter

Contribution(s) from non-bonded intermolecular interactions.

Definition at line 106 of file Observable_stat.hpp.

Referenced by add_non_bonded_contribution(), non_bonded_inter_contribution(), and reset().

◆ non_bonded_intra

std::span<double> Observable_stat::non_bonded_intra

Contribution(s) from non-bonded intramolecular interactions.

Definition at line 104 of file Observable_stat.hpp.

Referenced by add_non_bonded_contribution(), non_bonded_intra_contribution(), and reset().

◆ virtual_sites

std::span<double> Observable_stat::virtual_sites

Contribution from virtual sites (accumulated).

Definition at line 98 of file Observable_stat.hpp.

Referenced by ScriptInterface::Analysis::get_summary(), and reset().


The documentation for this class was generated from the following files: