RDCode: Contrib.h Source File

# Contrib.h

Go to the documentation of this file.

    00001 //
    00002 //  Copyright (C) 2004-2006 Rational Discovery LLC
    00003 //
    00004 //   @@ All Rights Reserved  @@
    00005 //
    00006 #ifndef __RD_FFCONTRIB_H__
    00007 #define __RD_FFCONTRIB_H__
    00008
    00009 namespace ForceFields {
    00010   class ForceField;
    00011
    00012   //! abstract base class for contributions to ForceFields
    00013   class ForceFieldContrib {
    00014   public:
    00015     ForceFieldContrib() : dp_forceField(0) {};
    00016     virtual ~ForceFieldContrib() {};
    00017
    00018     //! returns our contribution to the energy of a position
    00019     virtual double getEnergy(double *pos) const = 0;
    00020
    00021     //! calculates our contribution to the gradients of a position
    00022     virtual void getGrad(double *pos,double *grad) const = 0;
    00023
    00024   protected:
    00025     ForceField *dp_forceField;  //!< our owning ForceField
    00026   };
    00027
    00028 }
    00029
    00030 #endif