Struct BoundLennardJones
pub struct BoundLennardJones {
pub epsilon: f64,
pub sigma: f64,
pub bound: f64,
pub cutoff: f64,
}
Expand description
Lennard-Jones interaction potential with numerical upper and lower limit.
§Parameters & Variables
Symbol | Struct Field | Description |
---|---|---|
$\sigma$ | sigma | Measure for the size of the particle. |
$\epsilon$ | epsilon | Interaction Strength |
$\beta$ | bound | Upper bound on the interaction strength. |
$\xi$ | cutoff | Cutoff after which the interaction strength is identically 0 |
$r$ | Distance between interacting particles |
§Equations
The pure Lennard-Jones potential has many numerical downsides as it is very unstable to use
and thus typically only recommended with extremely small integration steps.
Here, we artificially limit the repelling part of the potential thus increasing numerical
usability.
However, it also has in principle infinite range.
This is directly contrary to one of the fundamental assumptions of cellular_raza
.
We resolve the latter problem by simply assigning the value 0
if $r>=\zeta$ although this
behavior is not continuous anymore.
The potential of the interaction is given by
\begin{align}
U(r) &= 4\epsilon\left[ \left(\frac{\sigma}{r}\right)^{12} -
\left(\frac{\sigma}{r}\right)^6\right]\\
V(r) &= \min(U(r), \beta)\theta(r-\zeta)
\end{align}
where $\epsilon$ determines the overall interaction strength of the potential
and $\sigma$ the shape and interaction range.
The function $\theta(r-\zeta)$ is the heaviside function which sets the interaction to zero
when reaching the cutoff point.
The minimum of this potential is at $r_\text{min}=2^{1/6}\sigma$.
For two identically-sized spherical interacting particles $r_\text{min}$ has to align with
the diameter of their size.
The interaction is artificially bound from above by a value $\beta$ in
order to obtain better numerical stability.
§References
[1] “On the determination of molecular fields.—I. From the variation of the viscosity of a gas with temperature,” Proceedings of the Royal Society of London. Series A, Containing Papers of a Mathematical and Physical Character, vol. 106, no. 738. The Royal Society, pp. 441–462, Oct. 1924. doi: 10.1098/rspa.1924.0081.
Fields§
§epsilon: f64
Interaction strength $\epsilon$ of the potential.
sigma: f64
Overall size $\sigma$ of the object of the potential.
bound: f64
Numerical bound $\beta$ of the interaction strength.
cutoff: f64
Defines a cutoff $\zeta$ after which the potential will be fixed to exactly zero.
Trait Implementations§
§impl Clone for BoundLennardJones
impl Clone for BoundLennardJones
§fn clone(&self) -> BoundLennardJones
fn clone(&self) -> BoundLennardJones
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for BoundLennardJones
impl Debug for BoundLennardJones
§impl<'de> Deserialize<'de> for BoundLennardJones
impl<'de> Deserialize<'de> for BoundLennardJones
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BoundLennardJones, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BoundLennardJones, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl<const D: usize> Interaction<Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>, Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>, Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>> for BoundLennardJones
impl<const D: usize> Interaction<Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>, Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>, Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>> for BoundLennardJones
§fn calculate_force_between(
&self,
own_pos: &Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>,
_own_vel: &Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>,
ext_pos: &Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>,
_ext_vel: &Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>,
_ext_information: &(),
) -> Result<(Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>, Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>), CalcError>
fn calculate_force_between( &self, own_pos: &Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>, _own_vel: &Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>, ext_pos: &Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>, _ext_vel: &Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>, _ext_information: &(), ) -> Result<(Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>, Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>), CalcError>
§fn get_interaction_information(&self)
fn get_interaction_information(&self)
§fn is_neighbor(
&self,
own_pos: &Pos,
ext_pos: &Pos,
ext_inf: &Inf,
) -> Result<bool, CalcError>
fn is_neighbor( &self, own_pos: &Pos, ext_pos: &Pos, ext_inf: &Inf, ) -> Result<bool, CalcError>
§fn react_to_neighbors(&mut self, neighbors: usize) -> Result<(), CalcError>
fn react_to_neighbors(&mut self, neighbors: usize) -> Result<(), CalcError>
§impl IntoPy<Py<PyAny>> for BoundLennardJones
impl IntoPy<Py<PyAny>> for BoundLennardJones
§impl PyClass for BoundLennardJones
impl PyClass for BoundLennardJones
§impl PyTypeInfo for BoundLennardJones
impl PyTypeInfo for BoundLennardJones
§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type or a subclass of this type.§fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of_bound(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type.§impl Serialize for BoundLennardJones
impl Serialize for BoundLennardJones
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl DerefToPyAny for BoundLennardJones
Auto Trait Implementations§
impl Freeze for BoundLennardJones
impl RefUnwindSafe for BoundLennardJones
impl Send for BoundLennardJones
impl Sync for BoundLennardJones
impl Unpin for BoundLennardJones
impl UnwindSafe for BoundLennardJones
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
impl<T> FromPyObject<'_> for Twhere
T: PyClass + Clone,
§fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
fn extract_bound(obj: &Bound<'_, PyAny>) -> Result<T, PyErr>
§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
§fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
fn from_py_object_bound(ob: Borrowed<'_, 'py, PyAny>) -> Result<T, PyErr>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.