/* []----------------------------------------[] | Coulomb.h | []----------------------------------------[] | | | AUTHOR: MFSomers 2005. | | USE: Defines a coulomb 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(__COULOMB_INCLUDED__) #define __COULOMB_INCLUDED__ #include "Global.h" #include "Vector.h" #include "Constants.h" #include "ClassicalDynamics.h" #include "PointPair.h" #define COULOMB_VACUUM_CONSTANT (1.0/(4.0*CONST_PI*CONST_VACUUM_PERMITTIVITY)) /* --------------------------------------------------------- */ /* Defines a coulomb pointpair interaction between particles */ class CoulombInteraction; typedef CoulombInteraction *CoulombInteractionPointer; class CoulombInteraction : public PointPairInteraction { public: inline CoulombInteraction( double TheFactor = COULOMB_VACUUM_CONSTANT, unsigned int TheId = GET_NEW_ID, Vector *UsePeriodicBox = NULL ) : PointPairInteraction( TheId, UsePeriodicBox ) { InteractionFactor = TheFactor; Type = ACoulombInteraction; }; inline CoulombInteraction( CoulombInteraction& I ) : PointPairInteraction( I ) { InteractionFactor = I.InteractionFactor; } virtual CoulombInteraction& operator=( CoulombInteraction& I ) { if( &I == &(*this) ) return( (*this) ); PointPairInteraction::operator=( I ); InteractionFactor = I.InteractionFactor; return( (*this) ); } virtual CoulombInteractionPointer Clone() { return( new CoulombInteraction( (*this) ) ); } virtual CoulombInteractionPointer Create( double TheFactor = COULOMB_VACUUM_CONSTANT, unsigned int TheId = GET_NEW_ID, Vector *UsePeriodicBox = NULL ) { return( new CoulombInteraction( TheFactor, TheId, UsePeriodicBox ) ); } virtual double PointPairPotential( Particle& P1, Particle& P2 ); virtual Vector PointPairForce( Particle& P1, Particle& P2 ); double InteractionFactor; }; /* --------------------------------------------------------- */ #endif