faunus
Public Member Functions | Static Public Member Functions | List of all members
Faunus::move::SpeciationMove Class Reference

Generalised Grand Canonical Monte Carlo Move. More...

#include <speciation.h>

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

Public Member Functions

 SpeciationMove (Space &spc, Space &old_spc)
 
double bias (Change &change, double old_energy, double new_energy) override
 The acceptance/rejection of the move is affected by the equilibrium constant, but unaffected by the change in internal bond energy.
 
- Public Member Functions inherited from Faunus::move::Move
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)
 
 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 Member Functions

static void swapParticleProperties (Particle &particle, int new_atomid)
 Swap particle to another type. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Faunus::move::Move
static Random slump
 Shared for all moves.
 
- Protected Attributes inherited from Faunus::move::Move
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

Generalised Grand Canonical Monte Carlo Move.

This move handles insertion and deletion of atomic and molecular groups, including swap moves and implicit atomic species. Flow of events:

  1. pick random Faunus::ReactionData object
  2. pick random direction (left or right)
  3. perform appropriate action:
    • atomic swap
    • deactivate reactants
    • activate products

To avoid touching the state of MoveBase::slump, we use an internal random number generator. This is ß for e.g. the Parallel temper move that relies MoveBase::slump to be in sync across MPI ranks.

Todo:
Split atom-swap functionality to separate helper class

Member Function Documentation

◆ swapParticleProperties()

void Faunus::move::SpeciationMove::swapParticleProperties ( Particle particle,
int  new_atomid 
)
static

Swap particle to another type.

Parameters
particleExisting particle to be swapped out
new_atomidThe new atomtype to swap in

This will keep original positions and internal orientation of particles, while swapping the atomid and other properties related to the new atom type

Todo:
This could make use of policies to customize how particles should be updated. Split to helper class.

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