/* []----------------------------------------[] | Morse.h | []----------------------------------------[] | | | AUTHOR: MFSomers 2005. | | USE: Defines a Morse type | | interaction... | | | []----------------------------------------[] */ // 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(__MORSE_INCLUDED__) #define __MORSE_INCLUDED__ #include "Global.h" #include "Vector.h" #include "Constants.h" #include "ClassicalDynamics.h" #include "PointPair.h" /* --------------------------------------------------------- */ /* Defines a Morse pointpair interaction between particles */ class MorseInteraction; typedef MorseInteraction *MorseInteractionPointer; class MorseInteraction : public PointPairInteraction { public: inline MorseInteraction( double TheD, double TheR, double TheAlfa, unsigned int TheId = GET_NEW_ID, Vector *UsePeriodicBox = NULL ) : PointPairInteraction( TheId, UsePeriodicBox ) { D = TheD; R = TheR; Alfa = TheAlfa; Type = AMorseInteraction; } inline MorseInteraction( MorseInteraction& I ) : PointPairInteraction( I ) { D = I.D; R = I.R; Alfa = I.Alfa; } virtual MorseInteraction& operator=( MorseInteraction& I ) { if( &I == &(*this) ) return( (*this) ); PointPairInteraction::operator=( I ); D = I.D; R = I.R; Alfa = I.Alfa; return( (*this) ); } virtual MorseInteractionPointer Clone() { return( new MorseInteraction( (*this) ) ); } virtual MorseInteractionPointer Create( double TheD = 1.0, double TheR = 1.0, double TheAlfa = 1.0, unsigned int TheId = GET_NEW_ID, Vector *UsePeriodicBox = NULL ) { return( new MorseInteraction( TheD, TheR, TheAlfa, TheId, UsePeriodicBox ) ); } virtual double PointPairPotential( Particle& P1, Particle& P2 ); virtual Vector PointPairForce( Particle& P1, Particle& P2 ); double D, R, Alfa; /* V(r) = D * ( 1 - EXP(-Alfa(r-R)) )^2 - D */ }; /* --------------------------------------------------------- */ #endif