BrookCalcKineticEnergyKernel.h 3.61 KB
Newer Older
Mark Friedrichs's avatar
Mark Friedrichs committed
1
2
#ifndef OPENMM_BROOK_CALC_KINETIC_ENERGY_KERNEL_H_
#define OPENMM_BROOK_CALC_KINETIC_ENERGY_KERNEL_H_
Mark Friedrichs's avatar
Mark Friedrichs committed
3
4
5
6
7
8
9
10
11

/* -------------------------------------------------------------------------- *
 *                                   OpenMM                                   *
 * -------------------------------------------------------------------------- *
 * This is part of the OpenMM molecular simulation toolkit originating from   *
 * Simbios, the NIH National Center for Physics-Based Simulation of           *
 * Biological Structures at Stanford, funded under the NIH Roadmap for        *
 * Medical Research, grant U54 GM072970. See https://simtk.org.               *
 *                                                                            *
12
13
 * Portions copyright (c) 2009 Stanford University and the Authors.           *
 * Authors: Mark Friedrichs, Mike Houston                                     *
Mark Friedrichs's avatar
Mark Friedrichs committed
14
15
 * Contributors:                                                              *
 *                                                                            *
16
17
18
19
 * This program is free software: you can redistribute it and/or modify       *
 * it under the terms of the GNU Lesser General Public License as published   *
 * by the Free Software Foundation, either version 3 of the License, or       *
 * (at your option) any later version.                                        *
Mark Friedrichs's avatar
Mark Friedrichs committed
20
 *                                                                            *
21
22
23
24
 * This program is distributed in the hope that it will be useful,            *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
 * GNU Lesser General Public License for more details.                        *
Mark Friedrichs's avatar
Mark Friedrichs committed
25
 *                                                                            *
26
27
 * You should have received a copy of the GNU Lesser General Public License   *
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.      *
Mark Friedrichs's avatar
Mark Friedrichs committed
28
29
 * -------------------------------------------------------------------------- */

30
#include "openmm/kernels.h"
Mark Friedrichs's avatar
Mark Friedrichs committed
31
#include "BrookFloatStreamInternal.h"
Mark Friedrichs's avatar
Mods  
Mark Friedrichs committed
32
#include "OpenMMBrookInterface.h"
Mark Friedrichs's avatar
Mark Friedrichs committed
33

Mark Friedrichs's avatar
Mods  
Mark Friedrichs committed
34
35
#include "BrookVelocityCenterOfMassRemoval.h"

Mark Friedrichs's avatar
Mark Friedrichs committed
36
37
38
namespace OpenMM {

/**
Mark Friedrichs's avatar
Mark Friedrichs committed
39
 * Brook class for calculating kinetic energy
Mark Friedrichs's avatar
Mark Friedrichs committed
40
41
 */

Mark Friedrichs's avatar
Mark Friedrichs committed
42
class BrookCalcKineticEnergyKernel : public CalcKineticEnergyKernel {
43

Mark Friedrichs's avatar
Mark Friedrichs committed
44
   public:
Mark Friedrichs's avatar
Mark Friedrichs committed
45

Mark Friedrichs's avatar
Mark Friedrichs committed
46
47
48
      /**
       * BrookCalcKineticEnergyKernel constructor
       * 
Mark Friedrichs's avatar
Mods  
Mark Friedrichs committed
49
50
51
52
       * @param name                      name of the stream to create
       * @param platform                  platform
       * @param OpenMMBrookInterface      OpenMM-Brook interface
       * @param System                    System reference
Mark Friedrichs's avatar
Mark Friedrichs committed
53
54
       */
  
Mark Friedrichs's avatar
Mods  
Mark Friedrichs committed
55
      BrookCalcKineticEnergyKernel( std::string name, const Platform& platform, OpenMMBrookInterface& openMMBrookInterface, System& system );
56

Mark Friedrichs's avatar
Mark Friedrichs committed
57
58
59
60
61
62
      /**
       * BrookCalcKineticEnergyKernel destructor
       * 
       */
  
      ~BrookCalcKineticEnergyKernel();
Mark Friedrichs's avatar
Mark Friedrichs committed
63

Mark Friedrichs's avatar
Mark Friedrichs committed
64
65
66
      /** 
       * Initialize the kernel
       * 
Mark Friedrichs's avatar
Mods  
Mark Friedrichs committed
67
       * @param system  System reference
Mark Friedrichs's avatar
Mark Friedrichs committed
68
69
       *
       */
Mark Friedrichs's avatar
Mods  
Mark Friedrichs committed
70
      void initialize( const System& system );
Mark Friedrichs's avatar
Mark Friedrichs committed
71

Mark Friedrichs's avatar
Mark Friedrichs committed
72
73
74
      /** 
       * Execute the kernel.
       * 
75
       * @param context ContextImpl reference
Mark Friedrichs's avatar
Mark Friedrichs committed
76
77
78
       *
       */

79
      double execute( ContextImpl& context );
Mark Friedrichs's avatar
Mark Friedrichs committed
80
81

   private:
82

Mark Friedrichs's avatar
Mods  
Mark Friedrichs committed
83
84
      int _numberOfParticles;

Mark Friedrichs's avatar
Mark Friedrichs committed
85
86
87
88
      // masses

      BrookOpenMMFloat* _masses;

Mark Friedrichs's avatar
Mods  
Mark Friedrichs committed
89
90
91
92
93
94
95
96
      // interface

      OpenMMBrookInterface& _openMMBrookInterface;

      // System reference

      System& _system;

Mark Friedrichs's avatar
Mods  
Mark Friedrichs committed
97
BrookVelocityCenterOfMassRemoval* _brookVelocityCenterOfMassRemoval;
Mark Friedrichs's avatar
Mods  
Mark Friedrichs committed
98
99


Mark Friedrichs's avatar
Mark Friedrichs committed
100
101
102
103
};

} // namespace OpenMM

Mark Friedrichs's avatar
Mark Friedrichs committed
104
#endif /* OPENMM_BROOK_CALC_KINETIC_ENERGY_KERNEL_H_ */