5#ifndef _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_COMPUTETEMPERATUREMAPPING_H_
6#define _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_COMPUTETEMPERATUREMAPPING_H_
8#include "coupling/interface/MDSolverInterface.h"
9#include "coupling/interface/Molecule.h"
13namespace cellmappings {
33 : _mdSolverInterface(mdSolverInterface), _meanVelocity(meanVelocity), _temperature(0.0), _particleCounter(0) {}
50 _temperature = _temperature * _mdSolverInterface->getMoleculeMass();
51 if (_particleCounter != 0) {
52 _temperature = _temperature / (dim * _mdSolverInterface->getKB() * _particleCounter);
65 _temperature += tarch::la::dot((wrapper.
getVelocity() - _meanVelocity), (wrapper.
getVelocity() - _meanVelocity));
82 unsigned int _particleCounter;
This class computes the temperature in a certain (coupling) cell.
Definition ComputeTemperatureMapping.h:25
~ComputeTemperatureMapping()
Definition ComputeTemperatureMapping.h:36
void beginCellIteration()
Definition ComputeTemperatureMapping.h:41
void endCellIteration()
Definition ComputeTemperatureMapping.h:49
double getTemperature() const
Definition ComputeTemperatureMapping.h:76
ComputeTemperatureMapping(const tarch::la::Vector< dim, double > &meanVelocity, coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
Definition ComputeTemperatureMapping.h:31
void handleCell(LinkedCell &cell)
Definition ComputeTemperatureMapping.h:60
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