OpenMPCD
Public Member Functions | List of all members
OpenMPCD::PairPotentials::MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles< T > Class Template Referenceabstract

Interactions between two constant and identical magnetic dipoles. More...

#include <MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles.hpp>

Inheritance diagram for OpenMPCD::PairPotentials::MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles< T >:
Inheritance graph
[legend]
Collaboration diagram for OpenMPCD::PairPotentials::MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles< T >:
Collaboration graph
[legend]

Public Member Functions

OPENMPCD_CUDA_HOST_AND_DEVICE MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles (const T prefactor_, const Vector3D< T > &orientation_)
 The constructor. More...
 
OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< T > force (const Vector3D< T > &R) const
 Returns the force vector of the interaction for a given position vector. More...
 
OPENMPCD_CUDA_HOST_AND_DEVICEpotential (const Vector3D< T > &R) const
 Returns the potential of the interaction for a given position vector. More...
 
OPENMPCD_CUDA_HOST_AND_DEVICEgetPrefactor () const
 Returns the term \( \frac{\mu_0 m^2}{4 \pi} \). More...
 
const OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< T > & getDipoleOrientation () const
 Returns the dipole orientation \( \hat{m} \). More...
 
virtual OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< FPforce (const Vector3D< FP > &Rvec) const=0
 Returns the force vector of the interaction for a given position vector. More...
 
virtual OPENMPCD_CUDA_HOST_AND_DEVICE FP potential (const Vector3D< FP > &Rvec) const=0
 Returns the potential of the interaction for a given position vector. More...
 
const OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D< FPforceOnR1DueToR2 (const Vector3D< FP > &r1, const Vector3D< FP > &r2) const
 Returns the force exerted on the particle at r1 due to the particle at r2. More...
 

Detailed Description

template<typename T = FP>
class OpenMPCD::PairPotentials::MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles< T >

Interactions between two constant and identical magnetic dipoles.

The general magnetic dipole-dipole interaction potential is given by

\[ - \frac{ \mu_0 }{ 4 \pi r^3 } \left( 3 \left(\vec{m_1} \cdot \hat{r} \right) \left(\vec{m_2} \cdot \hat{r} \right) - \vec{m_1} \cdot \vec{m_2} \right) \]

where \( \mu_0 \) is the vacuum permeability, \( \hat{r} \) and \( r \) are, respectively, the unit vector and length of the vector \( \vec{r} \) that points from one dipole's position to the other's, \( \vec{m_1} \) and \( \vec{m_2} \) are the magnetic dipole moments, and \( \cdot \) denotes the inner product.

In the special case treated in this class, the magnetic dipole moments are assumed to be constant throughout time in size and orientation. Therefore, with \( m \) being the magnitude of the individual dipole moments and with \( \hat{m} \) being the unit vector of the individual dipole moments, the interaction potential is given by

\[ - \frac{ \mu_0 m^2 }{ 4 \pi r^3 } \left( 3 \left(\hat{m} \cdot \hat{r} \right)^2 - 1 \right) \]

Template Parameters
TThe numeric data type.

Definition at line 57 of file MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles.hpp.

Constructor & Destructor Documentation

◆ MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles()

The constructor.

Parameters
[in]prefactor_The term \( \frac{\mu_0 m^2}{4 \pi} \).
[in]orientation_The orientation unit vector \( \hat{m} \) of the dipole moments.

Definition at line 71 of file MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles.hpp.

Member Function Documentation

◆ force() [1/2]

virtual OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D<FP > OpenMPCD::PairPotentials::Base< FP >::force ( const Vector3D< T > &  Rvec) const
pure virtualinherited

Returns the force vector of the interaction for a given position vector.

This function returns the directional derivative

\[ - \nabla_R V \left( \vec{R} \right) \]

where \( \vec{R} \) is the Rvec parameter, \( V \) is the potential as given by the potential function, and \( \nabla_R V \) is the gradient of \( V \) with respect to \( \vec{R} \).

Parameters
[in]RvecThe relative position vector.

◆ force() [2/2]

Returns the force vector of the interaction for a given position vector.

This function returns the directional derivative

\[ - \nabla_R V \left( \vec{R} \right) \]

where \( \vec{R} \) is the R parameter, \( V \) is the potential as given by the potential function, and \( \nabla_R V \) is the gradient of \( V \) with respect to \( \vec{R} \).

Exceptions
OpenMPCD::AssertionExceptionIf OPENMPCD_DEBUG is defined, throws if OpenMPCD::Scalar::isZero(R.getMagnitudeSquared()).
Parameters
[in]RThe relative position vector.

Definition at line 100 of file MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles.hpp.

◆ forceOnR1DueToR2()

const OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D<FP > OpenMPCD::PairPotentials::Base< FP >::forceOnR1DueToR2 ( const Vector3D< T > &  r1,
const Vector3D< T > &  r2 
) const
inlineinherited

Returns the force exerted on the particle at r1 due to the particle at r2.

Parameters
[in]r1The position of the first particle.
[in]r2The position of the second particle.

Definition at line 65 of file PairPotentials/Base.hpp.

◆ getDipoleOrientation()

template<typename T = FP>
const OPENMPCD_CUDA_HOST_AND_DEVICE Vector3D<T>& OpenMPCD::PairPotentials::MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles< T >::getDipoleOrientation ( ) const
inline

Returns the dipole orientation \( \hat{m} \).

Definition at line 155 of file MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles.hpp.

◆ getPrefactor()

Returns the term \( \frac{\mu_0 m^2}{4 \pi} \).

Definition at line 146 of file MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles.hpp.

◆ potential() [1/2]

virtual OPENMPCD_CUDA_HOST_AND_DEVICE FP OpenMPCD::PairPotentials::Base< FP >::potential ( const Vector3D< T > &  Rvec) const
pure virtualinherited

Returns the potential of the interaction for a given position vector.

Parameters
[in]RvecThe relative position vector.

◆ potential() [2/2]

template<typename T = FP>
OPENMPCD_CUDA_HOST_AND_DEVICE T OpenMPCD::PairPotentials::MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles< T >::potential ( const Vector3D< T > &  R) const
inline

Returns the potential of the interaction for a given position vector.

Exceptions
OpenMPCD::AssertionExceptionIf OPENMPCD_DEBUG is defined, throws if OpenMPCD::Scalar::isZero(R.getMagnitudeSquared()).
Parameters
[in]RThe relative position vector.

Definition at line 129 of file MagneticDipoleDipoleInteraction_ConstantIdenticalDipoles.hpp.


The documentation for this class was generated from the following file: