MaMiCo 1.2
|
#include <MultiMDCellService.h>
Public Member Functions | |
MultiMDCellService (std::vector< coupling::interface::MDSolverInterface< LinkedCell, dim > * > mdSolverInterfaces, coupling::interface::MacroscopicSolverInterface< dim > *macroscopicSolverInterface, simplemd::configurations::MolecularDynamicsConfiguration &mdConfiguration, coupling::configurations::MaMiCoConfiguration< dim > &mamicoConfiguration, const char *filterPipelineConfiguration, tarch::utils::MultiMDService< dim > &multiMDService, int tws=0) | |
coupling::services::CouplingCellService< dim > & | getCouplingCellService (unsigned int localIndex) |
void | plotEveryMacroscopicTimestepforCouplingCellService (unsigned int localIndex, int cycle) |
void | plotEveryMacroscopicTimestep (int cycle) |
void | computeAndStoreTemperature (double temp) |
void | sendFromMacro2MD (const coupling::datastructures::FlexibleCellContainer< dim > ¯o2mdCouplingCellContainer) |
void | bcastFromMacro2MD (const std::vector< coupling::datastructures::CouplingCell< dim > * > &couplingCellsFromMacroscopicSolver, const I00 *const indices) |
void | sumUpCouplingCellsFromMamico () |
double | reduceFromMD2Macro (const std::vector< coupling::datastructures::CouplingCell< dim > * > &couplingCellsFromMacroscopicSolver, const I00 *const indices) |
double | sendFromMD2Macro (const coupling::datastructures::FlexibleCellContainer< dim > &md2macroCouplingCells) |
void | preprocessingForMD2Macro (const coupling::datastructures::FlexibleCellContainer< dim > &cells) |
unsigned int | rmMDSimulation (coupling::InstanceHandling< LinkedCell, dim > &instanceHandling, const unsigned int &index) |
void | removeSimulationBlock () |
void | addSimulationBlock () |
unsigned int | addMDSimulation (coupling::InstanceHandling< LinkedCell, dim > &instanceHandling, coupling::interface::MacroscopicSolverInterface< dim > *macroscopicSolverInterface, const unsigned int &slot) |
unsigned int | getLocalNumberOfMDSimulations () const |
void | finishCycle (const unsigned int &cycle, coupling::InstanceHandling< LinkedCell, dim > &instanceHandling) |
void | writeCheckpoint (const unsigned int &cycle, const coupling::InstanceHandling< LinkedCell, dim > &instanceHandling) const |
void | constructFilterPipelines () |
Private Member Functions | |
unsigned int | computeTopologyOffset () const |
unsigned int | computeScalarNumberProcesses () const |
coupling::services::CouplingCellService< dim > * | createCouplingCellServiceDummy (unsigned int ID, coupling::interface::MacroscopicSolverInterface< dim > *macroscopicSolverInterface, simplemd::configurations::MolecularDynamicsConfiguration &mdConfiguration, tarch::utils::MultiMDService< dim > &multiMDService, coupling::configurations::MaMiCoConfiguration< dim > &mamicoConfiguration, unsigned int topologyOffset) const |
Private Attributes | |
unsigned int | _localNumberMDSimulations |
unsigned int | _totalNumberMDSimulations |
coupling::services::CouplingCellService< dim > ** | _couplingCellServices |
tarch::utils::MultiMDService< dim > & | _multiMDService |
unsigned int | _topologyOffset |
const int | _tws |
const unsigned int | _intNumberProcesses |
coupling::datastructures::FlexibleCellContainer< dim > | _couplingCells |
coupling::datastructures::FlexibleCellContainer< dim > | _sumCouplingCells |
simplemd::configurations::MolecularDynamicsConfiguration & | _mdConfiguration |
coupling::configurations::MaMiCoConfiguration< dim > & | _mamicoConfiguration |
const std::string | _filterPipelineConfiguration |
coupling::interface::MacroscopicSolverInterface< dim > * | _macroscopicSolverInterface |
unsigned int | _blockOffset |
std::vector< bool > | _listActiveMDSimulations |
unsigned int | _nextFreeBlock |
std::vector< int > | _warmupPhase |
coupling::filtering::FilterPipeline< I14, dim > * | _postMultiInstanceFilterPipeline |
coupling::sendrecv::FromMD2Macro< coupling::datastructures::CouplingCell< dim >, dim > | _fromMD2Macro |
service to couple various MD simulations to a single instance of a macroscopic solver. We currently consider only one layout: global ranks are linearly split into blocks of size numberProcesses. Each block may run several MD simulations. Each of these simulations has one mdSolverInterface (handed over in the constructor as vector).
|
inline |
Adds CouplingCellService at appropriate slot
|
inline |
In order to make space for new simulation slots We need to add one slot to the local coupling cell service implementations and also one slot per macroOnly cell service. As the topologyOffset per MacroOnly cell service changes, we re-initialize these as well.
|
inline |
broadcasts data from macroscopic solver to all MD simulations
|
inline |
get access to coupling cell services. This is required potentially by each MD simulation to incorporate cell-local thermostat, mass and momentum transfer
|
inline |
Forward Plotting to coupling cell services if not NULL!
|
inline |
preprocessing operations for reducing data from MD instances to macro
|
inline |
reduce data from MD simulations, averages over them (only macroscopic mass/momentum is considered) and writes the result back into couplingCellsFromMacroscopicSolver.
|
inline |
In case there is exactly one free slot available per local comm, remove one slot per comm (that is, one block of simulations)
|
inline |
removes the last simulation which has been added.
|
inline |
send data from macroscopic solver to all MD simulations
|
inline |
collects data from MD simulations, averages over them (only macroscopic mass/momentum is considered) and writes the result back into couplingCellsFromMacroscopicSolver.
|
inline |
Creates the sum over all instances' coupling cells, in order to reduce the amount of communication needed.
|
private |
total number of MD simulations
|
private |
used to reduce all local coupling cells before sending from md 2 macro
|
private |
pointers of CouplingCellService type, one for each MD simulation
|
private |
One entry per (in-)active md simulation, totals to _totalNumberMDSimulations
|
private |
Counts the number of remaining warmup cycles after this simulation has been added. This is only relevent for simulations added during the simulation.
|
private |
used to store in MD data in sendFromMD2Macro
|
private |
number of MD simulations run on the current rank. This can differ for different blocks, i.e. different topologyOffset values.
|
private |
topology offset
|
private |
Points to the next block, to which a simulation should be added.