MaMiCo 1.2
Loading...
Searching...
No Matches
NieVelocityImpositionMapping.h
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_CELLMAPPINGS_NIEVELOCITYIMPOSITIONMAPPING_H_
6#define _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_NIEVELOCITYIMPOSITIONMAPPING_H_
7
8#include "coupling/CouplingMDDefinitions.h"
9#include "coupling/datastructures/CouplingCell.h"
10#include "coupling/interface/MDSolverInterface.h"
11#include "coupling/interface/Molecule.h"
12#include "tarch/la/Matrix.h"
13#include <iostream>
14
15namespace coupling {
16namespace cellmappings {
17template <class LinkedCell, unsigned int dim> class NieVelocityImpositionMapping;
18}
19} // namespace coupling
20
34template <class LinkedCell, unsigned int dim> class coupling::cellmappings::NieVelocityImpositionMapping {
35public:
47 : _mdSolverInterface(mdSolverInterface), _continuumVelocity(continuumVelocity), _avgMDVelocity(avgMDVelocity), _avgForce(avgForce) {}
48
51
55
59
63 void handleCell(LinkedCell& cell) {
65
66 it->begin();
67 while (it->continueIteration()) {
70 force = force - _avgForce - (_mdSolverInterface->getMoleculeMass() / _mdSolverInterface->getDt()) * (_avgMDVelocity - _continuumVelocity);
71 wrapper.setForce(force);
72 it->next();
73 }
74 delete it;
75 }
76
77private:
87};
88
89#endif // _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_NIEVELOCITYIMPOSITIONMAPPING_H_
This class employs an acceleration based on velocity gradients (in time) using the forcing term of th...
Definition NieVelocityImpositionMapping.h:34
void endCellIteration()
Definition NieVelocityImpositionMapping.h:58
NieVelocityImpositionMapping(const tarch::la::Vector< dim, double > &continuumVelocity, const tarch::la::Vector< dim, double > &avgMDVelocity, const tarch::la::Vector< dim, double > &avgForce, coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
Definition NieVelocityImpositionMapping.h:45
virtual ~NieVelocityImpositionMapping()
Definition NieVelocityImpositionMapping.h:50
const tarch::la::Vector< dim, double > _continuumVelocity
Definition NieVelocityImpositionMapping.h:82
const tarch::la::Vector< dim, double > _avgMDVelocity
Definition NieVelocityImpositionMapping.h:84
const tarch::la::Vector< dim, double > _avgForce
Definition NieVelocityImpositionMapping.h:86
void handleCell(LinkedCell &cell)
Definition NieVelocityImpositionMapping.h:63
coupling::interface::MDSolverInterface< LinkedCell, dim > *const _mdSolverInterface
Definition NieVelocityImpositionMapping.h:79
void beginCellIteration()
Definition NieVelocityImpositionMapping.h:54
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 setForce(const tarch::la::Vector< dim, double > &force)=0
virtual tarch::la::Vector< dim, double > getForce() const =0
Definition Vector.h:24
everything necessary for coupling operations, is defined in here
Definition AdditiveMomentumInsertion.h:15