OpenMPCD
StarPolymers_Implementation.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * Contains implementation details used in
4  * `OpenMPCD::CUDA::MPCSolute::StarPolymers`.
5  */
6 
7 #ifndef OPENMPCD_CUDA_MPCSOLUTE_IMPLEMENTATIONDETAILS_STARPOLYMERS_IMPLEMENTATION_HPP
8 #define OPENMPCD_CUDA_MPCSOLUTE_IMPLEMENTATIONDETAILS_STARPOLYMERS_IMPLEMENTATION_HPP
9 
11 
12 #include <OpenMPCD/CUDA/Macros.hpp>
13 
14 #include <algorithm>
15 
16 namespace OpenMPCD
17 {
18 namespace CUDA
19 {
20 namespace MPCSolute
21 {
22 namespace ImplementationDetails
23 {
24 namespace StarPolymers
25 {
26 
27 inline
30  const std::size_t armCountPerStar,
31  const std::size_t particleCountPerArm,
32  const bool hasMagneticParticles)
33 {
34  return
35  1 //core
36  +
37  armCountPerStar * (particleCountPerArm + hasMagneticParticles);
38 }
39 
40 inline
42 std::size_t getParticleCount(
43  const std::size_t starCount,
44  const std::size_t armCountPerStar,
45  const std::size_t particleCountPerArm,
46  const bool hasMagneticParticles)
47 {
48  const std::size_t particleCountPerStar = getParticleCountPerStar(
49  armCountPerStar, particleCountPerArm, hasMagneticParticles);
50 
51  return starCount * particleCountPerStar;
52 }
53 
54 inline
57  const std::size_t particleID,
58  const std::size_t starCount,
59  const std::size_t armCountPerStar,
60  const std::size_t particleCountPerArm,
61  const bool hasMagneticParticles,
62  std::size_t* const starID,
63  bool* const isCoreParticle,
64  std::size_t* const armID,
65  bool* const isMagneticParticle,
66  std::size_t* const particleIDInArm)
67 {
69  starID != NULL, OpenMPCD::NULLPointerException);
71  isCoreParticle != NULL, OpenMPCD::NULLPointerException);
73  armID != NULL, OpenMPCD::NULLPointerException);
75  isMagneticParticle != NULL, OpenMPCD::NULLPointerException);
77  particleIDInArm != NULL, OpenMPCD::NULLPointerException);
78 
80  particleID <
82  starCount, armCountPerStar, particleCountPerArm,
83  hasMagneticParticles),
85 
86  const std::size_t particleCountPerStar =
88  armCountPerStar, particleCountPerArm, hasMagneticParticles);
89 
90  *starID = particleID / particleCountPerStar;
91  const std::size_t particleIDWithinStar = particleID % particleCountPerStar;
92 
93  if(particleIDWithinStar == 0)
94  {
95  *isCoreParticle = true;
96  *isMagneticParticle = false;
97  return;
98  }
99 
100  *isCoreParticle = false;
101 
102  const std::size_t particleCountPerExtendedArm =
103  particleCountPerArm + hasMagneticParticles;
104 
105  *armID = (particleIDWithinStar - 1) / particleCountPerExtendedArm;
106  *particleIDInArm = (particleIDWithinStar - 1) % particleCountPerExtendedArm;
107  *isMagneticParticle = *particleIDInArm == particleCountPerArm;
108 }
109 
110 inline
113  const std::size_t particleID,
114  const std::size_t starCount,
115  const std::size_t armCountPerStar,
116  const std::size_t particleCountPerArm,
117  const bool hasMagneticParticles)
118 {
119  std::size_t starID, armID, particleIDInArm;
120  bool isCoreParticle, isMagneticParticle;
121 
123  particleID,
124  starCount, armCountPerStar, particleCountPerArm, hasMagneticParticles,
125  &starID, &isCoreParticle, &armID, &isMagneticParticle,
126  &particleIDInArm);
127 
128  if(isCoreParticle)
129  return ParticleType::Core;
130 
131  if(isMagneticParticle)
132  return ParticleType::Magnetic;
133 
134  return ParticleType::Arm;
135 }
136 
137 inline
140  const std::size_t particleID1,
141  const std::size_t particleID2,
142  const std::size_t starCount,
143  const std::size_t armCountPerStar,
144  const std::size_t particleCountPerArm,
145  const bool hasMagneticParticles)
146 {
148  particleID1 != particleID2,
150 
151  std::size_t starID1, armID1, particleIDInArm1;
152  bool isCoreParticle1, isMagneticParticle1;
153 
154  std::size_t starID2, armID2, particleIDInArm2;
155  bool isCoreParticle2, isMagneticParticle2;
156 
158  particleID1,
159  starCount, armCountPerStar, particleCountPerArm, hasMagneticParticles,
160  &starID1, &isCoreParticle1, &armID1, &isMagneticParticle1,
161  &particleIDInArm1);
162 
164  particleID2,
165  starCount, armCountPerStar, particleCountPerArm, hasMagneticParticles,
166  &starID2, &isCoreParticle2, &armID2, &isMagneticParticle2,
167  &particleIDInArm2);
168 
169  if(starID1 != starID2)
170  return false;
171 
172  #ifdef OPENMPCD_COMPILER_GCC
173  #pragma GCC diagnostic push
174  #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
175  #endif
176  if(isCoreParticle1)
177  return particleIDInArm2 == 0;
178  if(isCoreParticle2)
179  return particleIDInArm1 == 0;
180  #ifdef OPENMPCD_COMPILER_GCC
181  #pragma GCC diagnostic pop
182  #endif
183 
184  if(armID1 != armID2)
185  return false;
186 
187  if(particleIDInArm1 + 1 == particleIDInArm2)
188  return true;
189  if(particleIDInArm2 + 1 == particleIDInArm1)
190  return true;
191 
192  return false;
193 }
194 
195 inline
198  const ParticleType::Enum type1, const ParticleType::Enum type2)
199 {
200  #ifndef __CUDA_ARCH__
201  using std::min;
202  using std::max;
203  #endif
204 
205  const std::size_t lower =
206  min(static_cast<std::size_t>(type1), static_cast<std::size_t>(type2));
207  const std::size_t upper =
208  max(static_cast<std::size_t>(type1), static_cast<std::size_t>(type2));
209 
210  //WARNING: this won't work anymore if there are more than three types!
211  const std::size_t tmp = (upper << 1) + lower;
212  if(tmp == 0)
213  return 0;
214  return tmp - 1;
215 }
216 
217 
218 /**
219  * Constructs the interaction potentials in Device memory.
220  *
221  * The interaction parameters are described in the documentation of
222  * `OpenMPCD::CUDA::MPCSolute::StarPolymers`.
223  *
224  * The arrays returned in the output parameters `WCAPotentials` and
225  * `FENEPotentials` contain the interactions of particles of type `type1` and
226  * `type2` at the array index `getParticleTypeCombinationIndex(type1, type2)`.
227  *
228  * @tparam T The underlying data type.
229  *
230  * @param[in] epsilon_core The \f$ \varepsilon_C \f$ parameter.
231  * @param[in] epsilon_arm The \f$ \varepsilon_A \f$ parameter.
232  * @param[in] epsilon_magnetic The \f$ \varepsilon_M \f$ parameter.
233  * @param[in] sigma_core The \f$ \sigma_C \f$ parameter.
234  * @param[in] sigma_arm The \f$ \sigma_A \f$ parameter.
235  * @param[in] sigma_magnetic The \f$ \sigma_M \f$ parameter.
236  * @param[in] D_core The \f$ D_C \f$ parameter.
237  * @param[in] D_arm The \f$ D_A \f$ parameter.
238  * @param[in] D_magnetic The \f$ D_M \f$ parameter.
239  * @param[in] magneticPrefactor The `prefactor` argument to the magnetic
240  * interaction.
241  * @param[in] dipoleOrientation Normalized vector that defines the orientation
242  * of the magnetic dipoles.
243  * @param[in] WCAPotentials Where to construct the WCA potential instances.
244  * @param[in] FENEPotentials Where to construct the FENE potential
245  * instances.
246  * @param[in] magneticPotential Where to construct the magnetic potential
247  * instances.
248  */
249 template<typename T>
250 __global__
252  const T epsilon_core, const T epsilon_arm, const T epsilon_magnetic,
253  const T sigma_core, const T sigma_arm, const T sigma_magnetic,
254  const T D_core, const T D_arm, const T D_magnetic,
255  const T magneticPrefactor, const Vector3D<T> dipoleOrientation,
257  WCAPotentials,
258  PairPotentials::FENE<T>** const FENEPotentials,
259  PairPotentials::
260  MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles<T>** const
261  magneticPotential
262  )
263 {
264  OPENMPCD_DEBUG_ASSERT(WCAPotentials != NULL);
265  OPENMPCD_DEBUG_ASSERT(FENEPotentials != NULL);
266  OPENMPCD_DEBUG_ASSERT(magneticPotential != NULL);
267 
269  typedef PairPotentials::FENE<T> FENE;
270  typedef
271  PairPotentials::
272  MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles<T>
273  Magnetic;
274 
275  const std::size_t indexCC =
278  const std::size_t indexCA =
281  const std::size_t indexCM =
284  const std::size_t indexAA =
287  const std::size_t indexAM =
290  const std::size_t indexMM =
293 
294 
295  const T epsilon_CC = epsilon_core;
296  const T epsilon_CA = sqrt(epsilon_core * epsilon_arm);
297  const T epsilon_CM = sqrt(epsilon_core * epsilon_magnetic);
298  const T epsilon_AA = epsilon_arm;
299  const T epsilon_AM = sqrt(epsilon_arm * epsilon_magnetic);
300  const T epsilon_MM = epsilon_magnetic;
301 
302  const T sigma_CC = sigma_core;
303  const T sigma_CA = 0.5 * (sigma_core + sigma_arm);
304  const T sigma_CM = 0.5 * (sigma_core + sigma_magnetic);
305  const T sigma_AA = sigma_arm;
306  const T sigma_AM = 0.5 * (sigma_arm + sigma_magnetic);
307  const T sigma_MM = sigma_magnetic;
308 
309  const T D_CC = D_core;
310  const T D_CA = 0.5 * (D_core + D_arm);
311  const T D_CM = 0.5 * (D_core + D_magnetic);
312  const T D_AA = D_arm;
313  const T D_AM = 0.5 * (D_arm + D_magnetic);
314  const T D_MM = D_magnetic;
315 
316  WCAPotentials[indexCC] = new WCA(epsilon_CC, sigma_CC, D_CC);
317  WCAPotentials[indexCA] = new WCA(epsilon_CA, sigma_CA, D_CA);
318  WCAPotentials[indexCM] = new WCA(epsilon_CM, sigma_CM, D_CM);
319  WCAPotentials[indexAA] = new WCA(epsilon_AA, sigma_AA, D_AA);
320  WCAPotentials[indexAM] = new WCA(epsilon_AM, sigma_AM, D_AM);
321  WCAPotentials[indexMM] = new WCA(epsilon_MM, sigma_MM, D_MM);
322 
323  const T l_0_CA = D_CA;
324  const T l_0_AA = D_AA;
325  const T l_0_AM = D_AM;
326 
327  const T R_CA = 1.5 * sigma_CA;
328  const T R_AA = 1.5 * sigma_AA;
329  const T R_AM = 1.5 * sigma_AM;
330 
331  const T K_CA = 30 * epsilon_CA / (sigma_CA * sigma_CA);
332  const T K_AA = 30 * epsilon_AA / (sigma_AA * sigma_AA);
333  const T K_AM = 30 * epsilon_AM / (sigma_AM * sigma_AM);
334 
335  FENEPotentials[indexCA] = new FENE(K_CA, l_0_CA, R_CA);
336  FENEPotentials[indexAA] = new FENE(K_AA, l_0_AA, R_AA);
337  FENEPotentials[indexAM] = new FENE(K_AM, l_0_AM, R_AM);
338 
339  #ifdef OPENMPCD_DEBUG
340  FENEPotentials[indexCC] = NULL;
341  FENEPotentials[indexCM] = NULL;
342  FENEPotentials[indexMM] = NULL;
343  #endif
344 
345  *magneticPotential = new Magnetic(magneticPrefactor, dipoleOrientation);
346 }
347 
348 template<typename T>
350  const T epsilon_core, const T epsilon_arm, const T epsilon_magnetic,
351  const T sigma_core, const T sigma_arm, const T sigma_magnetic,
352  const T D_core, const T D_arm, const T D_magnetic,
353  const T magneticPrefactor, const Vector3D<T> dipoleOrientation,
355  WCAPotentials,
356  PairPotentials::FENE<T>*** const FENEPotentials,
357  PairPotentials::
358  MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles<T>*** const
359  magneticPotential
360  )
361 {
362  OPENMPCD_DEBUG_ASSERT(WCAPotentials != NULL);
363  OPENMPCD_DEBUG_ASSERT(FENEPotentials != NULL);
364  OPENMPCD_DEBUG_ASSERT(magneticPotential != NULL);
365 
369 
370  createInteractionsOnDevice_kernel<<<1, 1>>>(
371  epsilon_core, epsilon_arm, epsilon_magnetic,
372  sigma_core, sigma_arm, sigma_magnetic,
373  D_core, D_arm, D_magnetic,
374  magneticPrefactor, dipoleOrientation,
375  *WCAPotentials, *FENEPotentials, *magneticPotential
376  );
377 }
378 
379 
380 /**
381  * Frees the memory allocated through `createInteractionsOnDevice_kernel`.
382  *
383  * @param[in] WCAPotentials The array of allocated WCA potentials on the
384  * CUDA Device.
385  * @param[in] FENEPotentials The array of allocated FENE potentials on the
386  * CUDA Device.
387  * @param[in] magneticPotential The allocated magnetic potential on the CUDA
388  * Device.
389  */
390 template<typename T>
391 __global__
394  WCAPotentials,
395  PairPotentials::FENE<T>** const FENEPotentials,
396  PairPotentials::
397  MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles<T>** const
398  magneticPotential
399  )
400 {
401  OPENMPCD_DEBUG_ASSERT(WCAPotentials != NULL);
402  OPENMPCD_DEBUG_ASSERT(FENEPotentials != NULL);
403  OPENMPCD_DEBUG_ASSERT(magneticPotential != NULL);
404 
405  for(std::size_t i = 0; i < 6; ++i)
406  {
407  OPENMPCD_DEBUG_ASSERT(WCAPotentials[i] != NULL);
408 
409  delete WCAPotentials[i];
410  }
411 
412  const std::size_t indexCA =
415  const std::size_t indexAA =
418  const std::size_t indexAM =
421 
422  OPENMPCD_DEBUG_ASSERT(FENEPotentials[indexCA] != NULL);
423  OPENMPCD_DEBUG_ASSERT(FENEPotentials[indexAA] != NULL);
424  OPENMPCD_DEBUG_ASSERT(FENEPotentials[indexAM] != NULL);
425 
426  #ifdef OPENMPCD_DEBUG
427  const std::size_t indexCC =
430  const std::size_t indexCM =
433  const std::size_t indexMM =
436 
437  OPENMPCD_DEBUG_ASSERT(FENEPotentials[indexCC] == NULL);
438  OPENMPCD_DEBUG_ASSERT(FENEPotentials[indexCM] == NULL);
439  OPENMPCD_DEBUG_ASSERT(FENEPotentials[indexMM] == NULL);
440  #endif
441 
442  delete FENEPotentials[indexCA];
443  delete FENEPotentials[indexAA];
444  delete FENEPotentials[indexAM];
445 
446  delete *magneticPotential;
447 }
448 
449 template<typename T>
452  WCAPotentials,
453  PairPotentials::FENE<T>** const FENEPotentials,
454  PairPotentials::
455  MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles<T>** const
456  magneticPotential
457  )
458 {
459  destroyInteractionsOnDevice_kernel<<<1, 1>>>(
460  WCAPotentials, FENEPotentials, magneticPotential);
461 
465 }
466 
467 
468 template<typename T>
470 const Vector3D<T>
472  const std::size_t particleID1,
473  const std::size_t particleID2,
474  const RemotelyStoredVector<const T>& position1,
475  const RemotelyStoredVector<const T>& position2,
476  const std::size_t starCount,
477  const std::size_t armCountPerStar,
478  const std::size_t particleCountPerArm,
479  const bool hasMagneticParticles,
481  WCAPotentials,
482  PairPotentials::FENE<T>** const FENEPotentials,
483  PairPotentials::
484  MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles<T>** const
485  magneticPotential)
486 {
487  OPENMPCD_DEBUG_ASSERT(particleID1 != particleID2);
488 
489  const ParticleType::Enum particleType1 =
491  particleID1,
492  starCount, armCountPerStar, particleCountPerArm,
493  hasMagneticParticles);
494 
495  const ParticleType::Enum particleType2 =
497  particleID2,
498  starCount, armCountPerStar, particleCountPerArm,
499  hasMagneticParticles);
500 
501  const std::size_t particleTypeCombinationIndex =
502  getParticleTypeCombinationIndex(particleType1, particleType2);
503 
504  Vector3D<T> forceOnParticle1 =
505  WCAPotentials[particleTypeCombinationIndex]->
506  forceOnR1DueToR2(position1, position2);
507 
508 
509  if(
510  particleType1 == ParticleType::Magnetic &&
511  particleType2 == ParticleType::Magnetic
512  )
513  {
514  forceOnParticle1 +=
515  magneticPotential[0]->forceOnR1DueToR2(position1, position2);
516  return forceOnParticle1;
517  }
518 
519  const bool bonded =
521  particleID1, particleID2,
522  starCount, armCountPerStar, particleCountPerArm,
523  hasMagneticParticles);
524 
525  if(!bonded)
526  return forceOnParticle1;
527 
528  forceOnParticle1 +=
529  FENEPotentials[particleTypeCombinationIndex]->
530  forceOnR1DueToR2(position1, position2);
531 
532  return forceOnParticle1;
533 }
534 
535 } //namespace StarPolymers
536 } //namespace ImplementationDetails
537 } //namespace MPCSolute
538 } //namespace CUDA
539 } //namespace OpenMPCD
540 
541 #endif //OPENMPCD_CUDA_MPCSOLUTE_IMPLEMENTATIONDETAILS_STARPOLYMERS_IMPLEMENTATION_HPP
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::getParticleType
OPENMPCD_CUDA_HOST_AND_DEVICE ParticleType::Enum getParticleType(const std::size_t particleID, const std::size_t starCount, const std::size_t armCountPerStar, const std::size_t particleCountPerArm, const bool hasMagneticParticles)
Returns the particle type that corresponds to the given ID.
Definition: StarPolymers_Implementation.hpp:112
OpenMPCD::PairPotentials::WeeksChandlerAndersen_DistanceOffset
A generalization of the Weeks-Chandler-Andersen (WCA) potential.
Definition: WeeksChandlerAndersen_DistanceOffset.hpp:39
OpenMPCD::RemotelyStoredVector
Represents a vector whose data is stored elsewhere.
Definition: RemotelyStoredVector.hpp:26
OpenMPCD::Vector3D
3-dimensional vector.
Definition: Vector3D.hpp:38
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::getParticleCountPerStar
OPENMPCD_CUDA_HOST_AND_DEVICE std::size_t getParticleCountPerStar(const std::size_t armCountPerStar, const std::size_t particleCountPerArm, const bool hasMagneticParticles)
Returns the total number of particles per star.
Definition: StarPolymers_Implementation.hpp:29
OPENMPCD_DEBUG_ASSERT
#define OPENMPCD_DEBUG_ASSERT(assertion)
Asserts that the given expression evaluates to true, but only if OPENMPCD_DEBUG is defined.
Definition: OPENMPCD_DEBUG_ASSERT.hpp:88
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::ParticleType::Arm
@ Arm
Type for the particles that make up an arm.
Definition: StarPolymers_ParticleType.hpp:33
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::createInteractionsOnDevice
void createInteractionsOnDevice(const T epsilon_core, const T epsilon_arm, const T epsilon_magnetic, const T sigma_core, const T sigma_arm, const T sigma_magnetic, const T D_core, const T D_arm, const T D_magnetic, const T magneticPrefactor, const Vector3D< T > dipoleOrientation, PairPotentials::WeeksChandlerAndersen_DistanceOffset< T > ***const WCAPotentials, PairPotentials::FENE< T > ***const FENEPotentials, PairPotentials::MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles< T > ***const magneticPotential)
Constructs the necessary interaction potentials in memory.
Definition: StarPolymers_Implementation.hpp:349
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::ParticleType::Enum
Enum
Enumerates particle types.
Definition: StarPolymers_ParticleType.hpp:30
OPENMPCD_CUDA_HOST_AND_DEVICE
#define OPENMPCD_CUDA_HOST_AND_DEVICE
Denotes a function to be callable both from the Host and from a CUDA Device.
Definition: Macros.hpp:15
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::ParticleType::Core
@ Core
Type for the core particle.
Definition: StarPolymers_ParticleType.hpp:32
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::getParticleCount
OPENMPCD_CUDA_HOST_AND_DEVICE std::size_t getParticleCount(const std::size_t starCount, const std::size_t armCountPerStar, const std::size_t particleCountPerArm, const bool hasMagneticParticles)
Returns the total number of particles in a StarPolymers instance.
Definition: StarPolymers_Implementation.hpp:42
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::getParticleTypeCombinationIndex
OPENMPCD_CUDA_HOST_AND_DEVICE std::size_t getParticleTypeCombinationIndex(const ParticleType::Enum type1, const ParticleType::Enum type2)
Returns a different integer, in a consecutive range starting from 0, for every combination of particl...
Definition: StarPolymers_Implementation.hpp:197
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::getParticleStructureIndices
OPENMPCD_CUDA_HOST_AND_DEVICE void getParticleStructureIndices(const std::size_t particleID, const std::size_t starCount, const std::size_t armCountPerStar, const std::size_t particleCountPerArm, const bool hasMagneticParticles, std::size_t *const starID, bool *const isCoreParticle, std::size_t *const armID, bool *const isMagneticParticle, std::size_t *const particleIDInArm)
Computes the structure indices of the particle ID given.
Definition: StarPolymers_Implementation.hpp:56
OPENMPCD_DEBUG_ASSERT_EXCEPTIONTYPE
#define OPENMPCD_DEBUG_ASSERT_EXCEPTIONTYPE(assertion, ExceptionType)
Definition: OPENMPCD_DEBUG_ASSERT.hpp:76
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::ParticleType::Magnetic
@ Magnetic
Type for the magnetic particles at the ends of arms.
Definition: StarPolymers_ParticleType.hpp:34
OpenMPCD::PairPotentials::FENE
FENE Interaction .
Definition: FENE.hpp:18
OpenMPCD::CUDA::DeviceMemoryManager::allocateMemoryUnregistered
static Pointee * allocateMemoryUnregistered(const unsigned int instanceCount)
Allocates Device memory for the given number of instances of the supplied type.
Definition: DeviceMemoryManager.hpp:121
OpenMPCD::CUDA::DeviceMemoryManager::freeMemoryUnregistered
static void freeMemoryUnregistered(void *const pointer)
Frees the Device memory pointed to by the given pointer.
Definition: DeviceMemoryManager.cpp:53
StarPolymers.hpp
Macros.hpp
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::particlesAreBonded
OPENMPCD_CUDA_HOST_AND_DEVICE bool particlesAreBonded(const std::size_t particleID1, const std::size_t particleID2, const std::size_t starCount, const std::size_t armCountPerStar, const std::size_t particleCountPerArm, const bool hasMagneticParticles)
Returns whether the two given particles are bonded.
Definition: StarPolymers_Implementation.hpp:139
OpenMPCD::Utility::MathematicalFunctions::sqrt
OPENMPCD_CUDA_HOST_AND_DEVICE T sqrt(const T x)
Returns the sqaure root of the argument.
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::destroyInteractionsOnDevice_kernel
__global__ void destroyInteractionsOnDevice_kernel(PairPotentials::WeeksChandlerAndersen_DistanceOffset< T > **const WCAPotentials, PairPotentials::FENE< T > **const FENEPotentials, PairPotentials::MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles< T > **const magneticPotential)
Frees the memory allocated through createInteractionsOnDevice_kernel.
Definition: StarPolymers_Implementation.hpp:392
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::createInteractionsOnDevice_kernel
__global__ void createInteractionsOnDevice_kernel(const T epsilon_core, const T epsilon_arm, const T epsilon_magnetic, const T sigma_core, const T sigma_arm, const T sigma_magnetic, const T D_core, const T D_arm, const T D_magnetic, const T magneticPrefactor, const Vector3D< T > dipoleOrientation, PairPotentials::WeeksChandlerAndersen_DistanceOffset< T > **const WCAPotentials, PairPotentials::FENE< T > **const FENEPotentials, PairPotentials::MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles< T > **const magneticPotential)
Constructs the interaction potentials in Device memory.
Definition: StarPolymers_Implementation.hpp:251
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::computeForceOnParticle1DueToParticle2
const OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< T > computeForceOnParticle1DueToParticle2(const std::size_t particleID1, const std::size_t particleID2, const RemotelyStoredVector< const T > &position1, const RemotelyStoredVector< const T > &position2, const std::size_t starCount, const std::size_t armCountPerStar, const std::size_t particleCountPerArm, const bool hasMagneticParticles, PairPotentials::WeeksChandlerAndersen_DistanceOffset< T > **const WCAPotentials, PairPotentials::FENE< T > **const FENEPotentials, PairPotentials::MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles< T > **const magneticPotential)
Returns the force that is exerted on particleID1 due to particleID2.
Definition: StarPolymers_Implementation.hpp:471
OpenMPCD::NULLPointerException
NULL-pointer exception.
Definition: Exceptions.hpp:96
OpenMPCD::InvalidArgumentException
Invalid argument exception.
Definition: Exceptions.hpp:128
OpenMPCD::CUDA::MPCSolute::ImplementationDetails::StarPolymers::destroyInteractionsOnDevice
void destroyInteractionsOnDevice(PairPotentials::WeeksChandlerAndersen_DistanceOffset< T > **const WCAPotentials, PairPotentials::FENE< T > **const FENEPotentials, PairPotentials::MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles< T > **const magneticPotential)
Frees the memory allocated through createInteractionsOnDevice.
Definition: StarPolymers_Implementation.hpp:450