ivutils
|
Provides variable time stepping control together with the logging at equidistant time intervals. More...
#include <vts.h>
Public Types | |
enum | ROLLBACK_MODE |
sets the criteria for energy conservation at each step ROLLBACK_ON_DE_DT the value of (E1-E0)/dt is preserved ROLLBACK_ON_DE the value of (E1-E0) is preserved | |
Public Member Functions | |
VTS_Control (VTS_METHOD vts_method=VTS_NONE, STEP_ALGORITHM step_algorithm=STEP_MD) | |
Constructor. See init for explanation. | |
void | init (VTS_METHOD vts_method=VTS_NONE, STEP_ALGORITHM step_algorithm=STEP_MD) |
Sets the VTS method, basic stepping algorithm and initializes all public variables. | |
void | set_max_drift (double en_drift_max=0.) |
Sets the maximal value of energy change at which the rollback is requested. | |
bool | test_step (double dt, double en_drift, double *dt_new=0, double time_to_update=0., bool invalid_state=false) |
Returns true if a step made from t to t+dt is acceptable with the given energy drift en_drift. | |
Provides variable time stepping control together with the logging at equidistant time intervals.
void VTS_Control::init | ( | VTS_METHOD | vts_method = VTS_NONE , |
STEP_ALGORITHM | step_algorithm = STEP_MD |
||
) |
Sets the VTS method, basic stepping algorithm and initializes all public variables.
vts_method | Timestep control method |
step_algorithm | Global algorithm: MD or minimization |
bool VTS_Control::test_step | ( | double | dt, |
double | en_drift, | ||
double * | dt_new = 0 , |
||
double | time_to_update = 0. , |
||
bool | invalid_state = false |
||
) |
Returns true if a step made from t to t+dt is acceptable with the given energy drift en_drift.
In case of ACCEPTED step puts the suggested (possibly increased) NEXT time step (to be used for stepping further from (t+dt) to (t+dt)+dt_new) into dt_new. If time_to_update > 0, then dt_new is set to be lower or equal time_to_update. Used to match the time moments for log file updates. In case of REJECTED step puts the suggested CORRECTED (reduced) time step (to be used for repeating a step from t to t+dt_new) into dt_corrected. This value should be used for the next trial (revert to time t, make step to t+dt_new, evaluate en_drift again).