MaMiCo 1.2
Loading...
Searching...
No Matches
coupling::MomentumController< LinkedCell, dim > Class Template Reference

controls the momentum in a coupling cell. More...

#include <MomentumController.h>

Public Member Functions

 MomentumController (coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
 a simple constructor
 
 ~MomentumController ()
 
void computeMomentumAndMeanVelocity (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, tarch::la::Vector< dim, double > &momentum, tarch::la::Vector< dim, double > &meanVelocity)
 computes and returns the momentum and mean velocity of a coupling cell
 
void computeMomentum (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, tarch::la::Vector< dim, double > &momentum)
 computes and returns the momentum of a coupling cell
 
void computeMeanVelocity (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, tarch::la::Vector< dim, double > &meanVelocity)
 
void setMomentum (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, const tarch::la::Vector< dim, double > &newMomentum)
 sets the momentum of a coupling cell to the input value.
 

Private Attributes

coupling::cellmappings::ComputeMassMapping< LinkedCell, dim > _computeMassMapping
 
coupling::cellmappings::ComputeMomentumMapping< LinkedCell, dim > _computeMomentumMapping
 
coupling::interface::MDSolverInterface< LinkedCell, dim > *const _mdSolverInterface
 

Detailed Description

template<class LinkedCell, unsigned int dim>
class coupling::MomentumController< LinkedCell, dim >

controls the momentum in a coupling cell.

This class can compute the momentum and set a certain value for the momentum.

Author
Philipp Neumann
Template Parameters
LinkedCellthe LinkedCell class is given by the implementation of linked cells in the molecular dynamics simulation
dimrefers to the spacial dimension of the simulation, can be 1, 2, or 3

Constructor & Destructor Documentation

◆ MomentumController()

template<class LinkedCell, unsigned int dim>
coupling::MomentumController< LinkedCell, dim >::MomentumController ( coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
inline

a simple constructor

Parameters
mdSolverInterfaceinterface to the md solver

◆ ~MomentumController()

template<class LinkedCell, unsigned int dim>
coupling::MomentumController< LinkedCell, dim >::~MomentumController ( )
inline

a simple destructor

Member Function Documentation

◆ computeMeanVelocity()

template<class LinkedCell, unsigned int dim>
void coupling::MomentumController< LinkedCell, dim >::computeMeanVelocity ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
tarch::la::Vector< dim, double > & meanVelocity )
inline

computes and returns the mean velocity of a coupling cell

Parameters
cellthe coupling cell, for which the values shall be calculated
meanVelocityvector to which the mean velocity of the cell will be written to

◆ computeMomentum()

template<class LinkedCell, unsigned int dim>
void coupling::MomentumController< LinkedCell, dim >::computeMomentum ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
tarch::la::Vector< dim, double > & momentum )
inline

computes and returns the momentum of a coupling cell

Parameters
cellthe coupling cell, for which the values shall be calculated
momentumvector to which the momentum of the cell will be written to

◆ computeMomentumAndMeanVelocity()

template<class LinkedCell, unsigned int dim>
void coupling::MomentumController< LinkedCell, dim >::computeMomentumAndMeanVelocity ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
tarch::la::Vector< dim, double > & momentum,
tarch::la::Vector< dim, double > & meanVelocity )
inline

computes and returns the momentum and mean velocity of a coupling cell

Parameters
cellthe coupling cell, for which the values shall be calculated
momentumvector to which the momentum of the cell will be written to
meanVelocityvector to which the mean velocity of the cell will be written to

◆ setMomentum()

template<class LinkedCell, unsigned int dim>
void coupling::MomentumController< LinkedCell, dim >::setMomentum ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
const tarch::la::Vector< dim, double > & newMomentum )
inline

sets the momentum of a coupling cell to the input value.

This cell does not consider the kinetic energy of the system, so the kinetic energy will be different after executing this method! In order to also retain the kinetic energy, one might compute the kinetic energy before calling this method (using the KineticEnergyController) and set the old kinetic energy afterwards (again using the KineticEnergyController). This will then set the right kinetic energy again, conserving both mass and momentum over this cell.

Parameters
cellthe coupling cell in which the momentum shall be changed
newMomentumthe value to which the momentum will be set

Member Data Documentation

◆ _computeMassMapping

template<class LinkedCell, unsigned int dim>
coupling::cellmappings::ComputeMassMapping<LinkedCell, dim> coupling::MomentumController< LinkedCell, dim >::_computeMassMapping
private

instance of the ComputeMassMapping

◆ _computeMomentumMapping

template<class LinkedCell, unsigned int dim>
coupling::cellmappings::ComputeMomentumMapping<LinkedCell, dim> coupling::MomentumController< LinkedCell, dim >::_computeMomentumMapping
private

instance of the ComputeMomentumMapping

◆ _mdSolverInterface

template<class LinkedCell, unsigned int dim>
coupling::interface::MDSolverInterface<LinkedCell, dim>* const coupling::MomentumController< LinkedCell, dim >::_mdSolverInterface
private

interface to the md solver


The documentation for this class was generated from the following file: