5#ifndef _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_COMPUTEAVGFORCEANDVELOCITY_H_
6#define _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_COMPUTEAVGFORCEANDVELOCITY_H_
8#include "coupling/interface/MDSolverInterface.h"
12namespace cellmappings {
32 : _mdSolverInterface(mdSolverInterface), _force(0.0), _velocity(0.0), _particleCounter(0) {}
51 if (_particleCounter != 0) {
52 _force = (1.0 / _particleCounter) * _force;
53 _velocity = (1.0 / _particleCounter) * _velocity;
67 _force = _force + wrapper.
getForce();
88 unsigned int _particleCounter;
This class sums up all force/velocity vectors and counts molecules inside a linked cell.
Definition ComputeAvgForceAndVelocity.h:26
~ComputeAvgForceAndVelocity()
Definition ComputeAvgForceAndVelocity.h:35
tarch::la::Vector< dim, double > getAvgVelocity() const
Definition ComputeAvgForceAndVelocity.h:82
void beginCellIteration()
Definition ComputeAvgForceAndVelocity.h:40
tarch::la::Vector< dim, double > getAvgForce() const
Definition ComputeAvgForceAndVelocity.h:77
void handleCell(LinkedCell &cell)
Definition ComputeAvgForceAndVelocity.h:61
void endCellIteration()
Definition ComputeAvgForceAndVelocity.h:50
ComputeAvgForceAndVelocity(coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
Definition ComputeAvgForceAndVelocity.h:31
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 tarch::la::Vector< dim, double > getVelocity() const =0
virtual tarch::la::Vector< dim, double > getForce() const =0
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15