Commit 2a530882 authored by Peter Eastman's avatar Peter Eastman
Browse files

Continuing to implement ReferencePlatform (kernels for StandardMMForceField are done).

parent 012b28e6
...@@ -136,43 +136,28 @@ void verify14(const vector<vector<int> >& bonded14Indices) { ...@@ -136,43 +136,28 @@ void verify14(const vector<vector<int> >& bonded14Indices) {
* to the initialize() methods. * to the initialize() methods.
*/ */
class DummyForceKernel : public CalcStandardMMForcesKernel { class DummyForceKernel : public CalcStandardMMForceFieldKernel {
public: public:
DummyForceKernel(string name) : CalcStandardMMForcesKernel(name) { DummyForceKernel(string name, const Platform& platform) : CalcStandardMMForceFieldKernel(name, platform) {
} }
void initialize(const vector<vector<int> >& bondIndices, const vector<vector<double> >& bondParameters, void initialize(const vector<vector<int> >& bondIndices, const vector<vector<double> >& bondParameters,
const vector<vector<int> >& angleIndices, const vector<vector<double> >& angleParameters, const vector<vector<int> >& angleIndices, const vector<vector<double> >& angleParameters,
const vector<vector<int> >& periodicTorsionIndices, const vector<vector<double> >& periodicTorsionParameters, const vector<vector<int> >& periodicTorsionIndices, const vector<vector<double> >& periodicTorsionParameters,
const vector<vector<int> >& rbTorsionIndices, const vector<vector<double> >& rbTorsionParameters, const vector<vector<int> >& rbTorsionIndices, const vector<vector<double> >& rbTorsionParameters,
const vector<vector<int> >& bonded14Indices, const vector<set<int> >& exclusions, const vector<vector<int> >& bonded14Indices, double lj14Scale, double coulomb14Scale,
const vector<vector<double> >& nonbondedParameters) { const vector<set<int> >& exclusions, const vector<vector<double> >& nonbondedParameters) {
verifyExclusions(exclusions); verifyExclusions(exclusions);
verify14(bonded14Indices); verify14(bonded14Indices);
} }
void execute(const Stream& positions, Stream& forces) { void executeForces(const Stream& positions, Stream& forces) {
} }
}; double executeEnergy(const Stream& positions) {
class DummyEnergyKernel : public CalcStandardMMEnergyKernel {
public:
DummyEnergyKernel(string name) : CalcStandardMMEnergyKernel(name) {
}
void initialize(const vector<vector<int> >& bondIndices, const vector<vector<double> >& bondParameters,
const vector<vector<int> >& angleIndices, const vector<vector<double> >& angleParameters,
const vector<vector<int> >& periodicTorsionIndices, const vector<vector<double> >& periodicTorsionParameters,
const vector<vector<int> >& rbTorsionIndices, const vector<vector<double> >& rbTorsionParameters,
const vector<vector<int> >& bonded14Indices, const vector<set<int> >& exclusions,
const vector<vector<double> >& nonbondedParameters) {
verifyExclusions(exclusions);
verify14(bonded14Indices);
}
double execute(const Stream& positions) {
} }
}; };
class DummyIntegratorKernel : public IntegrateVerletStepKernel { class DummyIntegratorKernel : public IntegrateVerletStepKernel {
public: public:
DummyIntegratorKernel(string name) : IntegrateVerletStepKernel(name) { DummyIntegratorKernel(string name, const Platform& platform) : IntegrateVerletStepKernel(name, platform) {
} }
void initialize(const vector<double>& masses, const vector<vector<int> >& constraintIndices, const vector<double>& constraintLengths) { void initialize(const vector<double>& masses, const vector<vector<int> >& constraintIndices, const vector<double>& constraintLengths) {
} }
...@@ -182,7 +167,7 @@ public: ...@@ -182,7 +167,7 @@ public:
class DummyKEKernel : public CalcKineticEnergyKernel { class DummyKEKernel : public CalcKineticEnergyKernel {
public: public:
DummyKEKernel(string name) : CalcKineticEnergyKernel(name) { DummyKEKernel(string name, const Platform& platform) : CalcKineticEnergyKernel(name, platform) {
} }
void initialize(const vector<double>& masses) { void initialize(const vector<double>& masses) {
} }
...@@ -192,7 +177,7 @@ public: ...@@ -192,7 +177,7 @@ public:
class DummyStreamImpl : public StreamImpl { class DummyStreamImpl : public StreamImpl {
public: public:
DummyStreamImpl(string name, int size, Stream::DataType type) : StreamImpl(name, size, type) { DummyStreamImpl(string name, int size, Stream::DataType type, const Platform& platform) : StreamImpl(name, size, type, platform) {
} }
void loadFromArray(const void* array) { void loadFromArray(const void* array) {
} }
...@@ -204,31 +189,28 @@ public: ...@@ -204,31 +189,28 @@ public:
class DummyKernelFactory : public KernelFactory { class DummyKernelFactory : public KernelFactory {
public: public:
KernelImpl* createKernelImpl(string name) const { KernelImpl* createKernelImpl(string name, const Platform& platform) const {
if (name == CalcStandardMMForcesKernel::Name()) if (name == CalcStandardMMForceFieldKernel::Name())
return new DummyForceKernel(name); return new DummyForceKernel(name, platform);
if (name == CalcStandardMMEnergyKernel::Name())
return new DummyEnergyKernel(name);
if (name == IntegrateVerletStepKernel::Name()) if (name == IntegrateVerletStepKernel::Name())
return new DummyIntegratorKernel(name); return new DummyIntegratorKernel(name, platform);
if (name == CalcKineticEnergyKernel::Name()) if (name == CalcKineticEnergyKernel::Name())
return new DummyKEKernel(name); return new DummyKEKernel(name, platform);
return 0; return 0;
} }
}; };
class DummyStreamFactory : public StreamFactory { class DummyStreamFactory : public StreamFactory {
public: public:
StreamImpl* createStreamImpl(string name, int size, Stream::DataType type) const { StreamImpl* createStreamImpl(string name, int size, Stream::DataType type, const Platform& platform) const {
return new DummyStreamImpl(name, size, type); return new DummyStreamImpl(name, size, type, platform);
} }
}; };
class DummyPlatform : public Platform { class DummyPlatform : public Platform {
public: public:
DummyPlatform() { DummyPlatform() {
registerKernelFactory(CalcStandardMMForcesKernel::Name(), new DummyKernelFactory()); registerKernelFactory(CalcStandardMMForceFieldKernel::Name(), new DummyKernelFactory());
registerKernelFactory(CalcStandardMMEnergyKernel::Name(), new DummyKernelFactory());
registerKernelFactory(IntegrateVerletStepKernel::Name(), new DummyKernelFactory()); registerKernelFactory(IntegrateVerletStepKernel::Name(), new DummyKernelFactory());
registerKernelFactory(CalcKineticEnergyKernel::Name(), new DummyKernelFactory()); registerKernelFactory(CalcKineticEnergyKernel::Name(), new DummyKernelFactory());
} }
......
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