OpenMPCD
CUDA/DeviceCode/LeesEdwardsBoundaryConditions.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * Defines Device functions for Lees-Edwards boundary conditions.
4  */
5 
6 #ifndef OPENMPCD_CUDA_DEVICECODE_LEESEDWARDSBOUNDARYCONDITIONS_HPP
7 #define OPENMPCD_CUDA_DEVICECODE_LEESEDWARDSBOUNDARYCONDITIONS_HPP
8 
9 #include <OpenMPCD/Types.hpp>
10 #include <OpenMPCD/Vector3D.hpp>
11 
12 namespace OpenMPCD
13 {
14 namespace CUDA
15 {
16 namespace DeviceCode
17 {
18  /**
19  * The relative `x`-velocity of `y`-adjacent layers in Lees-Edwards boundary
20  * conditions.
21  *
22  * @see LeesEdwardsBoundaryConditions
23  */
24  extern __constant__ FP leesEdwardsRelativeLayerVelocity;
25 
26 
27  /**
28  * Sets CUDA symbols for Lees-Edwards boundary conditions.
29  *
30  * @see LeesEdwardsBoundaryConditions
31  *
32  * This function stores \f$ \Delta v_x = \dot{\gamma} L_y \f$ in
33  * `leesEdwardsRelativeLayerVelocity`.
34  *
35  * @param[in] shearRate The shear rate \f$ \dot{\gamma} \f$.
36  * @param[in] simBoxY The size \f$ L_y \f$ of the primary simulation box
37  * along the y direction.
38  */
39  void setLeesEdwardsSymbols(const FP shearRate, const unsigned int simBoxY);
40 
41  /**
42  * Returns the image of the given particle position under Lees-Edwards
43  * boundary conditions.
44  *
45  * This function assumes that `setLeesEdwardsSymbols` and
46  * `setSimulationBoxSizeSymbols` have been called before.
47  *
48  * @see LeesEdwardsBoundaryConditions
49  *
50  * @param[in] mpcTime The simulation time for the MPC steps.
51  * @param[in] position The particle position.
52  * @param[out] velocityCorrection Set to the velocity along the x direction that needs to
53  * be added to the particle's velocity.
54  */
55  __device__ const Vector3D<MPCParticlePositionType>
57  const FP mpcTime,
58  const Vector3D<MPCParticlePositionType>& position,
59  MPCParticleVelocityType& velocityCorrection);
60 
61 } //namespace DeviceCode
62 } //namespace CUDA
63 } //namespace OpenMPCD
64 
65 #endif
OpenMPCD::CUDA::DeviceCode::setLeesEdwardsSymbols
void setLeesEdwardsSymbols(const FP shearRate, const unsigned int simBoxY)
Sets CUDA symbols for Lees-Edwards boundary conditions.
Vector3D.hpp
OpenMPCD::FP
double FP
Default floating point type.
Definition: Types.hpp:13
Types.hpp
OpenMPCD::CUDA::DeviceCode::leesEdwardsRelativeLayerVelocity
__constant__ FP leesEdwardsRelativeLayerVelocity
The relative x-velocity of y-adjacent layers in Lees-Edwards boundary conditions.
OpenMPCD::CUDA::DeviceCode::getImageUnderLeesEdwardsBoundaryConditions
const __device__ Vector3D< MPCParticlePositionType > getImageUnderLeesEdwardsBoundaryConditions(const FP mpcTime, const Vector3D< MPCParticlePositionType > &position, MPCParticleVelocityType &velocityCorrection)
Returns the image of the given particle position under Lees-Edwards boundary conditions.