MaMiCo
1.2
Toggle main menu visibility
Loading...
Searching...
No Matches
coupling
cell-mappings
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
15
namespace
coupling
{
16
namespace
cellmappings {
17
template
<
class
LinkedCell,
unsigned
int
dim>
class
NieVelocityImpositionMapping
;
18
}
19
}
// namespace coupling
20
34
template
<
class
LinkedCell,
unsigned
int
dim>
class
coupling::cellmappings::NieVelocityImpositionMapping
{
35
public
:
45
NieVelocityImpositionMapping
(
const
tarch::la::Vector<dim, double>
& continuumVelocity,
const
tarch::la::Vector<dim, double>
& avgMDVelocity,
46
const
tarch::la::Vector<dim, double>
& avgForce,
coupling::interface::MDSolverInterface<LinkedCell, dim>
*
const
mdSolverInterface)
47
:
_mdSolverInterface
(mdSolverInterface),
_continuumVelocity
(continuumVelocity),
_avgMDVelocity
(avgMDVelocity),
_avgForce
(avgForce) {}
48
50
virtual
~NieVelocityImpositionMapping
() {}
51
54
void
beginCellIteration
() {}
55
58
void
endCellIteration
() {}
59
63
void
handleCell
(LinkedCell& cell) {
64
coupling::interface::MoleculeIterator<LinkedCell, dim>
* it =
_mdSolverInterface
->getMoleculeIterator(cell);
65
66
it->
begin
();
67
while
(it->
continueIteration
()) {
68
coupling::interface::Molecule<dim>
& wrapper(it->
get
());
69
tarch::la::Vector<dim, double>
force(wrapper.
getForce
());
70
force = force -
_avgForce
- (
_mdSolverInterface
->getMoleculeMass() /
_mdSolverInterface
->getDt()) * (
_avgMDVelocity
-
_continuumVelocity
);
71
wrapper.
setForce
(force);
72
it->
next
();
73
}
74
delete
it;
75
}
76
77
private
:
79
coupling::interface::MDSolverInterface<LinkedCell, dim>
*
const
_mdSolverInterface
;
82
const
tarch::la::Vector<dim, double>
_continuumVelocity
;
84
const
tarch::la::Vector<dim, double>
_avgMDVelocity
;
86
const
tarch::la::Vector<dim, double>
_avgForce
;
87
};
88
89
#endif
// _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_NIEVELOCITYIMPOSITIONMAPPING_H_
coupling::cellmappings::NieVelocityImpositionMapping
This class employs an acceleration based on velocity gradients (in time) using the forcing term of th...
Definition
NieVelocityImpositionMapping.h:34
coupling::cellmappings::NieVelocityImpositionMapping::endCellIteration
void endCellIteration()
Definition
NieVelocityImpositionMapping.h:58
coupling::cellmappings::NieVelocityImpositionMapping::NieVelocityImpositionMapping
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
coupling::cellmappings::NieVelocityImpositionMapping::~NieVelocityImpositionMapping
virtual ~NieVelocityImpositionMapping()
Definition
NieVelocityImpositionMapping.h:50
coupling::cellmappings::NieVelocityImpositionMapping::_continuumVelocity
const tarch::la::Vector< dim, double > _continuumVelocity
Definition
NieVelocityImpositionMapping.h:82
coupling::cellmappings::NieVelocityImpositionMapping::_avgMDVelocity
const tarch::la::Vector< dim, double > _avgMDVelocity
Definition
NieVelocityImpositionMapping.h:84
coupling::cellmappings::NieVelocityImpositionMapping::_avgForce
const tarch::la::Vector< dim, double > _avgForce
Definition
NieVelocityImpositionMapping.h:86
coupling::cellmappings::NieVelocityImpositionMapping::handleCell
void handleCell(LinkedCell &cell)
Definition
NieVelocityImpositionMapping.h:63
coupling::cellmappings::NieVelocityImpositionMapping::_mdSolverInterface
coupling::interface::MDSolverInterface< LinkedCell, dim > *const _mdSolverInterface
Definition
NieVelocityImpositionMapping.h:79
coupling::cellmappings::NieVelocityImpositionMapping::beginCellIteration
void beginCellIteration()
Definition
NieVelocityImpositionMapping.h:54
coupling::interface::MDSolverInterface
interface to the MD simulation
Definition
MDSolverInterface.h:25
coupling::interface::MoleculeIterator
some iterator scheme for traversing the molecules within a linked cell.
Definition
MoleculeIterator.h:24
coupling::interface::MoleculeIterator::continueIteration
virtual bool continueIteration() const =0
coupling::interface::MoleculeIterator::next
virtual void next()=0
coupling::interface::MoleculeIterator::begin
virtual void begin()=0
coupling::interface::MoleculeIterator::get
virtual coupling::interface::Molecule< dim > & get()=0
coupling::interface::Molecule
interface to access a single molecule in the MD simulation.
Definition
Molecule.h:23
coupling::interface::Molecule::setForce
virtual void setForce(const tarch::la::Vector< dim, double > &force)=0
coupling::interface::Molecule::getForce
virtual tarch::la::Vector< dim, double > getForce() const =0
tarch::la::Vector
Definition
Vector.h:25
coupling
everything necessary for coupling operations, is defined in here
Definition
AdditiveMomentumInsertion.h:15
Generated by
1.17.0