CP2K 2.4 (Revision 12889)
Functions | Variables

csvr_system_utils Namespace Reference

Functions

REAL(KIND=dp), public rescaling_factor (kk, sigma, ndeg, taut, rng_stream, error)
 Stochastic velocity rescale, as described in Bussi, Donadio and Parrinello, J. Chem. Phys. 126, 014101 (2007)
REAL(KIND=dp) sumnoises (nn, rng_stream, error)
 returns the sum of n independent gaussian noises squared (i.e. equivalent to summing the square of the return values of nn calls to gasdev)

Variables

LOGICAL, parameter debug_this_module = .FALSE.
CHARACTER(len=*), parameter,
private 
moduleN = 'csvr_system_utils'

Detailed Description

History
15.10.2007 Giovanni Bussi - Implementation validated.
Author:
Teodoro Laino - 09.2007 - University of Zurich [tlaino]

Function Documentation

REAL(KIND=dp),public csvr_system_utils::rescaling_factor ( REAL(KIND=dp),intent(in)  kk,
REAL(KIND=dp),intent(in)  sigma,
INTEGER,intent(in)  ndeg,
REAL(KIND=dp),intent(in)  taut,
TYPE(rng_stream_type),pointer  rng_stream,
TYPE(cp_error_type),intent(inout)  error 
)

Stochastic velocity rescale, as described in Bussi, Donadio and Parrinello, J. Chem. Phys. 126, 014101 (2007)

This subroutine implements Eq.(A7) and returns the new value for the kinetic energy, which can be used to rescale the velocities. The procedure can be applied to all atoms or to smaller groups. If it is applied to intersecting groups in sequence, the kinetic energy that is given as an input (kk) has to be up-to-date with respect to the previous rescalings.

When applied to the entire system, and when performing standard molecular dynamics (fixed c.o.m. (center of mass)) the degrees of freedom of the c.o.m. have to be discarded in the calculation of ndeg, and the c.o.m. momentum HAS TO BE SET TO ZERO. When applied to subgroups, one can chose to: (a) calculate the subgroup kinetic energy in the usual reference frame, and count the c.o.m. in ndeg (b) calculate the subgroup kinetic energy with respect to its c.o.m. motion, discard the c.o.m. in ndeg and apply the rescale factor with respect to the subgroup c.o.m. velocity. They should be almost equivalent. If the subgroups are expected to move one respect to the other, the choice (b) should be better.

If a null relaxation time is required (taut=0.0), the procedure reduces to an istantaneous randomization of the kinetic energy, as described in paragraph IIA.

HOW TO CALCULATE THE EFFECTIVE-ENERGY DRIFT The effective-energy (htilde) drift can be used to check the integrator against discretization errors. The easiest recipe is: htilde = h + conint where h is the total energy (kinetic + potential) and conint is a quantity accumulated along the trajectory as minus the sum of all the increments of kinetic energy due to the thermostat.

Variables: kk ! present value of the kinetic energy of the atoms to be thermalized (in arbitrary units) sigma ! target average value of the kinetic energy (ndeg k_b T/2) (in the same units as kk) ndeg ! number of degrees of freedom of the atoms to be thermalized taut ! relaxation time of the thermostat, in units of 'how often this routine is called'

Author:
Giovanni Bussi - ETH Zurich, Lugano 10.2007
Date:
09.2007

Definition at line 74 of file csvr_system_utils.f90.

References sumnoises().

Referenced by csvr_system_dynamics::do_csvr().

Here is the call graph for this function:

Here is the caller graph for this function:

REAL(KIND=dp) csvr_system_utils::sumnoises ( INTEGER,intent(in)  nn,
TYPE(rng_stream_type),pointer  rng_stream,
TYPE(cp_error_type),intent(inout)  error 
) [private]

returns the sum of n independent gaussian noises squared (i.e. equivalent to summing the square of the return values of nn calls to gasdev)

Author:
Teo - University of Zurich
Date:
09.2007

Definition at line 116 of file csvr_system_utils.f90.

Referenced by rescaling_factor().

Here is the caller graph for this function:


Variable Documentation

LOGICAL,parameter csvr_system_utils::debug_this_module = .FALSE.

Definition at line 23 of file csvr_system_utils.f90.

CHARACTER(len=*),parameter,private csvr_system_utils::moduleN = 'csvr_system_utils'

Definition at line 25 of file csvr_system_utils.f90.