MaMiCo 1.2
|
Simulation slots are managed (i.e., added/removed) via this class. Works and interacts with the class coupling::MultiMDMediator closely. More...
#include <InstanceHandling.h>
Public Member Functions | |
InstanceHandling (simplemd::configurations::MolecularDynamicsConfiguration &mdConfig, coupling::configurations::MaMiCoConfiguration< dim > &mamicoConfig, tarch::utils::MultiMDService< dim > &multiMDService) | |
~InstanceHandling () | |
void | equilibrate (const unsigned int &t, const unsigned int &T) |
auto & | getSimpleMD () const |
void | setMDSolverInterface () |
auto & | getMDSolverInterface () const |
void | switchOnCoupling () |
void | switchOnCoupling (const unsigned int &i) |
void | switchOffCoupling () |
void | switchOffCoupling (const unsigned int &i) |
void | simulateTimesteps (const unsigned int &t, unsigned int &T) |
void | writeCheckpoint (const std::string &filestem, const unsigned int &T) const |
void | simulateTimesteps (const unsigned int &t, unsigned int &T, coupling::services::MultiMDCellService< LinkedCell, dim > &multiMDCellService) |
void | simulateTimesteps (const unsigned int &t, unsigned int &T, const unsigned int &i) |
void | addSimulationBlock () |
void | rmSimulationBlock () |
coupling::interface::MDSolverInterface< LinkedCell, dim > * | addMDSimulation (unsigned int slot, unsigned int localIndex) |
void | rmMDSimulation (const unsigned int &index) |
void | setCouplingCellServices (coupling::services::MultiMDCellService< LinkedCell, dim > &multiMDCellService) |
Private Attributes | |
std::vector< coupling::interface::MDSimulation * > | _mdSimulations |
std::vector< coupling::interface::MDSolverInterface< LinkedCell, dim > * > | _mdSolverInterface |
simplemd::configurations::MolecularDynamicsConfiguration & | _mdConfig |
coupling::configurations::MaMiCoConfiguration< dim > & | _mamicoConfig |
const tarch::utils::MultiMDService< dim > & | _multiMDService |
Simulation slots are managed (i.e., added/removed) via this class. Works and interacts with the class coupling::MultiMDMediator closely.
holds one vector of MDSimulation and one vector for MDSolverInterface. Initialization, execution of MD time steps and shutdown are abstracted into this class. In order to launch a new MF simulatio, a slot has to be chosen first (either manualy or using coupling::MultiMDMediator). Then MultiMDCellService initializes a new CouplingCellService via MultiMDMediator. In the activated slot, a new MD simulation is launched. The new MD instance has to be equilibrated first and then it can be coupled to the simulation. In order to remove a MD simulation, the MD simulation and its corresponding MDSolverInterface are shut down. Then, the respective instance of the CouplingCellService is removed. Finally, the selected slot will be set to inactive. This slot is now available again for the launch of a new MD instance in the future.
LinkedCell | type of the cell |
dim | Number of dimensions; it can be 1, 2 or 3 |
|
inline |
Constructor:
mdConfig | |
mamicoConfig | |
multiMDService |
|
inline |
Destructor:
|
inline |
adds one MS instance with the identifier localIndex to the slot "slot" and return the corresponding MD solver interface. It initializes first an instance of the slot "slot". Then set the _mdSimulations[localIndex] to this new instance.
slot | |
localIndex |
|
inline |
add a nullptr to the MD simulation vector and the vector of the MD solver interface.
|
inline |
switches off the coupling between the new MD simulations and Macroscopic solver and lets the MD simulations run t time steps starting from the time step T to equilibrate. It should be called before switchOnCoupling()
T | |
t |
|
inline |
Returns the MD solver onterface
|
inline |
returns the vector of MD simulations
|
inline |
removes one MS instance with the identifier index and delete the corresponding MD solver interface.
index |
|
inline |
rempve the last element of the MD simulation vector and the last element of the vector of the MD solver interface.
|
inline |
sets single cell services in each MD simulation after initialising coupling cell service for multi-MD case
multiMDCellService |
|
inline |
Allocates Coupling interfaces This method has to be called after switchOnCoupling()
|
inline |
Simulates t timesteps starting from current timestep T on all instances.
T | |
t |
|
inline |
Simulates t timesteps starting from current timestep T on all instances but only performs simulation on one particular instance
t | |
T | |
i |
|
inline |
Simulates t timesteps starting from current timestep T on all instances and additionally uses MamicoInterfaceProvider for interfacing MD to FD.
t | |
T | |
multiMDCellService |
|
inline |
switches off the coupling between All new MD simulations and Macroscopic solver.
|
inline |
switches off the coupling between a new MD simulation with the index i and Macroscopic solver.
i | index number of the MD simulation |
|
inline |
switches on the coupling between ALL new MD simulations and Macroscopic solver after the new MD instances are equilibrated. It should be called right after equilibrate() and before setMDSolverInterface()
|
inline |
switches on the coupling between a specific new MD simulation with the index number i and Macroscopic solver. It should be called right after equilibrate() and before setMDSolverInterface()
i |
|
inline |
Saves the simulation result of the first MD instance as check point in the file filestem
filestem | |
T |