faunus
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
Faunus::move::Move Class Referenceabstract

Base class for all moves (MC, Langevin, ...) More...

#include <move.h>

Inheritance diagram for Faunus::move::Move:
Inheritance graph
[legend]
Collaboration diagram for Faunus::move::Move:
Collaboration graph
[legend]

Public Member Functions

void from_json (const json &j)
 
void to_json (json &j) const
 JSON report w. statistics, output etc.
 
void move (Change &change)
 Perform move and modify given change object.
 
void accept (Change &change)
 
void reject (Change &change)
 
void setRepeat (int repeat)
 
virtual double bias (Change &change, double old_energy, double new_energy)
 Extra energy not captured by the Hamiltonian. More...
 
 Move (Space &spc, std::string_view name, std::string_view cite)
 
bool isStochastic () const
 True if move should be called stochastically.
 
const std::string & getName () const
 

Static Public Attributes

static Random slump
 Shared for all moves.
 

Protected Attributes

const std::string name
 Name of move.
 
Spacespc
 Space to operate on.
 
int repeat = 1
 
unsigned long number_of_attempted_moves = 0
 Counter for total number of move attempts.
 

Detailed Description

Base class for all moves (MC, Langevin, ...)

This will propagate the system and return a Change object that describes which parts of the system that was updated. This object is later used to calculate the energy of the change, but this is not the responsibility of the move classes.

Todo:
Privatize and rename members

Member Function Documentation

◆ bias()

double Faunus::move::Move::bias ( Change change,
double  old_energy,
double  new_energy 
)
virtual

Extra energy not captured by the Hamiltonian.

This can be used to introduce an extra energy change that will be added to the total trial energy in the Metropolis acceptance criterion.

Typically used to include bias not contained in Energy::Hamiltonian.

Parameters
changeChange made to the system
old_energyEnergy from hamiltonian before the change (kT)
new_energyEnergy from hamiltonian after the change (kT)
Returns
Energy due to custom bias from the particular move (kT)

Reimplemented in Faunus::move::SpeciationMove, Faunus::move::ForceMove, and Faunus::move::ChainRotationMoveBase.


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