MaMiCo 1.2
Loading...
Searching...
No Matches
ParticleInsertion.h
1// Copyright (C) 2015 Technische Universitaet Muenchen
2// This file is part of the Mamico project. For conditions of distribution
3// and use, please see the copyright notice in Mamico's main folder, or at
4// www5.in.tum.de/mamico
5#ifndef _MOLECULARDYNAMICS_COUPLING_PARTICLEINSERTION_H_
6#define _MOLECULARDYNAMICS_COUPLING_PARTICLEINSERTION_H_
7
8#include "coupling/BoundaryForceController.h"
9#include <cstdlib>
10#include <iostream>
11
12namespace coupling {
13template <class LinkedCell, unsigned int dim> class ParticleInsertion;
14}
15
23template <class LinkedCell, unsigned int dim> class coupling::ParticleInsertion {
24public:
27 enum Action {
31 };
32
47 const tarch::la::Vector<dim, double>& couplingCellSize, const tarch::la::Vector<dim, double>& meanVelocity, const double& temperature,
48 const coupling::BoundaryForceController<LinkedCell, dim>& boundaryForceController) = 0;
49
60
64 ParticleInsertion(unsigned int insertDeleteMassEveryTimestep) : _insertDeleteMassEveryTimestep(insertDeleteMassEveryTimestep) {
66 std::cout << "ERROR ParticleInsertion::ParticleInsertion(..): "
67 "_insertDeleteMassEveryTimestep=0!"
68 << std::endl;
69 exit(EXIT_FAILURE);
70 }
71 }
72
74 virtual ~ParticleInsertion() {}
75
81 bool insertDeleteMassAtTimestep(unsigned int t) const { return (t % _insertDeleteMassEveryTimestep == 0); }
82
83private:
86};
87#endif // _MOLECULARDYNAMICS_COUPLING_PARTICLEINSERTION_H_
controller for forces acting at open MD boundaries
Definition BoundaryForceController.h:25
interface for particle insertion/removal on coupling cell basis.
Definition ParticleInsertion.h:23
ParticleInsertion(unsigned int insertDeleteMassEveryTimestep)
a simple constructor
Definition ParticleInsertion.h:64
Action
Definition ParticleInsertion.h:27
@ NoAction
No action was taken / Nothing changed.
Definition ParticleInsertion.h:28
@ Deletion
A molecule was deleted.
Definition ParticleInsertion.h:30
@ Insertion
A molecule was inserted.
Definition ParticleInsertion.h:29
bool insertDeleteMassAtTimestep(unsigned int t) const
returns true if mass needs to be inserted or removed in a time step t
Definition ParticleInsertion.h:81
virtual ~ParticleInsertion()
a simple destructor
Definition ParticleInsertion.h:74
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)=0
adds or removes particles to the coupling cell, simulates a mass flow.
virtual bool requiresPotentialEnergyLandscape()=0
returns true, if a potential energy landscape is needed for the insertion/removal.
const unsigned int _insertDeleteMassEveryTimestep
Definition ParticleInsertion.h:85
defines the cell type with cell-averaged quantities. Derived from the class coupling::datastructures:...
Definition CouplingCellWithLinkedCells.h:26
Definition Vector.h:24
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15