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

A basic accumulator which immediately computes and adds energy of a pair of particles upon addition using the PairEnergy templated class. More...

#include <energy.h>

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

Public Member Functions

 InstantEnergyAccumulator (const PairEnergy &pair_energy, const double value=0.0)
 
InstantEnergyAccumulatoroperator= (const double new_value) override
 
InstantEnergyAccumulatoroperator+= (const double new_value) override
 
InstantEnergyAccumulatoroperator+= (ParticlePair &&pair) override
 
void from_json (const json &j) override
 
- Public Member Functions inherited from Faunus::Energy::EnergyAccumulatorBase
 EnergyAccumulatorBase (double value)
 
virtual void reserve (size_t number_of_particles)
 
virtual void clear ()
 
virtual void to_json (json &j) const
 
virtual operator double ()
 
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::InstantEnergyAccumulator< PairEnergy >

A basic accumulator which immediately computes and adds energy of a pair of particles upon addition using the PairEnergy templated class.

Generally this is the original way how the pairwise nonbonded energy has been computed in Faunus. Due to compiler optimization, templated class method 'PairEnergy.potential' may be inlined to significantly improve performance.

Template Parameters
PairEnergypair energy implementing a potential(a, b) method for particles a and b

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