faunus
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
Faunus::Change Struct Reference

Specify changes made to a system. More...

#include <space.h>

Classes

struct  GroupChange
 Properties of changed groups. More...
 

Public Types

using index_type = std::size_t
 

Public Member Functions

std::optional< std::pair< index_type, index_type > > singleParticleChange () const
 Determines if the change reflects a single particle change. More...
 
auto touchedGroupIndex () const
 List of moved groups (index)
 
std::vector< index_type > touchedParticleIndex (const std::vector< Group > &) const
 List of changed atom index relative to first particle in system.
 
void clear ()
 Clear all change data.
 
bool empty () const
 Check if change object is empty.
 
 operator bool () const
 True if object is not empty.
 
void sanityCheck (const std::vector< Group > &group_vector) const
 Sanity check on contained object data. More...
 

Public Attributes

bool everything = false
 Everything has changed (particles, groups, volume)
 
bool volume_change = false
 The volume has changed.
 
bool matter_change = false
 The number of atomic or molecular species has changed.
 
bool moved_to_moved_interactions
 If several groups are moved, should they interact with each other? More...
 
bool disable_translational_entropy = false
 Force exclusion of translational entropy.
 
std::vector< GroupChangegroups
 Touched groups by index in group vector.
 

Detailed Description

Specify changes made to a system.

This class is used to describe a change to the system. It carries information about changed group index, changed atom index, if the volume has been changed, if there has been a particle insertion etc. It does NOT describe the extent of the change, but simply points to the affected groups, particles, etc. The class is set when performing a system perturbation like a Monte Carlo move and then passed on to the energy function where it is used to establish which energies to calculate.

Some notes:

Member Function Documentation

◆ sanityCheck()

void Faunus::Change::sanityCheck ( const std::vector< Group > &  group_vector) const

Sanity check on contained object data.

Parameters
group_vectorVector of group connected to the change; typically Space::groups.
Exceptions
Ifthe atoms in the change object is outside range of given group index.

◆ singleParticleChange()

std::optional< std::pair< Change::index_type, Change::index_type > > Faunus::Change::singleParticleChange ( ) const

Determines if the change reflects a single particle change.

Returns
Optional pair with index of group (first) and relative particle index (second) in the group

Since single particle updates are frequently used, this convenience function helps to establish if this is the case.

Member Data Documentation

◆ moved_to_moved_interactions

bool Faunus::Change::moved_to_moved_interactions
Initial value:
=
true

If several groups are moved, should they interact with each other?


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