MaMiCo
1.2
Toggle main menu visibility
Loading...
Searching...
No Matches
coupling
cell-mappings
MoleculeExtractor.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_MOLECULEEXTRACTOR_H_
6
#define _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_MOLECULEEXTRACTOR_H_
7
#include "coupling/interface/MDSolverInterface.h"
8
#include "coupling/interface/MoleculeIterator.h"
9
#include <iostream>
10
11
namespace
coupling
{
12
namespace
cellmappings {
13
template
<
class
LinkedCell,
unsigned
int
dim>
class
MoleculeExtractor
;
14
}
15
}
// namespace coupling
16
28
template
<
class
LinkedCell,
unsigned
int
dim>
class
coupling::cellmappings::MoleculeExtractor
{
29
public
:
33
MoleculeExtractor
(
coupling::interface::MDSolverInterface<LinkedCell, dim>
*
const
mdSolverInterface) : _mdSolverInterface(mdSolverInterface) {
34
_molecules.clear();
35
}
36
38
~MoleculeExtractor
() {}
39
43
void
beginCellIteration
() { _molecules.clear(); }
44
47
void
endCellIteration
() {}
48
52
void
handleCell
(LinkedCell& cell) {
53
coupling::interface::MoleculeIterator<LinkedCell, dim>
* it = _mdSolverInterface->getMoleculeIterator(cell);
54
it->
begin
();
55
while
(it->
continueIteration
()) {
56
_molecules.push_back(it->
getConst
().getPosition());
57
it->
next
();
58
}
59
delete
it;
60
}
61
65
const
std::vector<tarch::la::Vector<dim, double>>&
getExtractedMolecules
()
const
{
return
_molecules; }
66
67
private
:
68
coupling::interface::MDSolverInterface<LinkedCell, dim>
*
const
_mdSolverInterface;
69
std::vector<tarch::la::Vector<dim, double>> _molecules;
70
};
71
72
#endif
// _MOLECULARDYNAMICS_COUPLING_CELLMAPPINGS_MOLECULEEXTRACTOR_H_
coupling::cellmappings::MoleculeExtractor
This class extracts molecule information from a given coupling cell and stores all molecule positions...
Definition
MoleculeExtractor.h:28
coupling::cellmappings::MoleculeExtractor::endCellIteration
void endCellIteration()
Definition
MoleculeExtractor.h:47
coupling::cellmappings::MoleculeExtractor::MoleculeExtractor
MoleculeExtractor(coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
Definition
MoleculeExtractor.h:33
coupling::cellmappings::MoleculeExtractor::beginCellIteration
void beginCellIteration()
Definition
MoleculeExtractor.h:43
coupling::cellmappings::MoleculeExtractor::handleCell
void handleCell(LinkedCell &cell)
Definition
MoleculeExtractor.h:52
coupling::cellmappings::MoleculeExtractor::~MoleculeExtractor
~MoleculeExtractor()
Definition
MoleculeExtractor.h:38
coupling::cellmappings::MoleculeExtractor::getExtractedMolecules
const std::vector< tarch::la::Vector< dim, double > > & getExtractedMolecules() const
Definition
MoleculeExtractor.h:65
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::getConst
virtual const coupling::interface::Molecule< dim > & getConst()=0
coupling
everything necessary for coupling operations, is defined in here
Definition
AdditiveMomentumInsertion.h:15
Generated by
1.17.0