faunus
Public Member Functions | List of all members
Faunus::Energy::DelayedEnergyAccumulator< PairEnergy > Class Template Reference

Stores a vector of particle pairs and postpones the energy evaluation until operator double() is called. More...

#include <energy.h>

Inheritance diagram for Faunus::Energy::DelayedEnergyAccumulator< PairEnergy >:
Inheritance graph
[legend]
Collaboration diagram for Faunus::Energy::DelayedEnergyAccumulator< PairEnergy >:
Collaboration graph
[legend]

Public Member Functions

 DelayedEnergyAccumulator (const PairEnergy &pair_energy, const double value=0.0)
 
void reserve (size_t number_of_particles) override
 Reserve memory for (N-1)*N/2 interaction pairs.
 
void clear () override
 
DelayedEnergyAccumulatoroperator= (const double new_value) override
 
DelayedEnergyAccumulatoroperator+= (const double new_value) override
 
DelayedEnergyAccumulatoroperator+= (ParticlePair &&pair) override
 
 operator double () override
 
- Public Member Functions inherited from Faunus::Energy::EnergyAccumulatorBase
 EnergyAccumulatorBase (double value)
 
virtual void from_json (const json &j)
 
virtual void to_json (json &j) const
 
template<typename TOtherAccumulator >
EnergyAccumulatorBaseoperator+= (TOtherAccumulator &acc)
 

Additional Inherited Members

- Public Types inherited from Faunus::Energy::EnergyAccumulatorBase
enum  Scheme { SERIAL, OPENMP, PARALLEL, INVALID }
 
- Public Attributes inherited from Faunus::Energy::EnergyAccumulatorBase
Scheme scheme = Scheme::SERIAL
 
- Protected Types inherited from Faunus::Energy::EnergyAccumulatorBase
using ParticleRef = const std::reference_wrapper< const Particle >
 Particle reference.
 
using ParticlePair = std::pair< ParticleRef, ParticleRef >
 References to two particles.
 
- Protected Attributes inherited from Faunus::Energy::EnergyAccumulatorBase
double value = 0.0
 accumulated energy
 

Detailed Description

template<RequirePairEnergy PairEnergy>
class Faunus::Energy::DelayedEnergyAccumulator< PairEnergy >

Stores a vector of particle pairs and postpones the energy evaluation until operator double() is called.

Looping over the vector can be done in serial (as a fallback); using OpenMP; or using C++17 parallel algorithms if available.


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