MELDOpenMMPlugin
meldKernels.h
1 /*
2  Copyright 2015 by Justin MacCallum, Alberto Perez, Ken Dill
3  All rights reserved
4 */
5 
6 #ifndef MELD_OPENMM_KERNELS_H_
7 #define MELD_OPENMM_KERNELS_H_
8 
9 #include "MeldForce.h"
10 #include "RdcForce.h"
11 #include "openmm/KernelImpl.h"
12 #include "openmm/System.h"
13 #include "openmm/Platform.h"
14 
15 #include <set>
16 #include <string>
17 #include <vector>
18 
19 namespace MeldPlugin {
20 
21 
22 class CalcMeldForceKernel : public OpenMM::KernelImpl {
23 
24 public:
25  static std::string Name() {
26  return "CalcMeldForce";
27  }
28 
29  CalcMeldForceKernel(std::string name, const OpenMM::Platform& platform) : OpenMM::KernelImpl(name, platform) {
30  }
31 
38  virtual void initialize(const OpenMM::System& system, const MeldForce& force) = 0;
39 
48  virtual double execute(OpenMM::ContextImpl& context, bool includeForces, bool includeEnergy) = 0;
49 
50  virtual void copyParametersToContext(OpenMM::ContextImpl& context, const MeldForce& force) = 0;
51 };
52 
53 class CalcRdcForceKernel : public OpenMM::KernelImpl {
54 
55 public:
56  static std::string Name() {
57  return "CalcRdcForce";
58  }
59 
60  CalcRdcForceKernel(std::string name, const OpenMM::Platform& platform) : OpenMM::KernelImpl(name, platform) {
61  }
62 
69  virtual void initialize(const OpenMM::System& system, const RdcForce& force) = 0;
70 
79  virtual double execute(OpenMM::ContextImpl& context, bool includeForces, bool includeEnergy) = 0;
80 
81  virtual void copyParametersToContext(OpenMM::ContextImpl& context, const RdcForce& force) = 0;
82 };
83 
84 } // namespace MeldPlugin
85 
86 #endif /*MELD_OPENMM_KERNELS_H*/
virtual double execute(OpenMM::ContextImpl &context, bool includeForces, bool includeEnergy)=0
Execute the kernel to calculate the forces and/or energy.
virtual void initialize(const OpenMM::System &system, const RdcForce &force)=0
Initialize the kernel.
static std::string Name()
Definition: meldKernels.h:56
static std::string Name()
Definition: meldKernels.h:25
virtual void copyParametersToContext(OpenMM::ContextImpl &context, const MeldForce &force)=0
Definition: MeldForceImpl.h:17
Definition: meldKernels.h:53
CalcMeldForceKernel(std::string name, const OpenMM::Platform &platform)
Definition: meldKernels.h:29
This is the MELD Force.
Definition: MeldForce.h:21
virtual double execute(OpenMM::ContextImpl &context, bool includeForces, bool includeEnergy)=0
Execute the kernel to calculate the forces and/or energy.
CalcRdcForceKernel(std::string name, const OpenMM::Platform &platform)
Definition: meldKernels.h:60
virtual void initialize(const OpenMM::System &system, const MeldForce &force)=0
Initialize the kernel.
virtual void copyParametersToContext(OpenMM::ContextImpl &context, const RdcForce &force)=0
Definition: meldKernels.h:22
This is the RDC Force.
Definition: RdcForce.h:21
Definition: MeldForceProxy.h:12