Closed mxmlnkn closed 7 years ago
Turns out I was just missing a call to synchronize after copying molecules from the backup in molecules0. After adding simulation.synchronize( simulation );
all versions do work. Btw, why is the argument necessary? synchronize is already a member function of simulation, so using the this-pointer should be just fine.
When trying to repeat simulations e.g. for a naive ensemble average, then the first result is always higher. My first try looked a bit like this:
Attached is my test program: testSimulationRepetition.cpp. The results are:
testFullCleanRepetition
completely reconstructs the simulation object, resets the box, allowed movements and molecules.testSaveConstructorsRepetition
this was my first try as can be seen abovetestSaveConstructorsRepetitionWithTaskManager
This is the same as above, but in each run the task manager and all analyzers, updaters are deconstructed and newly constructed.testSaveConstructorsRepetitionRespawnMolecules
in this test the linemolecules = molecules0
is replaced bymolecules.resize(0); spawnMolecules(molecules);
As can be seen
testSaveConstructorsRepetitionRespawnMolecules
andtestFullCleanRepetition
do work as expected, but the others don't, therefore I assume the copy-method in Molecules.h is bugged.