2 Highly Optimized Object-oriented Many-particle Dynamics -- Blue Edition
3 (HOOMD-blue) Open Source Software License Copyright 2009-2014 The Regents of
4 the University of Michigan All rights reserved.
6 HOOMD-blue may contain modifications ("Contributions") provided, and to which
7 copyright is held, by various Contributors who have granted The Regents of the
8 University of Michigan the right to modify and/or distribute such Contributions.
10 You may redistribute, use, and create derivate works of HOOMD-blue, in source
11 and binary forms, provided you abide by the following conditions:
13 * Redistributions of source code must retain the above copyright notice, this
14 list of conditions, and the following disclaimer both in the code and
15 prominently in any materials provided with the distribution.
17 * Redistributions in binary form must reproduce the above copyright notice, this
18 list of conditions, and the following disclaimer in the documentation and/or
19 other materials provided with the distribution.
21 * All publications and presentations based on HOOMD-blue, including any reports
22 or published results obtained, in whole or in part, with HOOMD-blue, will
23 acknowledge its use according to the terms posted at the time of submission on:
24 http://codeblue.umich.edu/hoomd-blue/citations.html
26 * Any electronic documents citing HOOMD-Blue will link to the HOOMD-Blue website:
27 http://codeblue.umich.edu/hoomd-blue/
29 * Apart from the above required attributions, neither the name of the copyright
30 holder nor the names of HOOMD-blue's contributors may be used to endorse or
31 promote products derived from this software without specific prior written
36 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' AND
37 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
38 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND/OR ANY
39 WARRANTIES THAT THIS SOFTWARE IS FREE OF INFRINGEMENT ARE DISCLAIMED.
41 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
42 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
43 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
44 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
45 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
46 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
47 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50 // Maintainer: ndtrung
52 #include "TwoStepNPTRigid.h"
54 #ifndef __TWO_STEP_NPT_RIGID_GPU_H__
55 #define __TWO_STEP_NPT_RIGID_GPU_H__
57 /*! \file TwoStepNPTRigidGPU.h
58 \brief Declares the TwoStepNPTRigidGPU class
62 #error This header cannot be compiled by nvcc
65 //! Integrates part of the system forward in two steps in the NPT ensemble on the GPU
66 /*! Implements velocity-verlet NVT integration through the IntegrationMethodTwoStep interface, runs on the GPU
70 class TwoStepNPTRigidGPU
: public TwoStepNPTRigid
73 //! Constructs the integration method and associates it with the system
74 TwoStepNPTRigidGPU(boost::shared_ptr
<SystemDefinition
> sysdef
,
75 boost::shared_ptr
<ParticleGroup
> group
,
76 boost::shared_ptr
<ComputeThermo
> thermo_group
,
77 boost::shared_ptr
<ComputeThermo
> thermo_all
,
80 boost::shared_ptr
<Variant
> T
,
81 boost::shared_ptr
<Variant
> P
,
82 bool skip_restart
=false);
84 virtual ~TwoStepNPTRigidGPU() {};
86 //! Performs the first step of the integration
87 virtual void integrateStepOne(unsigned int timestep
);
89 //! Performs the second step of the integration
90 virtual void integrateStepTwo(unsigned int timestep
);
93 GPUArray
<Scalar
> m_partial_Ksum_t
; //!< Translational kinetic energy per body
94 GPUArray
<Scalar
> m_partial_Ksum_r
; //!< Rotational kinetic energy per body
95 GPUArray
<Scalar
> m_Ksum_t
; //!< Translational kinetic energy
96 GPUArray
<Scalar
> m_Ksum_r
; //!< Rotational kinetic energy
97 GPUArray
<Scalar4
> m_new_box
; //!< New box size
98 GPUArray
<Scalar
> m_partial_sum_virial_rigid
; //!< Partial sum for first pass reduction
99 GPUArray
<Scalar
> m_sum_virial_rigid
; //!< Total sum of virial on the GPU
101 unsigned int m_block_size
; //!< Block size to launch on the GPU (must be a power of two)
102 unsigned int m_group_num_blocks
; //!< Number of blocks of \a block_size to launch when updating the group
103 unsigned int m_full_num_blocks
; //!< Number of blocks to launch when updating all particles
104 GPUArray
<Scalar
> m_partial_sum2K
; //!< Partial sums from the first pass reduction
105 GPUArray
<Scalar
> m_sum2K
; //!< Total sum of 2K on the GPU
106 GPUArray
<Scalar
> m_partial_sumW
; //!< Partial sums for the first pass reduction of W
107 GPUArray
<Scalar
> m_sumW
; //!< Total sum of W on the GPU
111 //! Exports the TwoStepNPTRigidGPU class to python
112 void export_TwoStepNPTRigidGPU();
114 #endif // #ifndef __TWO_STEP_NPT_RIGID_GPU_H__