5#ifndef _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_SETMOMENTUMMAPPING_H_
6#define _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_SETMOMENTUMMAPPING_H_
8#include "coupling/interface/MDSolverInterface.h"
9#include "coupling/interface/Molecule.h"
13namespace cellmappings {
36 : _mdSolverInterface(mdSolverInterface), _oldVelocity(
getVelocity(numberParticles, oldMomentum)),
37 _newVelocity(
getVelocity(numberParticles, newMomentum)) {}
60 velocity = velocity - _oldVelocity + _newVelocity;
75 if (numberParticles != 0) {
76 return (1.0 / (numberParticles * _mdSolverInterface->getMoleculeMass())) * momentum;
This class sets a certain momentum over several linked cells.
Definition SetMomentumMapping.h:24
void beginCellIteration()
Definition SetMomentumMapping.h:44
SetMomentumMapping(const tarch::la::Vector< dim, double > &oldMomentum, const tarch::la::Vector< dim, double > &newMomentum, const unsigned int &numberParticles, coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
Definition SetMomentumMapping.h:34
void handleCell(LinkedCell &cell)
Definition SetMomentumMapping.h:54
~SetMomentumMapping()
Definition SetMomentumMapping.h:40
void endCellIteration()
Definition SetMomentumMapping.h:48
tarch::la::Vector< dim, double > getVelocity(const unsigned int &numberParticles, const tarch::la::Vector< dim, double > &momentum) const
Definition SetMomentumMapping.h:74
interface to the MD simulation
Definition MDSolverInterface.h:25
some iterator scheme for traversing the molecules within a linked cell.
Definition MoleculeIterator.h:24
virtual bool continueIteration() const =0
virtual coupling::interface::Molecule< dim > & get()=0
interface to access a single molecule in the MD simulation.
Definition Molecule.h:23
virtual void setVelocity(const tarch::la::Vector< dim, double > &velocity)=0
virtual tarch::la::Vector< dim, double > getVelocity() const =0
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15