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

#include <AveragingTransferStrategy.h>

Inheritance diagram for coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >:
Collaboration diagram for coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >:

Public Member Functions

 AveragingTransferStrategy (coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
 a simple constructor
 
virtual ~AveragingTransferStrategy ()
 a dummy destructor
 
void beginProcessInnerCouplingCellsBeforeReceivingMacroscopicSolverData () override
 reset the sample counter before processing any cell
 
void processInnerCouplingCellBeforeReceivingMacroscopicSolverData (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index) override
 macroscopicMass and -Momentum are reset before the data from the macro solver is transferred
 
void beginProcessInnerCouplingCellsAfterMDTimestep () override
 values are reseted before the cells are processes and on rank=0 info is written to the stdstream
 
void processInnerCouplingCellAfterMDTimestep (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index) override
 the averaging operation is applied to the cell
 
- Public Member Functions inherited from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >
 TransferStrategy (coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface)
 a simple destructor
 
virtual ~TransferStrategy ()
 a dummy destructor
 
virtual void endProcessInnerCouplingCellsBeforeReceivingMacroscopicSolverData ()
 the method is called after the cells are processed, e.g. some general evaluation might happen like sum/counter
 
virtual void processOuterCouplingCellBeforeReceivingMacroscopicSolverData (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index)
 is called on the outer coupling cells before the data from the macro solver is applied
 
virtual void beginProcessOuterCouplingCellsBeforeReceivingMacroscopicSolverData ()
 the method is called before the outer cells are processed, e.g. general values might be set here
 
virtual void endProcessOuterCouplingCellsBeforeReceivingMacroscopicSolverData ()
 the method is called after the outer cells are processed, e.g. general values might be set here
 
virtual void processInnerCouplingCellAfterReceivingMacroscopicSolverData (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index)
 
virtual void beginProcessInnerCouplingCellsAfterReceivingMacroscopicSolverData ()
 the method is called before the inner cells are processed, e.g. general values might be set here
 
virtual void endProcessInnerCouplingCellsAfterReceivingMacroscopicSolverData ()
 the method is called after the inner cells are processed, e.g. general values might be set here
 
virtual void processOuterCouplingCellAfterReceivingMacroscopicSolverData (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index)
 is called for every coupling cell after the microscopicMass and -Momentum have been filled in with data from the macroscopic solver.
 
virtual void beginProcessOuterCouplingCellsAfterReceivingMacroscopicSolverData ()
 the method is called before the outer cells are processed, e.g. general values might be set here
 
virtual void endProcessOuterCouplingCellsAfterReceivingMacroscopicSolverData ()
 the method is called after the outer cells are processed, e.g. general values might be set here
 
virtual void processInnerCouplingCellBeforeSendingMDSolverData (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index)
 is called for every coupling cell before sending the macroscopicMass and -Momentum data to the macroscopic solver and before noise reduction invocation.
 
virtual void beginProcessInnerCouplingCellsBeforeSendingMDSolverData ()
 the method is called before the inner cell data is send, e.g. general values might be set here
 
virtual void endProcessInnerCouplingCellsBeforeSendingMDSolverData ()
 the method is called after the inner cell data is send, e.g. general values might be set here
 
virtual void processOuterCouplingCellBeforeSendingMDSolverData (coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > &cell, I02 index)
 is called for outer coupling cell before sending the macroscopicMass and -Momentum data to the macroscopic solver and before noise reduction invocation.
 
virtual void beginProcessOuterCouplingCellsBeforeSendingMDSolverData ()
 the method is called before the outer cells are processed, e.g. general values might be set here
 
virtual void endProcessOuterCouplingCellsBeforeSendingMDSolverData ()
 the method is called after the outer cells are processed, e.g. general values might be set here
 
virtual void endProcessInnerCouplingCellsAfterMDTimestep ()
 the method is called after the inner cell data is send, e.g. general values might be set here
 

Private Attributes

coupling::cellmappings::ComputeMassMapping< LinkedCell, dim > _massMapping
 
coupling::cellmappings::ComputeMomentumMapping< LinkedCell, dim > _momentumMapping
 
unsigned int _sampleCounter
 
const unsigned int _rank
 
tarch::la::Vector< dim, double > _avgMomentum
 
double _avgMass
 

Additional Inherited Members

- Protected Attributes inherited from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >
coupling::interface::MDSolverInterface< LinkedCell, dim > *const _mdSolverInterface
 

Detailed Description

template<class LinkedCell, unsigned int dim>
class coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >

this class is used for pure averaging operations on the coupling cells. This can be used e.g. to measure errors in averaging over time, to estimate number of samples etc.

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

◆ AveragingTransferStrategy()

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

a simple constructor

Parameters
mdSolverInterfaceinterface for the md solver

Member Function Documentation

◆ beginProcessInnerCouplingCellsAfterMDTimestep()

template<class LinkedCell, unsigned int dim>
void coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >::beginProcessInnerCouplingCellsAfterMDTimestep ( )
inlineoverridevirtual

values are reseted before the cells are processes and on rank=0 info is written to the stdstream

Reimplemented from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >.

◆ beginProcessInnerCouplingCellsBeforeReceivingMacroscopicSolverData()

template<class LinkedCell, unsigned int dim>
void coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >::beginProcessInnerCouplingCellsBeforeReceivingMacroscopicSolverData ( )
inlineoverridevirtual

reset the sample counter before processing any cell

Reimplemented from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >.

◆ processInnerCouplingCellAfterMDTimestep()

template<class LinkedCell, unsigned int dim>
void coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >::processInnerCouplingCellAfterMDTimestep ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
I02 index )
inlineoverridevirtual

the averaging operation is applied to the cell

the macroscopicMass and -Momentum are averaged over all md time steps

Parameters
cellthe coupling cell to process
indexthe index of the coupling cell

Reimplemented from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >.

◆ processInnerCouplingCellBeforeReceivingMacroscopicSolverData()

template<class LinkedCell, unsigned int dim>
void coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >::processInnerCouplingCellBeforeReceivingMacroscopicSolverData ( coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > & cell,
I02 index )
inlineoverridevirtual

macroscopicMass and -Momentum are reset before the data from the macro solver is transferred

Parameters
cellthe coupling cell to process
indexthe index of the coupling cell

Reimplemented from coupling::transferstrategies::TransferStrategy< LinkedCell, dim >.

Member Data Documentation

◆ _avgMass

template<class LinkedCell, unsigned int dim>
double coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >::_avgMass
private

the mass of every cell is summed in this variable and divided by the _sampleCounter so it holds the average mass in the end

◆ _avgMomentum

template<class LinkedCell, unsigned int dim>
tarch::la::Vector<dim, double> coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >::_avgMomentum
private

the momentum of every cell is summed in this variable and divided by the _sampleCounter so it holds the average momentum in the end

◆ _massMapping

template<class LinkedCell, unsigned int dim>
coupling::cellmappings::ComputeMassMapping<LinkedCell, dim> coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >::_massMapping
private

necessary to compute the mass in the cells

◆ _momentumMapping

template<class LinkedCell, unsigned int dim>
coupling::cellmappings::ComputeMomentumMapping<LinkedCell, dim> coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >::_momentumMapping
private

necessary to compute the current momentum in the cell

◆ _rank

template<class LinkedCell, unsigned int dim>
const unsigned int coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >::_rank
private

rank of the mpi process

◆ _sampleCounter

template<class LinkedCell, unsigned int dim>
unsigned int coupling::transferstrategies::AveragingTransferStrategy< LinkedCell, dim >::_sampleCounter
private

counter for the samples


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