5#ifndef _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_SETTEMPERATUREMAPPING_H_
6#define _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_SETTEMPERATUREMAPPING_H_
8#include "coupling/interface/MDSolverInterface.h"
9#include "coupling/interface/Molecule.h"
14namespace cellmappings {
36 : _mdSolverInterface(mdSolverInterface), _factor(
getScalingFactor(oldTemperature, newTemperature)), _meanVelocity(meanVelocity) {}
60 velocity = _meanVelocity + _factor * (velocity - _meanVelocity);
75 double getScalingFactor(
const double& oldTemperature,
const double& newTemperature)
const {
77 if (oldTemperature != 0.0) {
78 return sqrt(newTemperature / oldTemperature);
This class sets a certain temperature over several linked cells.
Definition SetTemperatureMapping.h:25
void endCellIteration()
Definition SetTemperatureMapping.h:47
double getScalingFactor(const double &oldTemperature, const double &newTemperature) const
Definition SetTemperatureMapping.h:75
void handleCell(LinkedCell &cell)
Definition SetTemperatureMapping.h:53
void beginCellIteration()
Definition SetTemperatureMapping.h:43
SetTemperatureMapping(const double &oldTemperature, const double &newTemperature, const tarch::la::Vector< dim, double > &meanVelocity, coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
Definition SetTemperatureMapping.h:34
~SetTemperatureMapping()
Definition SetTemperatureMapping.h:39
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