Contrib.h

Go to the documentation of this file.
00001 //
00002 //  Copyright (C) 2004-2006 Rational Discovery LLC
00003 //
00004 //   @@ All Rights Reserved @@
00005 //  This file is part of the RDKit.
00006 //  The contents are covered by the terms of the BSD license
00007 //  which is included in the file license.txt, found at the root
00008 //  of the RDKit source tree.
00009 //
00010 #ifndef __RD_FFCONTRIB_H__
00011 #define __RD_FFCONTRIB_H__
00012 
00013 namespace ForceFields {
00014   class ForceField;
00015 
00016   //! abstract base class for contributions to ForceFields
00017   class ForceFieldContrib {
00018   public:
00019     ForceFieldContrib() : dp_forceField(0) {};
00020     virtual ~ForceFieldContrib() {};
00021 
00022     //! returns our contribution to the energy of a position
00023     virtual double getEnergy(double *pos) const = 0;
00024 
00025     //! calculates our contribution to the gradients of a position
00026     virtual void getGrad(double *pos,double *grad) const = 0;
00027     
00028   protected:
00029     ForceField *dp_forceField;  //!< our owning ForceField
00030   };
00031 
00032 }
00033 
00034 #endif