faunus
Public Member Functions | List of all members
Faunus::Energy::Ewald Class Reference

Ewald summation reciprocal energy. More...

#include <energy.h>

Inheritance diagram for Faunus::Energy::Ewald:
Inheritance graph
[legend]
Collaboration diagram for Faunus::Energy::Ewald:
Collaboration graph
[legend]

Public Member Functions

 Ewald (const Space &spc, const EwaldData &data)
 
 Ewald (const json &j, const Space &spc)
 
void init () override
 reset and initialize
 
void setOldGroups (const Space::GroupVector &old_groups)
 Optimization if old groups are available (optional) More...
 
void updateState (const Change &change) override
 If old_groups have been set and if the change object is only partial, this will attempt to perform a faster, partial update of the k-vectors. More...
 
double energy (const Change &change) override
 the selfEnergy() is omitted as this is added as a separate term in Hamiltonian (The pair-potential is responsible for this)
 
void sync (EnergyTerm *energybase, const Change &change) override
 Sync (copy from) another energy instance. More...
 
void to_json (json &j) const override
 json output
 
void force (std::vector< Point > &forces) override
 
- Public Member Functions inherited from Faunus::Energy::EnergyTerm
virtual void force (PointVector &forces)
 update forces on all particles
 

Additional Inherited Members

- Public Types inherited from Faunus::Energy::EnergyTerm
enum  MonteCarloState { ACCEPTED, TRIAL, NONE }
 
- Public Attributes inherited from Faunus::Energy::EnergyTerm
MonteCarloState state = MonteCarloState::NONE
 
std::string name
 Meaningful name.
 
std::string citation_information
 Possible reference; may be left empty.
 
TimeRelativeOfTotal< std::chrono::microseconds > timer
 Timer for measuring speed.
 

Detailed Description

Ewald summation reciprocal energy.

Todo:
energy() currently has the responsibility to update k-vectors.

This is error prone and should be handled before this step.

Member Function Documentation

◆ force()

void Faunus::Energy::Ewald::force ( std::vector< Point > &  forces)
override
Parameters
forcesDestination force vector

Calculate forces from reciprocal space. Note that the destination force vector will not be zeroed before addition.

◆ setOldGroups()

void Faunus::Energy::Ewald::setOldGroups ( const Space::GroupVector &  old_groups)

Optimization if old groups are available (optional)

When updating k-vectors an optimization can be performed if the old group positions are known.

Use this function to set a pointer to the old groups (usually from the accepted Space)

◆ sync()

void Faunus::Energy::Ewald::sync ( EnergyTerm other_energy,
const Change change 
)
overridevirtual

Sync (copy from) another energy instance.

Parameters
other_energyOther energy instance to copy data from
changeDescribes the difference with the other energy term

Reimplemented from Faunus::Energy::EnergyTerm.

◆ updateState()

void Faunus::Energy::Ewald::updateState ( const Change change)
overridevirtual

If old_groups have been set and if the change object is only partial, this will attempt to perform a faster, partial update of the k-vectors.

Otherwise perform a full (slower) update.

Reimplemented from Faunus::Energy::EnergyTerm.


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