LCOV - code coverage report
Current view: top level - coupling - MomentumInsertion.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 2 50.0 %
Date: 2025-06-25 11:26:37 Functions: 0 0 -

          Line data    Source code
       1             : // Copyright (C) 2015 Technische Universitaet Muenchen
       2             : // This file is part of the Mamico project. For conditions of distribution
       3             : // and use, please see the copyright notice in Mamico's main folder, or at
       4             : // www5.in.tum.de/mamico
       5             : #ifndef _MOLECULARDYNAMICS_COUPLING_MOMENTUMINSERTION_H_
       6             : #define _MOLECULARDYNAMICS_COUPLING_MOMENTUMINSERTION_H_
       7             : 
       8             : #include "coupling/datastructures/CouplingCell.h"
       9             : #include "tarch/la/Vector.h"
      10             : 
      11             : namespace coupling {
      12             : template <class LinkedCell, unsigned int dim> class MomentumInsertion;
      13             : }
      14             : 
      15             : /** @brief used to manipulate the momentum/ velocity of the molecules contained
      16             :  * in a coupling cell.
      17             :  *  @author Philipp Neumann
      18             :  *  @tparam LinkedCell the LinkedCell class is given by the implementation of
      19             :  * linked cells in the molecular dynamics simulation
      20             :  *  @tparam dim  refers to the spacial dimension of the simulation, can be 1, 2,
      21             :  * or 3
      22             :  */
      23             : template <class LinkedCell, unsigned int dim> class coupling::MomentumInsertion {
      24             : public:
      25             :   /** @brief a simple constructor
      26             :    *  @param mdSolverInterface interface to the md solver*/
      27           4 :   MomentumInsertion(coupling::interface::MDSolverInterface<LinkedCell, dim>* const mdSolverInterface) : _mdSolverInterface(mdSolverInterface) {}
      28             :   /** @brief a simple destructor*/
      29           0 :   virtual ~MomentumInsertion() {}
      30             : 
      31             :   /** @brief returns the number of MD steps between subsequent momentum
      32             :    * insertions
      33             :    *  @returns the time step interval for momentum insertion */
      34             :   virtual unsigned int getTimeIntervalPerMomentumInsertion() const = 0;
      35             : 
      36             :   /** This method does not conserve the kinetic energy of the respective
      37             :    * coupling cell. To conserve the energy as well, see the description of
      38             :    * MomentumController on details how to do that.
      39             :    *  @brief inserts a fraction from the momentum of the coupling cell and
      40             :    * distributes is over all molecules.
      41             :    *  @param cell the coupling cell to insert the momentum
      42             :    *  @param fraction the fraction of momentum to use */
      43             :   virtual void insertMomentum(coupling::datastructures::CouplingCellWithLinkedCells<LinkedCell, dim>& cell, I02 idx) const = 0;
      44             : 
      45             : protected:
      46             :   /** interface to the md solver */
      47             :   coupling::interface::MDSolverInterface<LinkedCell, dim>* const _mdSolverInterface;
      48             : };
      49             : 
      50             : #endif // _MOLECULARDYNAMICS_COUPLING_MOMENTUMINSERTION_H_

Generated by: LCOV version 1.14