MaMiCo 1.2
Loading...
Searching...
No Matches
coupling::UsherParticleInsertion< LinkedCell, dim > Class Template Reference

handles particle insertion (via Usher algorithm) and random particle deletion. More...

#include <UsherParticleInsertion.h>

Inheritance diagram for coupling::UsherParticleInsertion< LinkedCell, dim >:
Collaboration diagram for coupling::UsherParticleInsertion< LinkedCell, dim >:

Classes

class  UsherParams
 collects all the parameters necessary for the Usher algorithm More...
 

Public Member Functions

 UsherParticleInsertion (unsigned int insertDeleteMassEveryTimestep, double rSigmaCoeff, double meanPotentialEnergyFactor, double uOverlapCoeff, double stepRefCoeff, unsigned int iterMax, unsigned int restartMax, double tolerance, double offsetFromOuterBoundary, coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
 a simple constructor
 
virtual ~UsherParticleInsertion ()
 a dummy destructor
 
virtual coupling::ParticleInsertion< LinkedCell, dim >::Action insertDeleteMass (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, const tarch::la::Vector< dim, double > &couplingCellPosition, const tarch::la::Vector< dim, double > &couplingCellSize, const tarch::la::Vector< dim, double > &meanVelocity, const double &temperature, const coupling::BoundaryForceController< LinkedCell, dim > &boundaryForceController)
 checks if a particle needs to be inserted or deleted in a cell
 
virtual bool requiresPotentialEnergyLandscape ()
 since the Usher algorithm requires the potential energy landscape, the function returns true
 
- Public Member Functions inherited from coupling::ParticleInsertion< LinkedCell, dim >
 ParticleInsertion (unsigned int insertDeleteMassEveryTimestep)
 a simple constructor
 
virtual ~ParticleInsertion ()
 a simple destructor
 
bool insertDeleteMassAtTimestep (unsigned int t) const
 returns true if mass needs to be inserted or removed in a time step t
 

Protected Member Functions

virtual coupling::ParticleInsertion< LinkedCell, dim >::Action findParticlePosition (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &thisCell, const tarch::la::Vector< dim, double > &couplingCellPosition, const tarch::la::Vector< dim, double > &couplingCellSize, coupling::datastructures::Molecule< dim > &molecule, const coupling::BoundaryForceController< LinkedCell, dim > &boundaryForceController)
 determines the position of a new particle within the coupling cell
 

Protected Attributes

coupling::interface::MDSolverInterface< LinkedCell, dim > *const _mdSolverInterface
 interface to the md solver
 
const UsherParams _usherParams
 instance of the UsherParams, stores all necessary parameters
 

Private Member Functions

coupling::ParticleInsertion< LinkedCell, dim >::Action insertParticle (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, const tarch::la::Vector< dim, double > &couplingCellPosition, const tarch::la::Vector< dim, double > &couplingCellSize, const tarch::la::Vector< dim, double > &meanVelocity, const double &temperature, const coupling::BoundaryForceController< LinkedCell, dim > &boundaryForceController)
 tries to insert a particle in the respective coupling cell.
 
coupling::ParticleInsertion< LinkedCell, dim >::Action deleteParticle (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, const coupling::BoundaryForceController< LinkedCell, dim > &boundaryForceController)
 tries to delete a particle from the coupling cell.
 

Additional Inherited Members

- Public Types inherited from coupling::ParticleInsertion< LinkedCell, dim >
enum  Action { NoAction = 0 , Insertion = 1 , Deletion = 2 }
 

Detailed Description

template<class LinkedCell, unsigned int dim>
class coupling::UsherParticleInsertion< LinkedCell, dim >

handles particle insertion (via Usher algorithm) and random particle deletion.

particles will be inserted or removed based on the microscopic mass of a cell The algorithm is only applied to outer boundary cells of the md (non ghost cells) We currently also allow particle insertion in energyy holes, i.e. for energy(particle)==0.0.

Author
Philipp Neumann
Template Parameters
LinkedCellthe LinkedCell class is given by the implementation of linked cells in the molecular dynamics simulation
dimrefers to the spacial dimension of the simulation, can be 1, 2, or 3

Constructor & Destructor Documentation

◆ UsherParticleInsertion()

template<class LinkedCell, unsigned int dim>
coupling::UsherParticleInsertion< LinkedCell, dim >::UsherParticleInsertion ( unsigned int insertDeleteMassEveryTimestep,
double rSigmaCoeff,
double meanPotentialEnergyFactor,
double uOverlapCoeff,
double stepRefCoeff,
unsigned int iterMax,
unsigned int restartMax,
double tolerance,
double offsetFromOuterBoundary,
coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface )

a simple constructor

Parameters
insertDeleteMassAtTimestepthe interval of time steps for the insertion/deletion of mass
rSigmaCoeffcoefficient to adapt r_sigma (see Usher algorithm for details,), r_sigma = sigma * rSigmaCoeff
meanPotentialEnergyFactorscales for the U_0 value of the Usher algorithm
uOverlapCoeffscales the overlap energy U_ovlp (refers to the Usher algorithm)
stepRefCoeffthe maximal displacment within the usher method
iterMaxmaximal number of usher iterations per try
restartMaxmaximal number of usher restarts
tolerancesets the tolerance, between the reached energy level and the goal energy level
offsetFromOuterBoundaryoffset of the md domain (difference between the left, lower, front corner to 0,0,0)
mdSolverInterfaceinterface for the md solver

Member Function Documentation

◆ deleteParticle()

template<class LinkedCell, unsigned int dim>
coupling::ParticleInsertion< LinkedCell, dim >::Action coupling::UsherParticleInsertion< LinkedCell, dim >::deleteParticle ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
const coupling::BoundaryForceController< LinkedCell, dim > & boundaryForceController )
private

tries to delete a particle from the coupling cell.

Returns Deletion on success and NoAction otherwise.

Parameters
cellthe coupling cell to check if an action is necessary
boundaryForceControlleran instance of the boundary force controller in application
Returns
NoAction or Deletion, depending on the action applied (coupling::ParticleInsertion::Action)

◆ findParticlePosition()

template<class LinkedCell, unsigned int dim>
virtual coupling::ParticleInsertion< LinkedCell, dim >::Action coupling::UsherParticleInsertion< LinkedCell, dim >::findParticlePosition ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & thisCell,
const tarch::la::Vector< dim, double > & couplingCellPosition,
const tarch::la::Vector< dim, double > & couplingCellSize,
coupling::datastructures::Molecule< dim > & molecule,
const coupling::BoundaryForceController< LinkedCell, dim > & boundaryForceController )
protectedvirtual

determines the position of a new particle within the coupling cell

the result is stored in the position entry of the molecule 'molecule'. The method returns Insertion if a position has been found and NoAction otherwise.

Parameters
thisCellthe coupling cell to check if an action is necessary
couplingCellPositionthe postion of the coupling cell
couplingCellSizethe size of the coupling cell per direction
moleculethe molecule which shall be inserted
boundaryForceControlleran instance of the boundary force controller in application
Returns
NoAction or Insertion, depending on the result of the Usher method applied here (coupling::ParticleInsertion::Action)

◆ insertDeleteMass()

template<class LinkedCell, unsigned int dim>
virtual coupling::ParticleInsertion< LinkedCell, dim >::Action coupling::UsherParticleInsertion< LinkedCell, dim >::insertDeleteMass ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
const tarch::la::Vector< dim, double > & couplingCellPosition,
const tarch::la::Vector< dim, double > & couplingCellSize,
const tarch::la::Vector< dim, double > & meanVelocity,
const double & temperature,
const coupling::BoundaryForceController< LinkedCell, dim > & boundaryForceController )
virtual

checks if a particle needs to be inserted or deleted in a cell

Todo
why is this here? Already declared in the ParticleInsertion.

the function checks for the value of the microscopic mass and calls upon this either the inserteParticle() er deleteParticle() method, or just returns without an action

Parameters
cellthe coupling cell to check if an action is necessary
couplingCellPositionthe postion of the coupling cell
couplingCellSizethe size of the coupling cell per direction
meanVelocitythe mean velocity of all particles in the cell
temperaturethe temperature in the cell
boundaryForceControlleran instance of the boundary force controller in application
Returns
the type of action which was applied (coupling::ParticleInsertion::Action)

Implements coupling::ParticleInsertion< LinkedCell, dim >.

◆ insertParticle()

template<class LinkedCell, unsigned int dim>
coupling::ParticleInsertion< LinkedCell, dim >::Action coupling::UsherParticleInsertion< LinkedCell, dim >::insertParticle ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
const tarch::la::Vector< dim, double > & couplingCellPosition,
const tarch::la::Vector< dim, double > & couplingCellSize,
const tarch::la::Vector< dim, double > & meanVelocity,
const double & temperature,
const coupling::BoundaryForceController< LinkedCell, dim > & boundaryForceController )
private

tries to insert a particle in the respective coupling cell.

Returns Insertion on success and NoAction otherwise.

Parameters
cellthe coupling cell to check if an action is necessary
couplingCellPositionthe postion of the coupling cell
couplingCellSizethe size of the coupling cell per direction
meanVelocitythe mean velocity of all particles in the cell
temperaturethe temperature in the cell
boundaryForceControlleran instance of the boundary force controller in application
Returns
NoAction or Insertion, depending on the applied action (coupling::ParticleInsertion::Action)

◆ requiresPotentialEnergyLandscape()

template<class LinkedCell, unsigned int dim>
virtual bool coupling::UsherParticleInsertion< LinkedCell, dim >::requiresPotentialEnergyLandscape ( )
inlinevirtual

since the Usher algorithm requires the potential energy landscape, the function returns true

Returns
true

Implements coupling::ParticleInsertion< LinkedCell, dim >.


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