Commit 3c100e69 authored by Peter Eastman's avatar Peter Eastman
Browse files

Renamed GBSAOBCForceField to GBSAOBCForce.

parent 1b2ebaf0
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "AndersenThermostat.h" #include "AndersenThermostat.h"
#include "BrownianIntegrator.h" #include "BrownianIntegrator.h"
#include "CMMotionRemover.h" #include "CMMotionRemover.h"
#include "GBSAOBCForceField.h" #include "GBSAOBCForce.h"
#include "HarmonicAngleForce.h" #include "HarmonicAngleForce.h"
#include "HarmonicBondForce.h" #include "HarmonicBondForce.h"
#include "KernelImpl.h" #include "KernelImpl.h"
...@@ -221,22 +221,22 @@ public: ...@@ -221,22 +221,22 @@ public:
}; };
/** /**
* This kernel is invoked by GBSAOBCForceField to calculate the forces acting on the system and the energy of the system. * This kernel is invoked by GBSAOBCForce to calculate the forces acting on the system and the energy of the system.
*/ */
class CalcGBSAOBCForceFieldKernel : public KernelImpl { class CalcGBSAOBCForceKernel : public KernelImpl {
public: public:
static std::string Name() { static std::string Name() {
return "CalcGBSAOBCForces"; return "CalcGBSAOBCForces";
} }
CalcGBSAOBCForceFieldKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) { CalcGBSAOBCForceKernel(std::string name, const Platform& platform) : KernelImpl(name, platform) {
} }
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the GBSAOBCForceField this kernel will be used for * @param force the GBSAOBCForce this kernel will be used for
*/ */
virtual void initialize(const System& system, const GBSAOBCForceField& force) = 0; virtual void initialize(const System& system, const GBSAOBCForce& force) = 0;
/** /**
* Execute the kernel to calculate the forces. * Execute the kernel to calculate the forces.
* *
...@@ -247,7 +247,7 @@ public: ...@@ -247,7 +247,7 @@ public:
* Execute the kernel to calculate the energy. * Execute the kernel to calculate the energy.
* *
* @param context the context in which to execute this kernel * @param context the context in which to execute this kernel
* @return the potential energy due to the GBSAOBCForceField * @return the potential energy due to the GBSAOBCForce
*/ */
virtual double executeEnergy(OpenMMContextImpl& context) = 0; virtual double executeEnergy(OpenMMContextImpl& context) = 0;
}; };
......
...@@ -42,14 +42,14 @@ namespace OpenMM { ...@@ -42,14 +42,14 @@ namespace OpenMM {
* This class implements an implicit solvation force using the GBSA-OBC model. * This class implements an implicit solvation force using the GBSA-OBC model.
*/ */
class OPENMM_EXPORT GBSAOBCForceField : public Force { class OPENMM_EXPORT GBSAOBCForce : public Force {
public: public:
/* /*
* Create a GBSAOBCForceField. * Create a GBSAOBCForce.
* *
* @param numParticles the number of particles in the system * @param numParticles the number of particles in the system
*/ */
GBSAOBCForceField(int numParticles); GBSAOBCForce(int numParticles);
/** /**
* Get the number of particles in the system. * Get the number of particles in the system.
*/ */
...@@ -120,7 +120,7 @@ private: ...@@ -120,7 +120,7 @@ private:
}; };
class GBSAOBCForceField::ParticleInfo { class GBSAOBCForce::ParticleInfo {
public: public:
double charge, radius, scalingFactor; double charge, radius, scalingFactor;
ParticleInfo() { ParticleInfo() {
......
...@@ -33,21 +33,21 @@ ...@@ -33,21 +33,21 @@
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "ForceImpl.h" #include "ForceImpl.h"
#include "GBSAOBCForceField.h" #include "GBSAOBCForce.h"
#include "Kernel.h" #include "Kernel.h"
#include <string> #include <string>
namespace OpenMM { namespace OpenMM {
/** /**
* This is the internal implementation of GBSAOBCForceField. * This is the internal implementation of GBSAOBCForce.
*/ */
class GBSAOBCForceFieldImpl : public ForceImpl { class GBSAOBCForceImpl : public ForceImpl {
public: public:
GBSAOBCForceFieldImpl(GBSAOBCForceField& owner); GBSAOBCForceImpl(GBSAOBCForce& owner);
void initialize(OpenMMContextImpl& context); void initialize(OpenMMContextImpl& context);
GBSAOBCForceField& getOwner() { GBSAOBCForce& getOwner() {
return owner; return owner;
} }
void updateContextState(OpenMMContextImpl& context) { void updateContextState(OpenMMContextImpl& context) {
...@@ -60,7 +60,7 @@ public: ...@@ -60,7 +60,7 @@ public:
} }
std::vector<std::string> getKernelNames(); std::vector<std::string> getKernelNames();
private: private:
GBSAOBCForceField& owner; GBSAOBCForce& owner;
Kernel kernel; Kernel kernel;
}; };
......
...@@ -31,26 +31,26 @@ ...@@ -31,26 +31,26 @@
#include "Force.h" #include "Force.h"
#include "OpenMMException.h" #include "OpenMMException.h"
#include "GBSAOBCForceField.h" #include "GBSAOBCForce.h"
#include "internal/GBSAOBCForceFieldImpl.h" #include "internal/GBSAOBCForceImpl.h"
using namespace OpenMM; using namespace OpenMM;
GBSAOBCForceField::GBSAOBCForceField(int numParticles) : particles(numParticles), solventDielectric(78.3), soluteDielectric(1.0) { GBSAOBCForce::GBSAOBCForce(int numParticles) : particles(numParticles), solventDielectric(78.3), soluteDielectric(1.0) {
} }
void GBSAOBCForceField::getParticleParameters(int index, double& charge, double& radius, double& scalingFactor) const { void GBSAOBCForce::getParticleParameters(int index, double& charge, double& radius, double& scalingFactor) const {
charge = particles[index].charge; charge = particles[index].charge;
radius = particles[index].radius; radius = particles[index].radius;
scalingFactor = particles[index].scalingFactor; scalingFactor = particles[index].scalingFactor;
} }
void GBSAOBCForceField::setParticleParameters(int index, double charge, double radius, double scalingFactor) { void GBSAOBCForce::setParticleParameters(int index, double charge, double radius, double scalingFactor) {
particles[index].charge = charge; particles[index].charge = charge;
particles[index].radius = radius; particles[index].radius = radius;
particles[index].scalingFactor = scalingFactor; particles[index].scalingFactor = scalingFactor;
} }
ForceImpl* GBSAOBCForceField::createImpl() { ForceImpl* GBSAOBCForce::createImpl() {
return new GBSAOBCForceFieldImpl(*this); return new GBSAOBCForceImpl(*this);
} }
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. * * USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
#include "internal/GBSAOBCForceFieldImpl.h" #include "internal/GBSAOBCForceImpl.h"
#include "internal/OpenMMContextImpl.h" #include "internal/OpenMMContextImpl.h"
#include "kernels.h" #include "kernels.h"
#include <vector> #include <vector>
...@@ -37,24 +37,24 @@ ...@@ -37,24 +37,24 @@
using namespace OpenMM; using namespace OpenMM;
using std::vector; using std::vector;
GBSAOBCForceFieldImpl::GBSAOBCForceFieldImpl(GBSAOBCForceField& owner) : owner(owner) { GBSAOBCForceImpl::GBSAOBCForceImpl(GBSAOBCForce& owner) : owner(owner) {
} }
void GBSAOBCForceFieldImpl::initialize(OpenMMContextImpl& context) { void GBSAOBCForceImpl::initialize(OpenMMContextImpl& context) {
kernel = context.getPlatform().createKernel(CalcGBSAOBCForceFieldKernel::Name(), context); kernel = context.getPlatform().createKernel(CalcGBSAOBCForceKernel::Name(), context);
dynamic_cast<CalcGBSAOBCForceFieldKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner); dynamic_cast<CalcGBSAOBCForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
} }
void GBSAOBCForceFieldImpl::calcForces(OpenMMContextImpl& context, Stream& forces) { void GBSAOBCForceImpl::calcForces(OpenMMContextImpl& context, Stream& forces) {
dynamic_cast<CalcGBSAOBCForceFieldKernel&>(kernel.getImpl()).executeForces(context); dynamic_cast<CalcGBSAOBCForceKernel&>(kernel.getImpl()).executeForces(context);
} }
double GBSAOBCForceFieldImpl::calcEnergy(OpenMMContextImpl& context) { double GBSAOBCForceImpl::calcEnergy(OpenMMContextImpl& context) {
return dynamic_cast<CalcGBSAOBCForceFieldKernel&>(kernel.getImpl()).executeEnergy(context); return dynamic_cast<CalcGBSAOBCForceKernel&>(kernel.getImpl()).executeEnergy(context);
} }
std::vector<std::string> GBSAOBCForceFieldImpl::getKernelNames() { std::vector<std::string> GBSAOBCForceImpl::getKernelNames() {
std::vector<std::string> names; std::vector<std::string> names;
names.push_back(CalcGBSAOBCForceFieldKernel::Name()); names.push_back(CalcGBSAOBCForceKernel::Name());
return names; return names;
} }
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <sstream> #include <sstream>
#include "BrookStreamImpl.h" #include "BrookStreamImpl.h"
#include "BrookCalcGBSAOBCForceFieldKernel.h" #include "BrookCalcGBSAOBCForceKernel.h"
#include "gpu/kgbsa.h" #include "gpu/kgbsa.h"
#include "gpu/kforce.h" #include "gpu/kforce.h"
#include "math.h" #include "math.h"
...@@ -44,19 +44,19 @@ using namespace OpenMM; ...@@ -44,19 +44,19 @@ using namespace OpenMM;
using namespace std; using namespace std;
/** /**
* BrookCalcGBSAOBCForceFieldKernel constructor * BrookCalcGBSAOBCForceKernel constructor
* *
* @param name kernel name * @param name kernel name
* @param platform platform * @param platform platform
* *
*/ */
BrookCalcGBSAOBCForceFieldKernel::BrookCalcGBSAOBCForceFieldKernel( std::string name, const Platform& platform ) : BrookCalcGBSAOBCForceKernel::BrookCalcGBSAOBCForceKernel( std::string name, const Platform& platform ) :
CalcGBSAOBCForceFieldKernel( name, platform ){ CalcGBSAOBCForceKernel( name, platform ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// static const std::string methodName = "BrookCalcGBSAOBCForceFieldKernel::BrookCalcGBSAOBCForceFieldKernel"; // static const std::string methodName = "BrookCalcGBSAOBCForceKernel::BrookCalcGBSAOBCForceKernel";
// static const int debug = 1; // static const int debug = 1;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -73,15 +73,15 @@ BrookCalcGBSAOBCForceFieldKernel::BrookCalcGBSAOBCForceFieldKernel( std::string ...@@ -73,15 +73,15 @@ BrookCalcGBSAOBCForceFieldKernel::BrookCalcGBSAOBCForceFieldKernel( std::string
} }
/** /**
* BrookCalcGBSAOBCForceFieldKernel destructor * BrookCalcGBSAOBCForceKernel destructor
* *
*/ */
BrookCalcGBSAOBCForceFieldKernel::~BrookCalcGBSAOBCForceFieldKernel( ){ BrookCalcGBSAOBCForceKernel::~BrookCalcGBSAOBCForceKernel( ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
// static const std::string methodName = "BrookCalcGBSAOBCForceFieldKernel::BrookCalcGBSAOBCForceFieldKernel"; // static const std::string methodName = "BrookCalcGBSAOBCForceKernel::BrookCalcGBSAOBCForceKernel";
// static const int debug = 1; // static const int debug = 1;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -96,7 +96,7 @@ BrookCalcGBSAOBCForceFieldKernel::~BrookCalcGBSAOBCForceFieldKernel( ){ ...@@ -96,7 +96,7 @@ BrookCalcGBSAOBCForceFieldKernel::~BrookCalcGBSAOBCForceFieldKernel( ){
* *
*/ */
FILE* BrookCalcGBSAOBCForceFieldKernel::getLog( void ) const { FILE* BrookCalcGBSAOBCForceKernel::getLog( void ) const {
return _log; return _log;
} }
...@@ -109,7 +109,7 @@ FILE* BrookCalcGBSAOBCForceFieldKernel::getLog( void ) const { ...@@ -109,7 +109,7 @@ FILE* BrookCalcGBSAOBCForceFieldKernel::getLog( void ) const {
* *
*/ */
int BrookCalcGBSAOBCForceFieldKernel::setLog( FILE* log ){ int BrookCalcGBSAOBCForceKernel::setLog( FILE* log ){
_log = log; _log = log;
return BrookCommon::DefaultReturnValue; return BrookCommon::DefaultReturnValue;
} }
...@@ -123,12 +123,12 @@ int BrookCalcGBSAOBCForceFieldKernel::setLog( FILE* log ){ ...@@ -123,12 +123,12 @@ int BrookCalcGBSAOBCForceFieldKernel::setLog( FILE* log ){
* *
*/ */
void BrookCalcGBSAOBCForceFieldKernel::initialize( const std::vector<std::vector<double> >& atomParameters, void BrookCalcGBSAOBCForceKernel::initialize( const std::vector<std::vector<double> >& atomParameters,
double solventDielectric, double soluteDielectric ){ double solventDielectric, double soluteDielectric ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookCalcGBSAOBCForceFieldKernel::initialize"; static const std::string methodName = "BrookCalcGBSAOBCForceKernel::initialize";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -165,11 +165,11 @@ void BrookCalcGBSAOBCForceFieldKernel::initialize( const std::vector<std::vector ...@@ -165,11 +165,11 @@ void BrookCalcGBSAOBCForceFieldKernel::initialize( const std::vector<std::vector
* *
*/ */
void BrookCalcGBSAOBCForceFieldKernel::executeForces( const Stream& positions, Stream& forces ){ void BrookCalcGBSAOBCForceKernel::executeForces( const Stream& positions, Stream& forces ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
static const std::string methodName = "BrookCalcGBSAOBCForceFieldKernel::executeForces"; static const std::string methodName = "BrookCalcGBSAOBCForceKernel::executeForces";
static const int PrintOn = 0; static const int PrintOn = 0;
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
...@@ -419,11 +419,11 @@ void BrookCalcGBSAOBCForceFieldKernel::executeForces( const Stream& positions, S ...@@ -419,11 +419,11 @@ void BrookCalcGBSAOBCForceFieldKernel::executeForces( const Stream& positions, S
* *
*/ */
double BrookCalcGBSAOBCForceFieldKernel::executeEnergy( const Stream& positions ){ double BrookCalcGBSAOBCForceKernel::executeEnergy( const Stream& positions ){
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
//static const std::string methodName = "BrookCalcGBSAOBCForceFieldKernel::executeEnergy"; //static const std::string methodName = "BrookCalcGBSAOBCForceKernel::executeEnergy";
// --------------------------------------------------------------------------------------- // ---------------------------------------------------------------------------------------
......
...@@ -41,21 +41,21 @@ namespace OpenMM { ...@@ -41,21 +41,21 @@ namespace OpenMM {
/** /**
* This kernel is invoked by NonbondedForce to calculate the forces acting on the system. * This kernel is invoked by NonbondedForce to calculate the forces acting on the system.
*/ */
class BrookCalcGBSAOBCForceFieldKernel : public CalcGBSAOBCForceFieldKernel { class BrookCalcGBSAOBCForceKernel : public CalcGBSAOBCForceKernel {
public: public:
/** /**
* BrookCalcGBSAOBCForceFieldKernel constructor * BrookCalcGBSAOBCForceKernel constructor
*/ */
BrookCalcGBSAOBCForceFieldKernel( std::string name, const Platform& platform ); BrookCalcGBSAOBCForceKernel( std::string name, const Platform& platform );
/** /**
* BrookCalcGBSAOBCForceFieldKernel destructor * BrookCalcGBSAOBCForceKernel destructor
*/ */
~BrookCalcGBSAOBCForceFieldKernel(); ~BrookCalcGBSAOBCForceKernel();
/** /**
* Initialize the kernel, setting up the values of all the force field parameters. * Initialize the kernel, setting up the values of all the force field parameters.
......
...@@ -44,7 +44,7 @@ namespace OpenMM { ...@@ -44,7 +44,7 @@ namespace OpenMM {
/** /**
* *
* Used by BrookCalcGBSAOBCForceFieldKernel kernel to execute OBC algorithm on GPU * Used by BrookCalcGBSAOBCForceKernel kernel to execute OBC algorithm on GPU
* *
*/ */
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "BrookIntegrateVerletStepKernel.h" #include "BrookIntegrateVerletStepKernel.h"
#include "BrookIntegrateBrownianStepKernel.h" #include "BrookIntegrateBrownianStepKernel.h"
#include "BrookCalcKineticEnergyKernel.h" #include "BrookCalcKineticEnergyKernel.h"
#include "BrookCalcGBSAOBCForceFieldKernel.h" #include "BrookCalcGBSAOBCForceKernel.h"
#include "BrookRemoveCMMotionKernel.h" #include "BrookRemoveCMMotionKernel.h"
using namespace OpenMM; using namespace OpenMM;
...@@ -56,9 +56,9 @@ KernelImpl* BrookKernelFactory::createKernelImpl( std::string name, const Platfo ...@@ -56,9 +56,9 @@ KernelImpl* BrookKernelFactory::createKernelImpl( std::string name, const Platfo
// GBSA OBC // GBSA OBC
} else if( name == CalcGBSAOBCForceFieldKernel::Name() ){ } else if( name == CalcGBSAOBCForceKernel::Name() ){
return new BrookCalcGBSAOBCForceFieldKernel(name, platform); return new BrookCalcGBSAOBCForceKernel(name, platform);
// Verlet integrator // Verlet integrator
......
...@@ -154,7 +154,7 @@ void BrookPlatform::_initializeKernelFactory( void ){ ...@@ -154,7 +154,7 @@ void BrookPlatform::_initializeKernelFactory( void ){
BrookKernelFactory* factory = new BrookKernelFactory(); BrookKernelFactory* factory = new BrookKernelFactory();
registerKernelFactory( CalcNonbondedForceKernel::Name(), factory); registerKernelFactory( CalcNonbondedForceKernel::Name(), factory);
registerKernelFactory( CalcGBSAOBCForceFieldKernel::Name(), factory); registerKernelFactory( CalcGBSAOBCForceKernel::Name(), factory);
registerKernelFactory( IntegrateVerletStepKernel::Name(), factory); registerKernelFactory( IntegrateVerletStepKernel::Name(), factory);
registerKernelFactory( IntegrateLangevinStepKernel::Name(), factory); registerKernelFactory( IntegrateLangevinStepKernel::Name(), factory);
registerKernelFactory( IntegrateBrownianStepKernel::Name(), factory); registerKernelFactory( IntegrateBrownianStepKernel::Name(), factory);
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#include "OpenMMContext.h" #include "OpenMMContext.h"
#include "CMMotionRemover.h" #include "CMMotionRemover.h"
#include "NonbondedForce.h" #include "NonbondedForce.h"
#include "GBSAOBCForceField.h" #include "GBSAOBCForce.h"
#include "System.h" #include "System.h"
#include "LangevinIntegrator.h" #include "LangevinIntegrator.h"
#include "VerletIntegrator.h" #include "VerletIntegrator.h"
...@@ -1589,7 +1589,7 @@ static OpenMMContext* testObcForceSetup( int numAtoms, int brookContext ){ ...@@ -1589,7 +1589,7 @@ static OpenMMContext* testObcForceSetup( int numAtoms, int brookContext ){
System* system = new System( numAtoms, 0 ); System* system = new System( numAtoms, 0 );
LangevinIntegrator* integrator = new LangevinIntegrator(0, 0.1, 0.01); LangevinIntegrator* integrator = new LangevinIntegrator(0, 0.1, 0.01);
GBSAOBCForceField* forceField = new GBSAOBCForceField(numAtoms); GBSAOBCForce* forceField = new GBSAOBCForce(numAtoms);
for (int i = 0; i < numAtoms; ++i){ for (int i = 0; i < numAtoms; ++i){
// charge radius scalingFactor // charge radius scalingFactor
...@@ -1715,7 +1715,7 @@ static OpenMMContext* testObcForceFileSetup( std::string fileName, int brookCont ...@@ -1715,7 +1715,7 @@ static OpenMMContext* testObcForceFileSetup( std::string fileName, int brookCont
lineCount++; lineCount++;
System* system = new System( *numAtoms, 0 ); System* system = new System( *numAtoms, 0 );
GBSAOBCForceField* forceField = new GBSAOBCForceField(numberOfAtoms); GBSAOBCForce* forceField = new GBSAOBCForce(numberOfAtoms);
vector<Vec3> positions(numberOfAtoms); vector<Vec3> positions(numberOfAtoms);
int index = 0; int index = 0;
...@@ -1855,7 +1855,7 @@ void testObcSingleAtom() { ...@@ -1855,7 +1855,7 @@ void testObcSingleAtom() {
System system(1, 0); System system(1, 0);
system.setAtomMass(0, 2.0); system.setAtomMass(0, 2.0);
LangevinIntegrator integrator(0, 0.1, 0.01); LangevinIntegrator integrator(0, 0.1, 0.01);
GBSAOBCForceField* forceField = new GBSAOBCForceField(1); GBSAOBCForce* forceField = new GBSAOBCForce(1);
forceField->setAtomParameters(0, 0.5, 0.15, 1); forceField->setAtomParameters(0, 0.5, 0.15, 1);
system.addForce(forceField); system.addForce(forceField);
OpenMMContext context(system, integrator, platform); OpenMMContext context(system, integrator, platform);
...@@ -1888,7 +1888,7 @@ void testObcEConsistentForce() { ...@@ -1888,7 +1888,7 @@ void testObcEConsistentForce() {
const int numAtoms = 10; const int numAtoms = 10;
System system(numAtoms, 0); System system(numAtoms, 0);
LangevinIntegrator integrator(0, 0.1, 0.01); LangevinIntegrator integrator(0, 0.1, 0.01);
GBSAOBCForceField* forceField = new GBSAOBCForceField(numAtoms); GBSAOBCForce* forceField = new GBSAOBCForce(numAtoms);
for (int i = 0; i < numAtoms; ++i) for (int i = 0; i < numAtoms; ++i)
forceField->setAtomParameters(i, i%2 == 0 ? -1 : 1, 0.15, 1); forceField->setAtomParameters(i, i%2 == 0 ? -1 : 1, 0.15, 1);
system.addForce(forceField); system.addForce(forceField);
......
...@@ -47,8 +47,8 @@ KernelImpl* CudaKernelFactory::createKernelImpl(std::string name, const Platform ...@@ -47,8 +47,8 @@ KernelImpl* CudaKernelFactory::createKernelImpl(std::string name, const Platform
return new CudaCalcRBTorsionForceKernel(name, platform, data, context.getSystem()); return new CudaCalcRBTorsionForceKernel(name, platform, data, context.getSystem());
if (name == CalcNonbondedForceKernel::Name()) if (name == CalcNonbondedForceKernel::Name())
return new CudaCalcNonbondedForceKernel(name, platform, data, context.getSystem()); return new CudaCalcNonbondedForceKernel(name, platform, data, context.getSystem());
if (name == CalcGBSAOBCForceFieldKernel::Name()) if (name == CalcGBSAOBCForceKernel::Name())
return new CudaCalcGBSAOBCForceFieldKernel(name, platform, data); return new CudaCalcGBSAOBCForceKernel(name, platform, data);
if (name == IntegrateVerletStepKernel::Name()) if (name == IntegrateVerletStepKernel::Name())
return new CudaIntegrateVerletStepKernel(name, platform, data); return new CudaIntegrateVerletStepKernel(name, platform, data);
if (name == IntegrateLangevinStepKernel::Name()) if (name == IntegrateLangevinStepKernel::Name())
......
...@@ -288,10 +288,10 @@ double CudaCalcNonbondedForceKernel::executeEnergy(OpenMMContextImpl& context) { ...@@ -288,10 +288,10 @@ double CudaCalcNonbondedForceKernel::executeEnergy(OpenMMContextImpl& context) {
return 0.0; return 0.0;
} }
CudaCalcGBSAOBCForceFieldKernel::~CudaCalcGBSAOBCForceFieldKernel() { CudaCalcGBSAOBCForceKernel::~CudaCalcGBSAOBCForceKernel() {
} }
void CudaCalcGBSAOBCForceFieldKernel::initialize(const System& system, const GBSAOBCForceField& force) { void CudaCalcGBSAOBCForceKernel::initialize(const System& system, const GBSAOBCForce& force) {
int numParticles = system.getNumParticles(); int numParticles = system.getNumParticles();
_gpuContext* gpu = data.gpu; _gpuContext* gpu = data.gpu;
vector<int> particle(numParticles); vector<int> particle(numParticles);
...@@ -308,7 +308,7 @@ void CudaCalcGBSAOBCForceFieldKernel::initialize(const System& system, const GBS ...@@ -308,7 +308,7 @@ void CudaCalcGBSAOBCForceFieldKernel::initialize(const System& system, const GBS
data.useOBC = true; data.useOBC = true;
} }
void CudaCalcGBSAOBCForceFieldKernel::executeForces(OpenMMContextImpl& context) { void CudaCalcGBSAOBCForceKernel::executeForces(OpenMMContextImpl& context) {
} }
static void initializeIntegration(const System& system, CudaPlatform::PlatformData& data) { static void initializeIntegration(const System& system, CudaPlatform::PlatformData& data) {
...@@ -371,7 +371,7 @@ static void initializeIntegration(const System& system, CudaPlatform::PlatformDa ...@@ -371,7 +371,7 @@ static void initializeIntegration(const System& system, CudaPlatform::PlatformDa
cudaThreadSynchronize(); cudaThreadSynchronize();
} }
double CudaCalcGBSAOBCForceFieldKernel::executeEnergy(OpenMMContextImpl& context) { double CudaCalcGBSAOBCForceKernel::executeEnergy(OpenMMContextImpl& context) {
} }
CudaIntegrateVerletStepKernel::~CudaIntegrateVerletStepKernel() { CudaIntegrateVerletStepKernel::~CudaIntegrateVerletStepKernel() {
......
...@@ -220,20 +220,20 @@ private: ...@@ -220,20 +220,20 @@ private:
}; };
/** /**
* This kernel is invoked by GBSAOBCForceField to calculate the forces acting on the system. * This kernel is invoked by GBSAOBCForce to calculate the forces acting on the system.
*/ */
class CudaCalcGBSAOBCForceFieldKernel : public CalcGBSAOBCForceFieldKernel { class CudaCalcGBSAOBCForceKernel : public CalcGBSAOBCForceKernel {
public: public:
CudaCalcGBSAOBCForceFieldKernel(std::string name, const Platform& platform, CudaPlatform::PlatformData& data) : CalcGBSAOBCForceFieldKernel(name, platform), data(data) { CudaCalcGBSAOBCForceKernel(std::string name, const Platform& platform, CudaPlatform::PlatformData& data) : CalcGBSAOBCForceKernel(name, platform), data(data) {
} }
~CudaCalcGBSAOBCForceFieldKernel(); ~CudaCalcGBSAOBCForceKernel();
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the GBSAOBCForceField this kernel will be used for * @param force the GBSAOBCForce this kernel will be used for
*/ */
void initialize(const System& system, const GBSAOBCForceField& force); void initialize(const System& system, const GBSAOBCForce& force);
/** /**
* Execute the kernel to calculate the forces. * Execute the kernel to calculate the forces.
* *
...@@ -244,7 +244,7 @@ public: ...@@ -244,7 +244,7 @@ public:
* Execute the kernel to calculate the energy. * Execute the kernel to calculate the energy.
* *
* @param context the context in which to execute this kernel * @param context the context in which to execute this kernel
* @return the potential energy due to the GBSAOBCForceField * @return the potential energy due to the GBSAOBCForce
*/ */
double executeEnergy(OpenMMContextImpl& context); double executeEnergy(OpenMMContextImpl& context);
private: private:
......
...@@ -45,7 +45,7 @@ CudaPlatform::CudaPlatform() { ...@@ -45,7 +45,7 @@ CudaPlatform::CudaPlatform() {
registerKernelFactory(CalcPeriodicTorsionForceKernel::Name(), factory); registerKernelFactory(CalcPeriodicTorsionForceKernel::Name(), factory);
registerKernelFactory(CalcRBTorsionForceKernel::Name(), factory); registerKernelFactory(CalcRBTorsionForceKernel::Name(), factory);
registerKernelFactory(CalcNonbondedForceKernel::Name(), factory); registerKernelFactory(CalcNonbondedForceKernel::Name(), factory);
registerKernelFactory(CalcGBSAOBCForceFieldKernel::Name(), factory); registerKernelFactory(CalcGBSAOBCForceKernel::Name(), factory);
registerKernelFactory(IntegrateVerletStepKernel::Name(), factory); registerKernelFactory(IntegrateVerletStepKernel::Name(), factory);
registerKernelFactory(IntegrateLangevinStepKernel::Name(), factory); registerKernelFactory(IntegrateLangevinStepKernel::Name(), factory);
registerKernelFactory(IntegrateBrownianStepKernel::Name(), factory); registerKernelFactory(IntegrateBrownianStepKernel::Name(), factory);
......
...@@ -30,13 +30,13 @@ ...@@ -30,13 +30,13 @@
* -------------------------------------------------------------------------- */ * -------------------------------------------------------------------------- */
/** /**
* This tests the Cuda implementation of GBSAOBCForceField. * This tests the Cuda implementation of GBSAOBCForce.
*/ */
#include "../../../tests/AssertionUtilities.h" #include "../../../tests/AssertionUtilities.h"
#include "OpenMMContext.h" #include "OpenMMContext.h"
#include "CudaPlatform.h" #include "CudaPlatform.h"
#include "GBSAOBCForceField.h" #include "GBSAOBCForce.h"
#include "System.h" #include "System.h"
#include "LangevinIntegrator.h" #include "LangevinIntegrator.h"
#include "../src/SimTKUtilities/SimTKOpenMMRealType.h" #include "../src/SimTKUtilities/SimTKOpenMMRealType.h"
...@@ -55,7 +55,7 @@ void testSingleParticle() { ...@@ -55,7 +55,7 @@ void testSingleParticle() {
System system(1, 0); System system(1, 0);
system.setParticleMass(0, 2.0); system.setParticleMass(0, 2.0);
LangevinIntegrator integrator(0, 0.1, 0.01); LangevinIntegrator integrator(0, 0.1, 0.01);
GBSAOBCForceField* forceField = new GBSAOBCForceField(1); GBSAOBCForce* forceField = new GBSAOBCForce(1);
NonbondedForce* standard = new NonbondedForce(1, 0); NonbondedForce* standard = new NonbondedForce(1, 0);
forceField->setParticleParameters(0, 0.5, 0.15, 1); forceField->setParticleParameters(0, 0.5, 0.15, 1);
standard->setParticleParameters(0, 0.5, 1, 0); standard->setParticleParameters(0, 0.5, 1, 0);
...@@ -79,7 +79,7 @@ void testForce() { ...@@ -79,7 +79,7 @@ void testForce() {
const int numParticles = 10; const int numParticles = 10;
System system(numParticles, 0); System system(numParticles, 0);
LangevinIntegrator integrator(0, 0.1, 0.01); LangevinIntegrator integrator(0, 0.1, 0.01);
GBSAOBCForceField* forceField = new GBSAOBCForceField(numParticles); GBSAOBCForce* forceField = new GBSAOBCForce(numParticles);
NonbondedForce* standard = new NonbondedForce(numParticles, 0); NonbondedForce* standard = new NonbondedForce(numParticles, 0);
for (int i = 0; i < numParticles; ++i) { for (int i = 0; i < numParticles; ++i) {
double charge = i%2 == 0 ? -1 : 1; double charge = i%2 == 0 ? -1 : 1;
......
...@@ -48,8 +48,8 @@ KernelImpl* ReferenceKernelFactory::createKernelImpl(std::string name, const Pla ...@@ -48,8 +48,8 @@ KernelImpl* ReferenceKernelFactory::createKernelImpl(std::string name, const Pla
return new ReferenceCalcPeriodicTorsionForceKernel(name, platform); return new ReferenceCalcPeriodicTorsionForceKernel(name, platform);
else if (name == CalcRBTorsionForceKernel::Name()) else if (name == CalcRBTorsionForceKernel::Name())
return new ReferenceCalcRBTorsionForceKernel(name, platform); return new ReferenceCalcRBTorsionForceKernel(name, platform);
else if (name == CalcGBSAOBCForceFieldKernel::Name()) else if (name == CalcGBSAOBCForceKernel::Name())
return new ReferenceCalcGBSAOBCForceFieldKernel(name, platform); return new ReferenceCalcGBSAOBCForceKernel(name, platform);
else if (name == IntegrateVerletStepKernel::Name()) else if (name == IntegrateVerletStepKernel::Name())
return new ReferenceIntegrateVerletStepKernel(name, platform); return new ReferenceIntegrateVerletStepKernel(name, platform);
else if (name == IntegrateLangevinStepKernel::Name()) else if (name == IntegrateLangevinStepKernel::Name())
......
...@@ -387,14 +387,14 @@ double ReferenceCalcNonbondedForceKernel::executeEnergy(OpenMMContextImpl& conte ...@@ -387,14 +387,14 @@ double ReferenceCalcNonbondedForceKernel::executeEnergy(OpenMMContextImpl& conte
return energy; return energy;
} }
ReferenceCalcGBSAOBCForceFieldKernel::~ReferenceCalcGBSAOBCForceFieldKernel() { ReferenceCalcGBSAOBCForceKernel::~ReferenceCalcGBSAOBCForceKernel() {
if (obc) { if (obc) {
// delete obc->getObcParameters(); // delete obc->getObcParameters();
delete obc; delete obc;
} }
} }
void ReferenceCalcGBSAOBCForceFieldKernel::initialize(const System& system, const GBSAOBCForceField& force) { void ReferenceCalcGBSAOBCForceKernel::initialize(const System& system, const GBSAOBCForce& force) {
int numParticles = system.getNumParticles(); int numParticles = system.getNumParticles();
charges.resize(numParticles); charges.resize(numParticles);
vector<RealOpenMM> atomicRadii(numParticles); vector<RealOpenMM> atomicRadii(numParticles);
...@@ -415,13 +415,13 @@ void ReferenceCalcGBSAOBCForceFieldKernel::initialize(const System& system, cons ...@@ -415,13 +415,13 @@ void ReferenceCalcGBSAOBCForceFieldKernel::initialize(const System& system, cons
obc->setIncludeAceApproximation(true); obc->setIncludeAceApproximation(true);
} }
void ReferenceCalcGBSAOBCForceFieldKernel::executeForces(OpenMMContextImpl& context) { void ReferenceCalcGBSAOBCForceKernel::executeForces(OpenMMContextImpl& context) {
RealOpenMM** posData = const_cast<RealOpenMM**>(((ReferenceFloatStreamImpl&) context.getPositions().getImpl()).getData()); // Reference code needs to be made const correct RealOpenMM** posData = const_cast<RealOpenMM**>(((ReferenceFloatStreamImpl&) context.getPositions().getImpl()).getData()); // Reference code needs to be made const correct
RealOpenMM** forceData = ((ReferenceFloatStreamImpl&) context.getForces().getImpl()).getData(); RealOpenMM** forceData = ((ReferenceFloatStreamImpl&) context.getForces().getImpl()).getData();
obc->computeImplicitSolventForces(posData, &charges[0], forceData, 0); obc->computeImplicitSolventForces(posData, &charges[0], forceData, 0);
} }
double ReferenceCalcGBSAOBCForceFieldKernel::executeEnergy(OpenMMContextImpl& context) { double ReferenceCalcGBSAOBCForceKernel::executeEnergy(OpenMMContextImpl& context) {
RealOpenMM** posData = const_cast<RealOpenMM**>(((ReferenceFloatStreamImpl&) context.getPositions().getImpl()).getData()); // Reference code needs to be made const correct RealOpenMM** posData = const_cast<RealOpenMM**>(((ReferenceFloatStreamImpl&) context.getPositions().getImpl()).getData()); // Reference code needs to be made const correct
RealOpenMM** forceData = allocateRealArray(context.getSystem().getNumParticles(), 3); RealOpenMM** forceData = allocateRealArray(context.getSystem().getNumParticles(), 3);
obc->computeImplicitSolventForces(posData, &charges[0], forceData, 1); obc->computeImplicitSolventForces(posData, &charges[0], forceData, 1);
......
...@@ -223,20 +223,20 @@ private: ...@@ -223,20 +223,20 @@ private:
}; };
/** /**
* This kernel is invoked by GBSAOBCForceField to calculate the forces acting on the system. * This kernel is invoked by GBSAOBCForce to calculate the forces acting on the system.
*/ */
class ReferenceCalcGBSAOBCForceFieldKernel : public CalcGBSAOBCForceFieldKernel { class ReferenceCalcGBSAOBCForceKernel : public CalcGBSAOBCForceKernel {
public: public:
ReferenceCalcGBSAOBCForceFieldKernel(std::string name, const Platform& platform) : CalcGBSAOBCForceFieldKernel(name, platform) { ReferenceCalcGBSAOBCForceKernel(std::string name, const Platform& platform) : CalcGBSAOBCForceKernel(name, platform) {
} }
~ReferenceCalcGBSAOBCForceFieldKernel(); ~ReferenceCalcGBSAOBCForceKernel();
/** /**
* Initialize the kernel. * Initialize the kernel.
* *
* @param system the System this kernel will be applied to * @param system the System this kernel will be applied to
* @param force the GBSAOBCForceField this kernel will be used for * @param force the GBSAOBCForce this kernel will be used for
*/ */
void initialize(const System& system, const GBSAOBCForceField& force); void initialize(const System& system, const GBSAOBCForce& force);
/** /**
* Execute the kernel to calculate the forces. * Execute the kernel to calculate the forces.
* *
...@@ -247,7 +247,7 @@ public: ...@@ -247,7 +247,7 @@ public:
* Execute the kernel to calculate the energy. * Execute the kernel to calculate the energy.
* *
* @param context the context in which to execute this kernel * @param context the context in which to execute this kernel
* @return the potential energy due to the GBSAOBCForceField * @return the potential energy due to the GBSAOBCForce
*/ */
double executeEnergy(OpenMMContextImpl& context); double executeEnergy(OpenMMContextImpl& context);
private: private:
......
...@@ -43,7 +43,7 @@ ReferencePlatform::ReferencePlatform() { ...@@ -43,7 +43,7 @@ ReferencePlatform::ReferencePlatform() {
registerKernelFactory(CalcPeriodicTorsionForceKernel::Name(), factory); registerKernelFactory(CalcPeriodicTorsionForceKernel::Name(), factory);
registerKernelFactory(CalcRBTorsionForceKernel::Name(), factory); registerKernelFactory(CalcRBTorsionForceKernel::Name(), factory);
registerKernelFactory(CalcNonbondedForceKernel::Name(), factory); registerKernelFactory(CalcNonbondedForceKernel::Name(), factory);
registerKernelFactory(CalcGBSAOBCForceFieldKernel::Name(), factory); registerKernelFactory(CalcGBSAOBCForceKernel::Name(), factory);
registerKernelFactory(IntegrateVerletStepKernel::Name(), factory); registerKernelFactory(IntegrateVerletStepKernel::Name(), factory);
registerKernelFactory(IntegrateLangevinStepKernel::Name(), factory); registerKernelFactory(IntegrateLangevinStepKernel::Name(), factory);
registerKernelFactory(IntegrateBrownianStepKernel::Name(), factory); registerKernelFactory(IntegrateBrownianStepKernel::Name(), factory);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment