Commit a711ce2a authored by Peter Eastman's avatar Peter Eastman
Browse files

Refactored ForceImpl, lots of KernelImpl subclasses, and other related classes...

Refactored ForceImpl, lots of KernelImpl subclasses, and other related classes to avoid redundant calculations when requesting a State with both forces and energies
parent 767ea1bd
......@@ -56,8 +56,7 @@ public:
void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly.
}
void calcForces(ContextImpl& context );
double calcEnergy(ContextImpl& context);
double calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy);
std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters.
}
......
......@@ -57,8 +57,7 @@ public:
void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly.
}
void calcForces(ContextImpl& context );
double calcEnergy(ContextImpl& context);
double calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy);
std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters.
}
......
......@@ -55,8 +55,7 @@ public:
void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly.
}
void calcForces(ContextImpl& context );
double calcEnergy(ContextImpl& context);
double calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy);
std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters.
}
......
......@@ -56,8 +56,7 @@ public:
void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly.
}
void calcForces(ContextImpl& context );
double calcEnergy(ContextImpl& context);
double calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy);
std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters.
}
......
......@@ -56,8 +56,7 @@ public:
void updateContextState(ContextImpl& context) {
// This force field doesn't update the state directly.
}
void calcForces(ContextImpl& context );
double calcEnergy(ContextImpl& context);
double calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy);
std::map<std::string, double> getDefaultParameters() {
return std::map<std::string, double>(); // This force field doesn't define any parameters.
}
......
......@@ -46,12 +46,8 @@ void AmoebaGeneralizedKirkwoodForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaGeneralizedKirkwoodForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaGeneralizedKirkwoodForceImpl::calcForces(ContextImpl& context) {
dynamic_cast<CalcAmoebaGeneralizedKirkwoodForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaGeneralizedKirkwoodForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaGeneralizedKirkwoodForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaGeneralizedKirkwoodForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaGeneralizedKirkwoodForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaGeneralizedKirkwoodForceImpl::getKernelNames() {
......
......@@ -50,12 +50,8 @@ void AmoebaHarmonicAngleForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaHarmonicAngleForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaHarmonicAngleForceImpl::calcForces(ContextImpl& context ) {
dynamic_cast<CalcAmoebaHarmonicAngleForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaHarmonicAngleForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaHarmonicAngleForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaHarmonicAngleForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaHarmonicAngleForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaHarmonicAngleForceImpl::getKernelNames() {
......
......@@ -51,12 +51,8 @@ void AmoebaHarmonicBondForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaHarmonicBondForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaHarmonicBondForceImpl::calcForces(ContextImpl& context ) {
dynamic_cast<CalcAmoebaHarmonicBondForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaHarmonicBondForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaHarmonicBondForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaHarmonicBondForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaHarmonicBondForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaHarmonicBondForceImpl::getKernelNames() {
......
......@@ -50,12 +50,8 @@ void AmoebaHarmonicInPlaneAngleForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaHarmonicInPlaneAngleForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaHarmonicInPlaneAngleForceImpl::calcForces(ContextImpl& context ) {
dynamic_cast<CalcAmoebaHarmonicInPlaneAngleForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaHarmonicInPlaneAngleForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaHarmonicInPlaneAngleForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaHarmonicInPlaneAngleForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaHarmonicInPlaneAngleForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaHarmonicInPlaneAngleForceImpl::getKernelNames() {
......
......@@ -48,12 +48,8 @@ void AmoebaMultipoleForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaMultipoleForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaMultipoleForceImpl::calcForces(ContextImpl& context ) {
dynamic_cast<CalcAmoebaMultipoleForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaMultipoleForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaMultipoleForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaMultipoleForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaMultipoleForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaMultipoleForceImpl::getKernelNames() {
......
......@@ -50,12 +50,8 @@ void AmoebaOutOfPlaneBendForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaOutOfPlaneBendForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaOutOfPlaneBendForceImpl::calcForces(ContextImpl& context ) {
dynamic_cast<CalcAmoebaOutOfPlaneBendForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaOutOfPlaneBendForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaOutOfPlaneBendForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaOutOfPlaneBendForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaOutOfPlaneBendForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaOutOfPlaneBendForceImpl::getKernelNames() {
......
......@@ -50,12 +50,8 @@ void AmoebaPiTorsionForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaPiTorsionForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaPiTorsionForceImpl::calcForces(ContextImpl& context ) {
dynamic_cast<CalcAmoebaPiTorsionForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaPiTorsionForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaPiTorsionForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaPiTorsionForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaPiTorsionForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaPiTorsionForceImpl::getKernelNames() {
......
......@@ -46,12 +46,8 @@ void AmoebaSASAForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaSASAForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaSASAForceImpl::calcForces(ContextImpl& context) {
dynamic_cast<CalcAmoebaSASAForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaSASAForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaSASAForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaSASAForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaSASAForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaSASAForceImpl::getKernelNames() {
......
......@@ -50,12 +50,8 @@ void AmoebaStretchBendForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaStretchBendForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaStretchBendForceImpl::calcForces(ContextImpl& context ) {
dynamic_cast<CalcAmoebaStretchBendForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaStretchBendForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaStretchBendForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaStretchBendForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaStretchBendForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaStretchBendForceImpl::getKernelNames() {
......
......@@ -50,12 +50,8 @@ void AmoebaTorsionForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaTorsionForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaTorsionForceImpl::calcForces(ContextImpl& context ) {
dynamic_cast<CalcAmoebaTorsionForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaTorsionForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaTorsionForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaTorsionForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaTorsionForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaTorsionForceImpl::getKernelNames() {
......
......@@ -50,12 +50,8 @@ void AmoebaTorsionTorsionForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaTorsionTorsionForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaTorsionTorsionForceImpl::calcForces(ContextImpl& context ) {
dynamic_cast<CalcAmoebaTorsionTorsionForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaTorsionTorsionForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaTorsionTorsionForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaTorsionTorsionForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaTorsionTorsionForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaTorsionTorsionForceImpl::getKernelNames() {
......
......@@ -50,12 +50,8 @@ void AmoebaVdwForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaVdwForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaVdwForceImpl::calcForces(ContextImpl& context ) {
dynamic_cast<CalcAmoebaVdwForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaVdwForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaVdwForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaVdwForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaVdwForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaVdwForceImpl::getKernelNames() {
......
......@@ -50,12 +50,8 @@ void AmoebaWcaDispersionForceImpl::initialize(ContextImpl& context) {
dynamic_cast<CalcAmoebaWcaDispersionForceKernel&>(kernel.getImpl()).initialize(context.getSystem(), owner);
}
void AmoebaWcaDispersionForceImpl::calcForces(ContextImpl& context ) {
dynamic_cast<CalcAmoebaWcaDispersionForceKernel&>(kernel.getImpl()).executeForces(context);
}
double AmoebaWcaDispersionForceImpl::calcEnergy(ContextImpl& context) {
return dynamic_cast<CalcAmoebaWcaDispersionForceKernel&>(kernel.getImpl()).executeEnergy(context);
double AmoebaWcaDispersionForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy) {
return dynamic_cast<CalcAmoebaWcaDispersionForceKernel&>(kernel.getImpl()).execute(context, includeForces, includeEnergy);
}
std::vector<std::string> AmoebaWcaDispersionForceImpl::getKernelNames() {
......
......@@ -90,13 +90,7 @@ void CudaCalcAmoebaHarmonicBondForceKernel::initialize(const System& system, con
static_cast<float>(force.getAmoebaGlobalHarmonicBondQuartic()) );
}
void CudaCalcAmoebaHarmonicBondForceKernel::executeForces(ContextImpl& context) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
}
double CudaCalcAmoebaHarmonicBondForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaHarmonicBondForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
......@@ -137,13 +131,7 @@ void CudaCalcAmoebaHarmonicAngleForceKernel::initialize(const System& system, co
}
void CudaCalcAmoebaHarmonicAngleForceKernel::executeForces(ContextImpl& context) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
}
double CudaCalcAmoebaHarmonicAngleForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaHarmonicAngleForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
......@@ -187,13 +175,7 @@ void CudaCalcAmoebaHarmonicInPlaneAngleForceKernel::initialize(const System& sys
}
void CudaCalcAmoebaHarmonicInPlaneAngleForceKernel::executeForces(ContextImpl& context) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
}
double CudaCalcAmoebaHarmonicInPlaneAngleForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaHarmonicInPlaneAngleForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
......@@ -246,13 +228,7 @@ void CudaCalcAmoebaTorsionForceKernel::initialize(const System& system, const Am
}
void CudaCalcAmoebaTorsionForceKernel::executeForces(ContextImpl& context) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
}
double CudaCalcAmoebaTorsionForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaTorsionForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
......@@ -292,13 +268,7 @@ void CudaCalcAmoebaPiTorsionForceKernel::initialize(const System& system, const
gpuSetAmoebaPiTorsionParameters(data.getAmoebaGpu(), particle1, particle2, particle3, particle4, particle5, particle6, torsionKParameters);
}
void CudaCalcAmoebaPiTorsionForceKernel::executeForces(ContextImpl& context) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
}
double CudaCalcAmoebaPiTorsionForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaPiTorsionForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
......@@ -341,13 +311,7 @@ void CudaCalcAmoebaStretchBendForceKernel::initialize(const System& system, cons
}
void CudaCalcAmoebaStretchBendForceKernel::executeForces(ContextImpl& context) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
}
double CudaCalcAmoebaStretchBendForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaStretchBendForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
......@@ -388,13 +352,7 @@ void CudaCalcAmoebaOutOfPlaneBendForceKernel::initialize(const System& system, c
}
void CudaCalcAmoebaOutOfPlaneBendForceKernel::executeForces(ContextImpl& context) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
}
double CudaCalcAmoebaOutOfPlaneBendForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaOutOfPlaneBendForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
......@@ -460,13 +418,7 @@ void CudaCalcAmoebaTorsionTorsionForceKernel::initialize(const System& system, c
}
void CudaCalcAmoebaTorsionTorsionForceKernel::executeForces(ContextImpl& context) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
}
double CudaCalcAmoebaTorsionTorsionForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaTorsionTorsionForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
if( data.getAmoebaLocalForcesKernel() == this ){
computeAmoebaLocalForces( data );
}
......@@ -632,11 +584,7 @@ void CudaCalcAmoebaMultipoleForceKernel::initialize(const System& system, const
}
void CudaCalcAmoebaMultipoleForceKernel::executeForces(ContextImpl& context) {
computeAmoebaMultipoleForce( data );
}
double CudaCalcAmoebaMultipoleForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaMultipoleForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
computeAmoebaMultipoleForce( data );
return 0.0;
}
......@@ -679,11 +627,7 @@ void CudaCalcAmoebaGeneralizedKirkwoodForceKernel::initialize(const System& syst
static_cast<float>( force.getSurfaceAreaFactor() ) );
}
void CudaCalcAmoebaGeneralizedKirkwoodForceKernel::executeForces(ContextImpl& context) {
// handled in computeAmoebaMultipoleForce()
}
double CudaCalcAmoebaGeneralizedKirkwoodForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaGeneralizedKirkwoodForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
// handled in computeAmoebaMultipoleForce()
return 0.0;
}
......@@ -721,10 +665,7 @@ fflush( stderr );
*/
}
void CudaCalcAmoebaSASAForceKernel::executeForces(ContextImpl& context) {
}
double CudaCalcAmoebaSASAForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaSASAForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
return 0.0;
}
......@@ -783,11 +724,7 @@ void CudaCalcAmoebaVdwForceKernel::initialize(const System& system, const Amoeba
allExclusions );
}
void CudaCalcAmoebaVdwForceKernel::executeForces(ContextImpl& context) {
computeAmoebaVdwForce( data );
}
double CudaCalcAmoebaVdwForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaVdwForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
computeAmoebaVdwForce( data );
return 0.0;
}
......@@ -845,11 +782,7 @@ void CudaCalcAmoebaWcaDispersionForceKernel::initialize(const System& system, co
static_cast<float>( force.getDispoff( ) ) );
}
void CudaCalcAmoebaWcaDispersionForceKernel::executeForces(ContextImpl& context) {
computeAmoebaWcaDispersionForce( data );
}
double CudaCalcAmoebaWcaDispersionForceKernel::executeEnergy(ContextImpl& context) {
double CudaCalcAmoebaWcaDispersionForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
computeAmoebaWcaDispersionForce( data );
return 0.0;
}
......@@ -51,18 +51,14 @@ public:
*/
void initialize(const System& system, const AmoebaHarmonicBondForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaHarmonicBondForce
*/
double executeEnergy(ContextImpl& context);
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
int numBonds;
AmoebaCudaData& data;
......@@ -84,18 +80,14 @@ public:
*/
void initialize(const System& system, const AmoebaHarmonicAngleForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaHarmonicAngleForce
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
double executeEnergy(ContextImpl& context);
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
int numAngles;
AmoebaCudaData& data;
......@@ -117,18 +109,14 @@ public:
*/
void initialize(const System& system, const AmoebaHarmonicInPlaneAngleForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaHarmonicInPlaneAngleForce
*/
double executeEnergy(ContextImpl& context);
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
int numAngles;
AmoebaCudaData& data;
......@@ -150,18 +138,14 @@ public:
*/
void initialize(const System& system, const AmoebaTorsionForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaTorsionForce
*/
double executeEnergy(ContextImpl& context);
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
int numTorsions;
AmoebaCudaData& data;
......@@ -183,18 +167,14 @@ public:
*/
void initialize(const System& system, const AmoebaPiTorsionForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaPiTorsionForce
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
double executeEnergy(ContextImpl& context);
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
int numPiTorsions;
AmoebaCudaData& data;
......@@ -216,18 +196,14 @@ public:
*/
void initialize(const System& system, const AmoebaStretchBendForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaStretchBendForce
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
double executeEnergy(ContextImpl& context);
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
int numStretchBends;
AmoebaCudaData& data;
......@@ -249,18 +225,14 @@ public:
*/
void initialize(const System& system, const AmoebaOutOfPlaneBendForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaOutOfPlaneBendForce
*/
double executeEnergy(ContextImpl& context);
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
int numOutOfPlaneBends;
AmoebaCudaData& data;
......@@ -282,18 +254,14 @@ public:
*/
void initialize(const System& system, const AmoebaTorsionTorsionForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaTorsionTorsionForce
*/
double executeEnergy(ContextImpl& context);
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
int numTorsionTorsions;
int numTorsionTorsionGrids;
......@@ -316,18 +284,14 @@ public:
*/
void initialize(const System& system, const AmoebaMultipoleForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaMultipoleForce
*/
double executeEnergy(ContextImpl& context);
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
int numMultipoles;
AmoebaCudaData& data;
......@@ -349,18 +313,14 @@ public:
*/
void initialize(const System& system, const AmoebaGeneralizedKirkwoodForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaMultipoleForce
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
double executeEnergy(ContextImpl& context);
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
AmoebaCudaData& data;
System& system;
......@@ -381,18 +341,14 @@ public:
*/
void initialize(const System& system, const AmoebaSASAForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaMultipoleForce
*/
double executeEnergy(ContextImpl& context);
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
AmoebaCudaData& data;
System& system;
......@@ -413,18 +369,14 @@ public:
*/
void initialize(const System& system, const AmoebaVdwForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaMultipoleForce
*/
double executeEnergy(ContextImpl& context);
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
AmoebaCudaData& data;
System& system;
......@@ -445,18 +397,14 @@ public:
*/
void initialize(const System& system, const AmoebaWcaDispersionForce& force);
/**
* Execute the kernel to calculate the forces.
*
* @param context the context in which to execute this kernel
*/
void executeForces(ContextImpl& context);
/**
* Execute the kernel to calculate the energy.
*
* @param context the context in which to execute this kernel
* @return the potential energy due to the AmoebaMultipoleForce
* Execute the kernel to calculate the forces and/or energy.
*
* @param context the context in which to execute this kernel
* @param includeForces true if forces should be calculated
* @param includeEnergy true if the energy should be calculated
* @return the potential energy due to the force
*/
double executeEnergy(ContextImpl& context);
double execute(ContextImpl& context, bool includeForces, bool includeEnergy);
private:
AmoebaCudaData& data;
System& system;
......
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