ivutils
Loading...
Searching...
No Matches
VTS_Control Class Reference

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.
 

Public Attributes

double en_drift_goal
 desired average energy drift
 
double en_drift_low
 additional parameters for VTS_EPSILONS method: if en_drift_low < en_drift < en_drift_goal the timestep is unchnaged
 
double dt_raise
 maximal timestep increasing factor for a single step
 
double dt_descent
 timestep decreasing fator for VTS_SIMPLE and VTS_EPSILONS methods
 
double exponent
 exponent for VTS_PREDICTIVE method: dE ~ pow(dt,exp)
 
double dt_low_limit
 lowest allowed timestep, ignored if zero
 
double dt_upper_limit
 highest allowed timestep, ignored if zero
 
double dt_critical
 lowest step to autoswitch to ROLLBACK_ON_DE, ignored if zero
 
int forwards
 number of accepted steps
 
int rollbacks
 number of rollbacks
 
int low_limit_reached
 number of approaching the lowest timestep
 

Detailed Description

Provides variable time stepping control together with the logging at equidistant time intervals.

Member Function Documentation

◆ init()

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.

Parameters
vts_methodTimestep control method
step_algorithmGlobal algorithm: MD or minimization

◆ test_step()

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).


The documentation for this class was generated from the following file: