MaMiCo 1.2
|
Versatile configurable Couette flow test for noise-filtered multi-instance Nie coupling. More...
#include <CouetteScenario.h>
Classes | |
struct | CouplingBuffer |
holds the buffers for the data transfer More... | |
struct | TimingValues |
holds all the variables for the time measurement of a simulation More... | |
Public Member Functions | |
CouetteScenario () | |
simple constructor | |
virtual | ~CouetteScenario () |
a dummy destructor | |
void | run () override |
runs the simulation | |
void | init () override |
initialises everthing necessary for the test | |
void | runOneCouplingCycle (int cycle) override |
combines the functioniality necessary for a cycle of the coupled simulation | |
coupling::solvers::AbstractCouetteSolver< 3 > * | getSolver () override |
![]() | |
Scenario (std::string scenarioname) | |
const coupling::services::ParallelTimeIntegrationService< 3 > * | getTimeIntegrationService () const |
Protected Member Functions | |
void | getRootRank () |
initialises all MPI variables | |
void | twsLoop () |
Executes the entire test several times for a range of time-window-size parameters. | |
void | parseConfigurations () |
reads the configuration from the xml file and calls parseCouetteScenarioConfiguration() | |
void | initSolvers () |
initialises the macro and micro solver according to the setup from the xml file and pre-proccses them | |
void | advanceMacro (int cycle) |
advances the continuum solver and collects data to send to md (fillSendBuffer()) | |
void | varyMD (int cycle) |
void | advanceMicro (int cycle) |
advances the md solver for one coupling time step and collect the data for the coupling | |
void | computeSNR (int cycle) |
used to compute signal-to-noise ratio, stores values in _sum_noise and _sum_signal | |
void | twoWayCoupling (int cycle) |
sets up the boundaries in the macro solver for the coupling and applies the values from the md in the macro solver | |
void | shutdown () |
finalize the time measurement, and cleans up at the end of the simulation | |
tarch::la::Vector< 3, unsigned int > | getGlobalNumberCouplingCells (const simplemd::configurations::MolecularDynamicsConfiguration &simpleMDConfig, const coupling::configurations::MaMiCoConfiguration< 3 > &mamicoConfig) const |
void | allocateMacro2mdBuffer (coupling::interface::MacroscopicSolverInterface< 3 > &msi) |
allocates the send buffer (with values for all coupling cells). | |
void | allocateMd2macroBuffer (coupling::interface::MacroscopicSolverInterface< 3 > &msi) |
template<class Container_T> | |
void | write2CSV (Container_T &md2macroBuffer, int couplingCycle) const |
write coupling cells that have been received from MD to csv file | |
void | fillSendBuffer (const double density, const coupling::solvers::AbstractCouetteSolver< 3 > &couetteSolver, coupling::datastructures::FlexibleCellContainer< 3 > ¯o2MDBuffer) const |
fills send buffer with data from macro/continuum solver | |
coupling::solvers::AbstractCouetteSolver< 3 > * | getCouetteSolver (const double dx, const double dt) |
coupling::interface::MacroscopicSolverInterface< 3 > * | getCouetteSolverInterface (const double dx, tarch::la::Vector< 3, double > mdOffset, tarch::la::Vector< 3, double > mamicoMeshsize, tarch::la::Vector< 3, unsigned int > globalNumberCouplingCells, unsigned int outerRegion) |
Protected Attributes | |
int | _rank |
the rank of the current MPI process in the local time domain | |
bool | _isRootRank |
if this is the world global root process | |
int | _tws |
simplemd::configurations::MolecularDynamicsConfiguration | _simpleMDConfig |
the config data and information for SimpleMD | |
coupling::configurations::MaMiCoConfiguration< 3 > | _mamicoConfig |
the config data and information for MaMiCo | |
coupling::configurations::CouetteConfig | _cfg |
the CouetteConfig for the current setup | |
unsigned int | _mdStepCounter |
the counter for the time steps, which are done within the md | |
coupling::solvers::AbstractCouetteSolver< 3 > * | _couetteSolver |
the current macro/continuum solver | |
tarch::utils::MultiMDService< 3 > * | _multiMDService |
coupling::services::MultiMDCellService< MY_LINKEDCELL, 3 > * | _multiMDCellService |
CouplingBuffer | _couplingBuffer |
the current buffer for the coupling | |
std::vector< coupling::interface::MDSolverInterface< MY_LINKEDCELL, 3 > * > | _mdSolverInterface |
the interface to the md solver | |
coupling::InstanceHandling< MY_LINKEDCELL, 3 > * | _instanceHandling |
std::default_random_engine | _generator |
double | _sum_signal |
double | _sum_noise |
TimingValues | _tv |
a instance of the timingValues | |
coupling::MultiMDMediator< MY_LINKEDCELL, 3 > * | _multiMDMediator |
![]() | |
std::unique_ptr< coupling::services::ParallelTimeIntegrationService< 3 > > | _timeIntegrationService |
Versatile configurable Couette flow test for noise-filtered multi-instance Nie coupling.
Features, depending on couette.xml config file: -> one-way or two-way coupling -> statup or oscillating flow scenario -> using analytical or Lattice Bolzmann Couette flow solver -> using (multi-instance) SimpleMD or synthetic MD data (with Gaussian noise) -> CSV output option for filtered data -> ability to delay scenario startup or two-way coupling for filter initialisation time -> signal-to-noise ratio (SNR) computation (between filter output and macroscopic solver) -> runtime measurements and logging separately for coupled simulation components -> 'tws-loop' feature for testing many POD time-window-size parameters in a single run -> dynamic multi-instance MD, adapt number of MD instances according to defined error
|
inlineprotected |
advances the continuum solver and collects data to send to md (fillSendBuffer())
cycle | the number of the current coupling time step |
|
inlineprotected |
advances the md solver for one coupling time step and collect the data for the coupling
cycle | the number of the current coupling time step |
|
inlineprotected |
allocates the send buffer (with values for all coupling cells).
msi | macroscopic solver interface for the continuum solver |
|
inlineprotected |
allocates the recv-buffer. This buffer contains all global inner coupling cells, but only on rank 0. On all other ranks, no cells are stored and a NULL ptr is returned
|
inlineprotected |
used to compute signal-to-noise ratio, stores values in _sum_noise and _sum_signal
todo@ use more cells
|
inlineprotected |
fills send buffer with data from macro/continuum solver
density | the general density of the fluid |
couetteSolver | the continuum solver |
macro2MDBuffer | the bufffer to send data from macro to micro |
globalCellIndices4SendBuffer | the global linearized indices of the coupling cells in the buffer |
|
inlineprotected |
dx | the grid size (equidistant mesh) |
dt | the time step |
|
inlineprotected |
couetteSolver | the macro/continuum solver |
mdOffset | the offset of the md domain from (0.0.0) |
mamicoMeshsize | |
globalNumberCouplingCells | the total number coupling cells for the whole domain |
outerRegion |
|
inlineprotected |
computes global number of coupling cells from configs. Required by couette solver interface before CouplingCellService is initialised!
|
inlineoverridevirtual |
Implements Scenario.
|
inlineoverridevirtual |
initialises everthing necessary for the test
triggers initMPI(), parseConfiguration(), and initSolvers()
Implements Scenario.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
combines the functioniality necessary for a cycle of the coupled simulation
it advances the macro (advanceMacro()) and micro solver (advanceMicro), computes the signal to noise ratio (computeSNR()) and sends the data from the macro to the micro solver (twoWayCoupling())
Implements Scenario.
|
inlineprotected |
sets up the boundaries in the macro solver for the coupling and applies the values from the md in the macro solver
cycle | current time step of the coupled simulation |
|
inlineprotected |
write coupling cells that have been received from MD to csv file
recvBuffer | the buffer for the data, which comes from md |
recvIndices | the indices for the macr cells in the buffer |
couplingCycle | the current number of coupling cycle |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |