/* []----------------------------------------[] | LangevinDynamics.h | []----------------------------------------[] | | | AUTHOR: MFSomers 2005. | | USE: Defines a classical | | dynamics framework class | | to be used for different | | integrators of the | | Langevin equation of | | motion ... | | | []----------------------------------------[] */ // Copyright (C) 2005 M.F. Somers, Theoretical Chemistry Department, Leiden University // // This is free software; you can redistribute it and/or modify it under the terms of // the GNU Lesser General Public License as published by the Free Software Foundation. // // http://www.gnu.org/licenses/lgpl.txt #if !defined(__LANGEVIN_DYNAMICS_INCLUDED__) #define __LANGEVIN_DYNAMICS_INCLUDED__ #include "Global.h" #include "Vector.h" #include "Rand.h" #include "Constants.h" #include "ClassicalDynamics.h" #include "DistanceConstraint.h" /* --------------------------------------------------------- */ class LangevinDynamics; typedef LangevinDynamics *LangevinDynamicsPointer; class LangevinDynamics : public ClassicalDynamics { public: LangevinDynamics( double theGamma = 0.0, double theBoltzmann = 0.0, double theTemperature = 0.0, unsigned int TheId = GET_NEW_ID ) : ClassicalDynamics( 2, TheId ) { Type = LangevinClassicalDynamics; // Gamma = ( theGamma < CONST_EPSILON ? 0.0 : ( theGamma < 1.0 ? theGamma : 1.0 ) ); Gamma = ( theGamma < CONST_EPSILON ? 0.0 : theGamma ); KbT = ( theBoltzmann < CONST_EPSILON ? 0.0 : theBoltzmann ); KbT *= ( theTemperature < CONST_EPSILON ? 0.0 : theTemperature ); }; LangevinDynamics( LangevinDynamics& D ) : ClassicalDynamics( D ) { Gamma = D.Gamma; KbT = D.KbT; }; virtual LangevinDynamics& operator=( LangevinDynamics& D ) { if( &D == &(*this) ) return( (*this) ); ClassicalDynamics::operator=( D ); Gamma = D.Gamma; KbT = D.KbT; return( (*this) ); }; virtual LangevinDynamicsPointer Clone() { return( new LangevinDynamics( (*this) ) ); } virtual LangevinDynamicsPointer Create( double theGamma = 0.0, double theBoltzmann = 0.0, double theTemperature = 0.0, unsigned int TheId = GET_NEW_ID ) { return( new LangevinDynamics( theGamma, theBoltzmann, theTemperature, TheId ) ); } virtual int Integrator( double Step, double Start = 0.0, ConstraintListPointer Constraints = NULL ); virtual int IntegratorConservationCheck( double Step ); virtual int TrajectoryContinuationCheck( double At, double Step, int nStep, int nSteps ); virtual int RunTrajectory( double Start, double Step, int nSteps, ConstraintListPointer Constraints = NULL ); double Gamma, KbT; }; /* --------------------------------------------------------- */ #endif