5#ifndef _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_COMPUTEMOMENTUMMAPPING_H_
6#define _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_COMPUTEMOMENTUMMAPPING_H_
8#include "coupling/interface/MDSolverInterface.h"
9#include "coupling/interface/Molecule.h"
13namespace cellmappings {
30 : _mdSolverInterface(mdSolverInterface), _momentum(0.0), _meanVelocity(0.0), _particleCounter(0) {}
50 if (_particleCounter != 0) {
51 _meanVelocity = (1.0 / ((double)_particleCounter)) * _momentum;
52 _momentum = _mdSolverInterface->getMoleculeMass() * _momentum;
87 unsigned int _particleCounter;
This class computes the momentum over certain linked cells.
Definition ComputeMomentumMapping.h:24
tarch::la::Vector< dim, double > getMeanVelocity() const
Definition ComputeMomentumMapping.h:81
~ComputeMomentumMapping()
Definition ComputeMomentumMapping.h:33
void handleCell(LinkedCell &cell)
Definition ComputeMomentumMapping.h:60
tarch::la::Vector< dim, double > getMomentum() const
Definition ComputeMomentumMapping.h:76
void endCellIteration()
Definition ComputeMomentumMapping.h:49
void beginCellIteration()
Definition ComputeMomentumMapping.h:38
ComputeMomentumMapping(coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
Definition ComputeMomentumMapping.h:29
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 const coupling::interface::Molecule< dim > & getConst()=0
interface to access a single molecule in the MD simulation.
Definition Molecule.h:23
virtual tarch::la::Vector< dim, double > getVelocity() const =0
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15