5#ifndef _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_COMPUTEMEANPOTENTIALENERGYMAPPING_H_
6#define _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_COMPUTEMEANPOTENTIALENERGYMAPPING_H_
8#include "coupling/BoundaryForceController.h"
9#include "coupling/interface/MDSolverInterface.h"
10#include "coupling/interface/Molecule.h"
14namespace cellmappings {
34 : _mdSolverInterface(mdSolverInterface), _meanPotentialEnergy(0.0), _particleCounter(0), _boundaryForceController(boundaryForceController) {}
43 _meanPotentialEnergy = 0.0;
52 if (_particleCounter != 0) {
53 _meanPotentialEnergy = _meanPotentialEnergy / _particleCounter;
67 _meanPotentialEnergy += _boundaryForceController.getPotentialEnergy(wrapper.
getPosition());
82 double _meanPotentialEnergy;
83 unsigned int _particleCounter;
controller for forces acting at open MD boundaries
Definition BoundaryForceController.h:25
This class computes the mean potential energy over this coupling cell.
Definition ComputeMeanPotentialEnergyMapping.h:26
double getPotentialEnergy() const
Definition ComputeMeanPotentialEnergyMapping.h:78
~ComputeMeanPotentialEnergyMapping()
Definition ComputeMeanPotentialEnergyMapping.h:37
void beginCellIteration()
Definition ComputeMeanPotentialEnergyMapping.h:42
void handleCell(LinkedCell &cell)
Definition ComputeMeanPotentialEnergyMapping.h:61
void endCellIteration()
Definition ComputeMeanPotentialEnergyMapping.h:51
ComputeMeanPotentialEnergyMapping(coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface, const coupling::BoundaryForceController< LinkedCell, dim > &boundaryForceController)
Definition ComputeMeanPotentialEnergyMapping.h:32
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 double getPotentialEnergy() const =0
virtual tarch::la::Vector< dim, double > getPosition() const =0
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15