Merge branch 'maint'
[hoomd-blue.git] / libhoomd / computes / CGCMMAngleForceCompute.h
blob7726141110fe7b177b4ba9cd2d4bfbcc96a1c926
1 /*
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
32 permission.
34 Disclaimer
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: dnlebard
52 #include <boost/shared_ptr.hpp>
54 #include "ForceCompute.h"
55 #include "BondedGroupData.h"
57 #include <vector>
59 /*! \file HarmonicAngleForceCompute.h
60 \brief Declares a class for computing harmonic bonds
63 #ifdef NVCC
64 #error This header cannot be compiled by nvcc
65 #endif
67 #ifndef __CGCMMANGLEFORCECOMPUTE_H__
68 #define __CGCMMANGLEFORCECOMPUTE_H__
70 //! Computes harmonic angle forces for CGCMM coarse grain systems.
71 /*! Harmonic angle forces are computed on every particle in the simulation.
73 The angles which forces are computed on are accessed from ParticleData::getAngleData
74 \ingroup computes
76 class CGCMMAngleForceCompute : public ForceCompute
78 public:
79 //! Constructs the compute
80 CGCMMAngleForceCompute(boost::shared_ptr<SystemDefinition> pdata);
82 //! Destructor
83 ~CGCMMAngleForceCompute();
85 //! Set the parameters
86 virtual void setParams(unsigned int type, Scalar K, Scalar t_0, unsigned int cg_type, Scalar eps, Scalar sigma);
88 //! Returns a list of log quantities this compute calculates
89 virtual std::vector< std::string > getProvidedLogQuantities();
91 //! Calculates the requested log value and returns it
92 virtual Scalar getLogValue(const std::string& quantity, unsigned int timestep);
94 #ifdef ENABLE_MPI
95 //! Get ghost particle fields requested by this pair potential
96 /*! \param timestep Current time step
98 virtual CommFlags getRequestedCommFlags(unsigned int timestep)
100 CommFlags flags = CommFlags(0);
101 flags[comm_flag::tag] = 1;
102 flags |= ForceCompute::getRequestedCommFlags(timestep);
103 return flags;
105 #endif
108 protected:
109 Scalar *m_K; //!< K parameter for multiple angle tyes
110 Scalar *m_t_0; //!< t_0 parameter for multiple angle types
112 // THESE ARE NEW FOR GC ANGLES
113 Scalar *m_eps; //!< epsilon parameter for 1-3 repulsion of multiple angle tyes
114 Scalar *m_sigma;//!< sigma parameter for 1-3 repulsion of multiple angle types
115 Scalar *m_rcut;//!< cutoff parameter for 1-3 repulsion of multiple angle types
116 unsigned int *m_cg_type; //!< coarse grain angle type index (0-3)
118 Scalar prefact[4]; //!< prefact precomputed prefactors for CG-CMM angles
119 Scalar cgPow1[4]; //!< list of 1st powers for CG-CMM angles
120 Scalar cgPow2[4]; //!< list of 2nd powers for CG-CMM angles
122 boost::shared_ptr<AngleData> m_CGCMMAngle_data; //!< Angle data to use in computing angles
124 //! Actually compute the forces
125 virtual void computeForces(unsigned int timestep);
128 //! Exports the BondForceCompute class to python
129 void export_CGCMMAngleForceCompute();
131 #endif