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

Continuing refactoring of the reference platform

parent 0843c5f3
......@@ -30,13 +30,8 @@
#include "../SimTKUtilities/SimTKOpenMMLog.h"
#include "../SimTKUtilities/SimTKOpenMMUtilities.h"
// #define UseGromacsMalloc 1
#ifdef UseGromacsMalloc
extern "C" {
#include "smalloc.h"
}
#endif
using std::vector;
using OpenMM::RealVec;
const std::string GBVIParameters::ParameterFileName = std::string( "params.agb" );
......@@ -516,7 +511,7 @@ RealOpenMM GBVIParameters::getCutoffDistance() {
--------------------------------------------------------------------------------------- */
int GBVIParameters::setPeriodic( RealOpenMM* boxSize ) {
int GBVIParameters::setPeriodic( RealVec& boxSize ) {
assert(cutoff);
assert(boxSize[0] >= 2.0*cutoffDistance);
......
......@@ -241,7 +241,7 @@ class GBVIParameters : public ImplicitSolventParameters {
--------------------------------------------------------------------------------------- */
int setPeriodic( RealOpenMM* boxSize );
int setPeriodic( OpenMM::RealVec& boxSize );
/**---------------------------------------------------------------------------------------
......
......@@ -30,13 +30,8 @@
#include "../SimTKUtilities/SimTKOpenMMLog.h"
#include "../SimTKUtilities/SimTKOpenMMUtilities.h"
// #define UseGromacsMalloc 1
#ifdef UseGromacsMalloc
extern "C" {
#include "smalloc.h"
}
#endif
using std::vector;
using OpenMM::RealVec;
const std::string ObcParameters::ParameterFileName = std::string( "params.agb" );
......@@ -619,7 +614,7 @@ RealOpenMM ObcParameters::getCutoffDistance() {
--------------------------------------------------------------------------------------- */
int ObcParameters::setPeriodic( RealOpenMM* boxSize ) {
int ObcParameters::setPeriodic( RealVec& boxSize ) {
assert(cutoff);
assert(boxSize[0] >= 2.0*cutoffDistance);
......
......@@ -321,7 +321,7 @@ class ObcParameters : public ImplicitSolventParameters {
--------------------------------------------------------------------------------------- */
int setPeriodic( RealOpenMM* boxSize );
int setPeriodic( OpenMM::RealVec& boxSize );
/**---------------------------------------------------------------------------------------
......
......@@ -47,17 +47,18 @@ void testNeighborList()
vector<set<int> > exclusions(2);
NeighborList neighborList;
computeNeighborListNaive(neighborList, 2, particleList, exclusions, NULL, 13.7, 0.01);
RealVec boxSize;
computeNeighborListNaive(neighborList, 2, particleList, exclusions, boxSize, false, 13.7, 0.01);
assert(neighborList.size() == 1);
computeNeighborListNaive(neighborList, 2, particleList, exclusions, NULL, 13.5, 0.01);
computeNeighborListNaive(neighborList, 2, particleList, exclusions, boxSize, false, 13.5, 0.01);
assert(neighborList.size() == 0);
computeNeighborListVoxelHash(neighborList, 2, particleList, exclusions, NULL, 13.7, 0.01);
computeNeighborListVoxelHash(neighborList, 2, particleList, exclusions, boxSize, false, 13.7, 0.01);
assert(neighborList.size() == 1);
computeNeighborListVoxelHash(neighborList, 2, particleList, exclusions, NULL, 13.5, 0.01);
computeNeighborListVoxelHash(neighborList, 2, particleList, exclusions, boxSize, false, 13.5, 0.01);
assert(neighborList.size() == 0);
}
......@@ -67,14 +68,14 @@ double periodicDifference(double val1, double val2, double period) {
return diff-base;
}
double distance2(RealVec& pos1, RealVec& pos2, const RealOpenMM* periodicBoxSize) {
double distance2(RealVec& pos1, RealVec& pos2, const RealVec& periodicBoxSize) {
double dx = periodicDifference(pos1[0], pos2[0], periodicBoxSize[0]);
double dy = periodicDifference(pos1[1], pos2[1], periodicBoxSize[1]);
double dz = periodicDifference(pos1[2], pos2[2], periodicBoxSize[2]);
return dx*dx+dy*dy+dz*dz;
}
void verifyNeighborList(NeighborList& list, int numParticles, vector<RealVec>& positions, const RealOpenMM* periodicBoxSize, double cutoff) {
void verifyNeighborList(NeighborList& list, int numParticles, vector<RealVec>& positions, const RealVec& periodicBoxSize, double cutoff) {
for (int i = 0; i < (int) list.size(); i++) {
int particle1 = list[i].first;
int particle2 = list[i].second;
......@@ -91,7 +92,7 @@ void verifyNeighborList(NeighborList& list, int numParticles, vector<RealVec>& p
void testPeriodic() {
const int numParticles = 100;
const double cutoff = 3.0;
const RealOpenMM periodicBoxSize[3] = {20.0, 15.0, 22.0};
const RealVec periodicBoxSize(20.0, 15.0, 22.0);
vector<RealVec> particleList(numParticles);
OpenMM_SFMT::SFMT sfmt;
init_gen_rand(0, sfmt);
......@@ -103,9 +104,9 @@ void testPeriodic() {
}
vector<set<int> > exclusions(numParticles);
NeighborList neighborList;
computeNeighborListNaive(neighborList, numParticles, particleList, exclusions, periodicBoxSize, cutoff);
computeNeighborListNaive(neighborList, numParticles, particleList, exclusions, periodicBoxSize, true, cutoff);
verifyNeighborList(neighborList, numParticles, particleList, periodicBoxSize, cutoff);
computeNeighborListVoxelHash(neighborList, numParticles, particleList, exclusions, periodicBoxSize, cutoff);
computeNeighborListVoxelHash(neighborList, numParticles, particleList, exclusions, periodicBoxSize, true, cutoff);
verifyNeighborList(neighborList, numParticles, particleList, periodicBoxSize, cutoff);
}
......
......@@ -219,7 +219,7 @@ double ReferenceFreeEnergyCalcNonbondedSoftcoreForceKernel::execute(ContextImpl&
bool ewald = (nonbondedMethod == Ewald);
bool pme = (nonbondedMethod == PME);
if (nonbondedMethod != NoCutoff) {
computeNeighborListVoxelHash(*neighborList, numParticles, posData, exclusions, (periodic || ewald || pme) ? periodicBoxSize : NULL, nonbondedCutoff, 0.0);
computeNeighborListVoxelHash(*neighborList, numParticles, posData, exclusions, periodicBoxSize, periodic || ewald || pme, nonbondedCutoff, 0.0);
clj.setUseCutoff(nonbondedCutoff, *neighborList, rfDielectric);
}
if (periodic || ewald || pme)
......@@ -374,7 +374,7 @@ void ReferenceFreeEnergyCalcGBVISoftcoreForceKernel::initialize(const System& sy
double ReferenceFreeEnergyCalcGBVISoftcoreForceKernel::execute(ContextImpl& context, bool includeForces, bool includeEnergy) {
vector<RealVec>& posData = extractPositions(context);
RealOpenMM* bornRadii = new RealOpenMM[context.getSystem().getNumParticles()];
vector<RealOpenMM> bornRadii(context.getSystem().getNumParticles());
gbviSoftcore->computeBornRadii(posData, bornRadii, NULL );
if (includeForces) {
vector<RealVec>& forceData = extractForces(context);
......@@ -382,7 +382,6 @@ double ReferenceFreeEnergyCalcGBVISoftcoreForceKernel::execute(ContextImpl& cont
}
RealOpenMM energy = 0.0;
if (includeEnergy)
energy = gbviSoftcore->computeBornEnergy(bornRadii ,posData, &charges[0]);
delete[] bornRadii;
energy = gbviSoftcore->computeBornEnergy(bornRadii, posData, &charges[0]);
return static_cast<double>(energy);
}
......@@ -69,7 +69,8 @@ private:
int numParticles, num14;
int **exclusionArray, **bonded14IndexArray;
RealOpenMM **particleParamArray, **bonded14ParamArray;
RealOpenMM nonbondedCutoff, periodicBoxSize[3], rfDielectric, ewaldAlpha;
RealOpenMM nonbondedCutoff, rfDielectric, ewaldAlpha;
RealVec periodicBoxSize;
int kmax[3];
std::vector<std::set<int> > exclusions;
NonbondedSoftcoreMethod nonbondedMethod;
......
......@@ -108,7 +108,7 @@ ReferenceFreeEnergyLJCoulombSoftcoreIxn::~ReferenceFreeEnergyLJCoulombSoftcoreIx
--------------------------------------------------------------------------------------- */
int ReferenceFreeEnergyLJCoulombSoftcoreIxn::setPeriodic( RealOpenMM* boxSize ) {
int ReferenceFreeEnergyLJCoulombSoftcoreIxn::setPeriodic( RealVec& boxSize ) {
assert(cutoff);
assert(boxSize[0] >= 2.0*cutoffDistance);
......
......@@ -118,7 +118,7 @@ class ReferenceFreeEnergyLJCoulombSoftcoreIxn : public ReferencePairIxn {
--------------------------------------------------------------------------------------- */
int setPeriodic( RealOpenMM* boxSize );
int setPeriodic( OpenMM::RealVec& boxSize );
/**---------------------------------------------------------------------------------------
......
......@@ -24,6 +24,7 @@
#include <string.h>
#include <sstream>
#include <vector>
#include "../SimTKUtilities/SimTKOpenMMCommon.h"
#include "../SimTKUtilities/SimTKOpenMMLog.h"
......@@ -243,7 +244,7 @@ int CpuGBVISoftcore::quinticSpline( RealOpenMM x, RealOpenMM rl, RealOpenMM ru,
int CpuGBVISoftcore::computeBornRadiiUsingQuinticSpline( RealOpenMM atomicRadius3, RealOpenMM bornSum,
GBVISoftcoreParameters* gbviParameters,
RealOpenMM* bornRadius, RealOpenMM* switchDeriviative ){
RealOpenMM& bornRadius, RealOpenMM* switchDeriviative ){
// ---------------------------------------------------------------------------------------
......@@ -301,7 +302,7 @@ int CpuGBVISoftcore::computeBornRadiiUsingQuinticSpline( RealOpenMM atomicRadius
sum = atomicRadius3 - bornSum;
*switchDeriviative = one;
}
*bornRadius = POW( sum, minusOneThird );
bornRadius = POW( sum, minusOneThird );
return 0;
}
......@@ -322,7 +323,7 @@ int CpuGBVISoftcore::computeBornRadiiUsingQuinticSpline( RealOpenMM atomicRadius
#define GBVISoftcoreDebug 0
int CpuGBVISoftcore::computeBornRadii( vector<RealVec>& atomCoordinates, RealOpenMM* bornRadii, RealOpenMM* switchDeriviative ){
int CpuGBVISoftcore::computeBornRadii( vector<RealVec>& atomCoordinates, vector<RealOpenMM>& bornRadii, RealOpenMM* switchDeriviative ){
// ---------------------------------------------------------------------------------------
......@@ -402,7 +403,7 @@ if( atomI == 0 || atomI == 1 ){
switchDeriviative[atomI] = one;
} else if( _gbviParameters->getBornRadiusScalingSoftcoreMethod() == GBVISoftcoreParameters::QuinticSpline ){
computeBornRadiiUsingQuinticSpline( atomicRadius3, sum, gbviParameters,
bornRadii + atomI, switchDeriviative + atomI );
bornRadii[atomI], switchDeriviative + atomI );
}
#if( GBVISoftcoreDebug == 1 )
......@@ -607,7 +608,7 @@ RealOpenMM CpuGBVISoftcore::Sgb( RealOpenMM t ){
--------------------------------------------------------------------------------------- */
RealOpenMM CpuGBVISoftcore::computeBornEnergy( const RealOpenMM* bornRadii, vector<RealVec>& atomCoordinates,
RealOpenMM CpuGBVISoftcore::computeBornEnergy( const vector<RealOpenMM>& bornRadii, vector<RealVec>& atomCoordinates,
const RealOpenMM* partialCharges ){
// ---------------------------------------------------------------------------------------
......@@ -631,10 +632,6 @@ RealOpenMM CpuGBVISoftcore::computeBornEnergy( const RealOpenMM* bornRadii, vect
const RealOpenMM* atomicRadii = gbviParameters->getAtomicRadii();
const RealOpenMM* gammaParameters = gbviParameters->getGammaParameters();
if( bornRadii == NULL ){
bornRadii = getBornRadii();
}
#if( GBVISoftcoreDebug == 1 )
FILE* logFile = stderr;
(void) fprintf( logFile, "\n%s\n", methodName );
......@@ -723,7 +720,7 @@ RealOpenMM e3 = -partialChargeI2*partialCharges[atomJ]*Sgb( t )/deltaR[Reference
--------------------------------------------------------------------------------------- */
int CpuGBVISoftcore::computeBornForces( const RealOpenMM* bornRadii, vector<RealVec>& atomCoordinates,
int CpuGBVISoftcore::computeBornForces( const vector<RealOpenMM>& bornRadii, vector<RealVec>& atomCoordinates,
const RealOpenMM* partialCharges, vector<RealVec>& inputForces ){
// ---------------------------------------------------------------------------------------
......@@ -753,10 +750,6 @@ int CpuGBVISoftcore::computeBornForces( const RealOpenMM* bornRadii, vector<Real
const RealOpenMM* atomicRadii = gbviParameters->getAtomicRadii();
const RealOpenMM* gammaParameters = gbviParameters->getGammaParameters();
if( bornRadii == NULL ){
bornRadii = getBornRadii();
}
// ---------------------------------------------------------------------------------------
// constants
......@@ -767,8 +760,6 @@ int CpuGBVISoftcore::computeBornForces( const RealOpenMM* bornRadii, vector<Real
// set energy/forces to zero
const unsigned int arraySzInBytes = sizeof( RealOpenMM )*numberOfAtoms;
RealOpenMM** forces = new RealOpenMM*[numberOfAtoms];
RealOpenMM* block = new RealOpenMM[numberOfAtoms*3];
memset( block, 0, sizeof( RealOpenMM )*numberOfAtoms*3 );
......@@ -778,8 +769,8 @@ int CpuGBVISoftcore::computeBornForces( const RealOpenMM* bornRadii, vector<Real
blockPtr += 3;
}
RealOpenMM* bornForces = getBornForce();
memset( bornForces, 0, arraySzInBytes );
vector<RealOpenMM>& bornForces = getBornForce();
bornForces.assign(numberOfAtoms, 0.0);
// ---------------------------------------------------------------------------------------
......
......@@ -115,7 +115,7 @@ class CpuGBVISoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
int computeBornRadii( std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM* bornRadii,
int computeBornRadii( std::vector<OpenMM::RealVec>& atomCoordinates, std::vector<RealOpenMM>& bornRadii,
RealOpenMM* switchDeriviative = NULL );
/**---------------------------------------------------------------------------------------
......@@ -210,7 +210,7 @@ class CpuGBVISoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
RealOpenMM computeBornEnergy( const RealOpenMM* bornRadii, std::vector<OpenMM::RealVec>& atomCoordinates,
RealOpenMM computeBornEnergy( const std::vector<RealOpenMM>& bornRadii, std::vector<OpenMM::RealVec>& atomCoordinates,
const RealOpenMM* partialCharges );
/**---------------------------------------------------------------------------------------
......@@ -226,7 +226,7 @@ class CpuGBVISoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
int computeBornForces( const RealOpenMM* bornRadii, std::vector<OpenMM::RealVec>& atomCoordinates,
int computeBornForces( const std::vector<RealOpenMM>& bornRadii, std::vector<OpenMM::RealVec>& atomCoordinates,
const RealOpenMM* partialCharges, std::vector<OpenMM::RealVec>& inputForces );
/**---------------------------------------------------------------------------------------
......@@ -319,7 +319,7 @@ class CpuGBVISoftcore : public CpuImplicitSolvent {
int computeBornRadiiUsingQuinticSpline( RealOpenMM atomicRadius3, RealOpenMM bornSum,
GBVISoftcoreParameters* gbviParameters,
RealOpenMM* bornRadius, RealOpenMM* switchDeriviative );
RealOpenMM& bornRadius, RealOpenMM* switchDeriviative );
};
......
......@@ -32,6 +32,7 @@
#include "../SimTKReference/ReferenceForce.h"
#include <cmath>
#include <cstdio>
#include <vector>
using std::vector;
using OpenMM::RealVec;
......@@ -71,13 +72,6 @@ CpuObcSoftcore::~CpuObcSoftcore( ){
// static const char* methodName = "\nCpuObcSoftcore::~CpuObcSoftcore";
// ---------------------------------------------------------------------------------------
//if( _obcSoftcoreParameters != NULL ){
// delete _obcSoftcoreParameters;
//}
delete[] _obcChain;
delete[] _obcChainTemp;
}
/**---------------------------------------------------------------------------------------
......@@ -95,8 +89,6 @@ void CpuObcSoftcore::_initializeObcDataMembers( void ){
// ---------------------------------------------------------------------------------------
_obcSoftcoreParameters = NULL;
_obcChain = NULL;
_obcChainTemp = NULL;
}
/**---------------------------------------------------------------------------------------
......@@ -149,7 +141,7 @@ int CpuObcSoftcore::setObcSoftcoreParameters( ObcSoftcoreParameters* obcSoftcor
--------------------------------------------------------------------------------------- */
RealOpenMM* CpuObcSoftcore::getObcChain( void ){
vector<RealOpenMM>& CpuObcSoftcore::getObcChain( void ){
// ---------------------------------------------------------------------------------------
......@@ -157,8 +149,8 @@ RealOpenMM* CpuObcSoftcore::getObcChain( void ){
// ---------------------------------------------------------------------------------------
if( _obcChain == NULL ){
_obcChain = new RealOpenMM[_obcSoftcoreParameters->getNumberOfAtoms()];
if( _obcChain.size() == 0 ){
_obcChain.resize(_obcSoftcoreParameters->getNumberOfAtoms());
}
return _obcChain;
}
......@@ -171,7 +163,7 @@ RealOpenMM* CpuObcSoftcore::getObcChain( void ){
--------------------------------------------------------------------------------------- */
RealOpenMM* CpuObcSoftcore::getObcChainConst( void ) const {
const vector<RealOpenMM>& CpuObcSoftcore::getObcChainConst( void ) const {
// ---------------------------------------------------------------------------------------
......@@ -191,7 +183,7 @@ RealOpenMM* CpuObcSoftcore::getObcChainConst( void ) const {
--------------------------------------------------------------------------------------- */
RealOpenMM* CpuObcSoftcore::getObcChainTemp( void ){
vector<RealOpenMM>& CpuObcSoftcore::getObcChainTemp( void ){
// ---------------------------------------------------------------------------------------
......@@ -199,8 +191,8 @@ RealOpenMM* CpuObcSoftcore::getObcChainTemp( void ){
// ---------------------------------------------------------------------------------------
if( _obcChainTemp == NULL ){
_obcChainTemp = new RealOpenMM[_obcSoftcoreParameters->getNumberOfAtoms()];
if( _obcChainTemp.size() == 0 ){
_obcChainTemp.resize(_obcSoftcoreParameters->getNumberOfAtoms());
}
return _obcChainTemp;
}
......@@ -219,7 +211,7 @@ RealOpenMM* CpuObcSoftcore::getObcChainTemp( void ){
--------------------------------------------------------------------------------------- */
int CpuObcSoftcore::computeBornRadii( vector<RealVec>& atomCoordinates, RealOpenMM* bornRadii, RealOpenMM* obcChain ){
int CpuObcSoftcore::computeBornRadii( vector<RealVec>& atomCoordinates, RealOpenMM* bornRadii ){
// ---------------------------------------------------------------------------------------
......@@ -239,9 +231,7 @@ int CpuObcSoftcore::computeBornRadii( vector<RealVec>& atomCoordinates, RealOpen
int numberOfAtoms = obcSoftcoreParameters->getNumberOfAtoms();
RealOpenMM* atomicRadii = obcSoftcoreParameters->getAtomicRadii();
const RealOpenMM* scaledRadiusFactor = obcSoftcoreParameters->getScaledRadiusFactors();
if( !obcChain ){
obcChain = getObcChain();
}
vector<RealOpenMM>& obcChain = getObcChain();
const RealOpenMM* nonPolarScaleFactors = obcSoftcoreParameters->getNonPolarScaleFactors();
RealOpenMM dielectricOffset = obcSoftcoreParameters->getDielectricOffset();
......@@ -363,8 +353,8 @@ if( logFile ){
--------------------------------------------------------------------------------------- */
int CpuObcSoftcore::computeAceNonPolarForce( const ObcSoftcoreParameters* obcSoftcoreParameters,
const RealOpenMM* bornRadii, RealOpenMM* energy,
RealOpenMM* forces ) const {
const vector<RealOpenMM>& bornRadii, RealOpenMM* energy,
vector<RealOpenMM>& forces ) const {
// ---------------------------------------------------------------------------------------
......@@ -429,7 +419,7 @@ int CpuObcSoftcore::computeAceNonPolarForce( const ObcSoftcoreParameters* obcSof
--------------------------------------------------------------------------------------- */
int CpuObcSoftcore::computeBornEnergyForces( RealOpenMM* bornRadii, vector<RealVec>& atomCoordinates,
int CpuObcSoftcore::computeBornEnergyForces( vector<RealOpenMM>& bornRadii, vector<RealVec>& atomCoordinates,
const RealOpenMM* partialCharges, vector<RealVec>& inputForces ){
// ---------------------------------------------------------------------------------------
......@@ -450,10 +440,6 @@ int CpuObcSoftcore::computeBornEnergyForces( RealOpenMM* bornRadii, vector<RealV
const ObcSoftcoreParameters* obcSoftcoreParameters = getObcSoftcoreParameters();
const int numberOfAtoms = obcSoftcoreParameters->getNumberOfAtoms();
if( bornRadii == NULL ){
bornRadii = getBornRadii();
}
// ---------------------------------------------------------------------------------------
// constants
......@@ -482,7 +468,6 @@ int CpuObcSoftcore::computeBornEnergyForces( RealOpenMM* bornRadii, vector<RealV
// set energy/forces to zero
RealOpenMM obcEnergy = zero;
const unsigned int arraySzInBytes = sizeof( RealOpenMM )*numberOfAtoms;
RealOpenMM** forces = (RealOpenMM**) malloc( sizeof( RealOpenMM* )*numberOfAtoms );
RealOpenMM* block = (RealOpenMM*) malloc( sizeof( RealOpenMM )*numberOfAtoms*3 );
......@@ -493,8 +478,8 @@ int CpuObcSoftcore::computeBornEnergyForces( RealOpenMM* bornRadii, vector<RealV
blockPtr += 3;
}
RealOpenMM* bornForces = getBornForce();
memset( bornForces, 0, arraySzInBytes );
vector<RealOpenMM>& bornForces = getBornForce();
bornForces.assign(numberOfAtoms, 0.0);
// ---------------------------------------------------------------------------------------
......@@ -585,13 +570,13 @@ int CpuObcSoftcore::computeBornEnergyForces( RealOpenMM* bornRadii, vector<RealV
// initialize Born radii & ObcChain temp arrays -- contain values
// used in next iteration
RealOpenMM* bornRadiiTemp = getBornRadiiTemp();
memset( bornRadiiTemp, 0, arraySzInBytes );
vector<RealOpenMM>& bornRadiiTemp = getBornRadiiTemp();
bornRadiiTemp.assign(numberOfAtoms, 0.0);
RealOpenMM* obcChainTemp = getObcChainTemp();
memset( obcChainTemp, 0, arraySzInBytes );
vector<RealOpenMM>& obcChainTemp = getObcChainTemp();
obcChainTemp.assign(numberOfAtoms, 0.0);
RealOpenMM* obcChain = getObcChain();
vector<RealOpenMM>& obcChain = getObcChain();
const RealOpenMM* atomicRadii = obcSoftcoreParameters->getAtomicRadii();
const RealOpenMM alphaObc = obcSoftcoreParameters->getAlphaObc();
......@@ -732,8 +717,8 @@ int CpuObcSoftcore::computeBornEnergyForces( RealOpenMM* bornRadii, vector<RealV
// copy new Born radii and obcChain values into permanent array
memcpy( bornRadii, bornRadiiTemp, arraySzInBytes );
memcpy( obcChain, obcChainTemp, arraySzInBytes );
bornRadii = bornRadiiTemp;
obcChain = obcChainTemp;
free( (char*) block );
free( (char*) forces );
......
......@@ -40,8 +40,8 @@ class CpuObcSoftcore : public CpuImplicitSolvent {
// arrays containing OBC chain derivative
RealOpenMM* _obcChain;
RealOpenMM* _obcChainTemp;
std::vector<RealOpenMM> _obcChain;
std::vector<RealOpenMM> _obcChainTemp;
// initialize data members (more than
// one constructor, so centralize intialization here)
......@@ -101,8 +101,8 @@ class CpuObcSoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
RealOpenMM* getObcChain( void );
RealOpenMM* getObcChainConst( void ) const;
std::vector<RealOpenMM>& getObcChain( void );
const std::vector<RealOpenMM>& getObcChainConst( void ) const;
/**---------------------------------------------------------------------------------------
......@@ -113,7 +113,7 @@ class CpuObcSoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
RealOpenMM* getObcChainTemp( void );
std::vector<RealOpenMM>& getObcChainTemp( void );
/**---------------------------------------------------------------------------------------
......@@ -128,8 +128,7 @@ class CpuObcSoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
int computeBornRadii( std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM* bornRadii,
RealOpenMM* obcChain = NULL );
int computeBornRadii( std::vector<OpenMM::RealVec>& atomCoordinates, RealOpenMM* bornRadii );
/**---------------------------------------------------------------------------------------
......@@ -146,8 +145,8 @@ class CpuObcSoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
int computeAceNonPolarForce( const ObcSoftcoreParameters* obcSoftcoreParameters,
const RealOpenMM* bornRadii, RealOpenMM* energy,
RealOpenMM* forces ) const;
const std::vector<RealOpenMM>& bornRadii, RealOpenMM* energy,
std::vector<RealOpenMM>& forces ) const;
/**---------------------------------------------------------------------------------------
......@@ -162,7 +161,7 @@ class CpuObcSoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
int computeBornEnergyForces( RealOpenMM* bornRadii, std::vector<OpenMM::RealVec>& atomCoordinates,
int computeBornEnergyForces( std::vector<RealOpenMM>& bornRadii, std::vector<OpenMM::RealVec>& atomCoordinates,
const RealOpenMM* partialCharges, std::vector<OpenMM::RealVec>& forces );
};
......
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