pub struct Langevin1DF32 {
pub pos: SVector<f32, 1>,
pub vel: SVector<f32, 1>,
pub mass: f32,
pub damping: f32,
pub kb_temperature: f32,
}Expand description
Langevin dynamics
§Parameters & Variables
| Symbol | Struct Field | Description |
|---|---|---|
| $M$ | mass | Mass of the particle. |
| $\gamma$ | damping | Damping constant |
| $k_BT$ | kb_temperature | Product of temperature $T$ and Boltzmann constant $k_B$. |
| $\vec{X}$ | pos | Position of the particle. |
| $\dot{\vec{X}}$ | vel | Velocity of the particle. |
| $R(t)$ | (automatically generated) | Gaussian process |
§Equations
\begin{equation} M \ddot{\mathbf{X}} = - \mathbf{\nabla} U(\mathbf{X}) - \gamma M\dot{\mathbf{X}} + \sqrt{2 M \gamma k_{\rm B} T}\mathbf{R}(t) \end{equation}
Fields§
§pos: SVector<f32, 1>Current position
vel: SVector<f32, 1>Current velocity
mass: f32Mass of the object
damping: f32Damping constant
kb_temperature: f32Product of Boltzmann constant and temperature
Implementations§
Source§impl Langevin1DF32
impl Langevin1DF32
Sourcepub fn get_position(&self) -> [f32; 1]
Available on crate feature pyo3 only.
pub fn get_position(&self) -> [f32; 1]
pyo3 only.[pyo3] getter for position
Sourcepub fn set_position(&mut self, pos: [f32; 1])
Available on crate feature pyo3 only.
pub fn set_position(&mut self, pos: [f32; 1])
pyo3 only.[pyo3] setter for position
Sourcepub fn get_damping(&self) -> f32
Available on crate feature pyo3 only.
pub fn get_damping(&self) -> f32
pyo3 only.[pyo3] getter for damping
Sourcepub fn set_damping(&mut self, damping: f32)
Available on crate feature pyo3 only.
pub fn set_damping(&mut self, damping: f32)
pyo3 only.[pyo3] setter for damping
Sourcepub fn set_mass(&mut self, mass: f32)
Available on crate feature pyo3 only.
pub fn set_mass(&mut self, mass: f32)
pyo3 only.[pyo3] setter for mass
Sourcepub fn get_kb_temperature(&self) -> f32
Available on crate feature pyo3 only.
pub fn get_kb_temperature(&self) -> f32
pyo3 only.[pyo3] getter for kb_temperature
Sourcepub fn set_kb_temperature(&mut self, kb_temperature: f32)
Available on crate feature pyo3 only.
pub fn set_kb_temperature(&mut self, kb_temperature: f32)
pyo3 only.[pyo3] setter for kb_temperature
Trait Implementations§
Source§impl AbsDiffEq for Langevin1DF32
impl AbsDiffEq for Langevin1DF32
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximimate
equality of two numbers.
§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of [
AbsDiffEq::abs_diff_eq].Source§impl Clone for Langevin1DF32
impl Clone for Langevin1DF32
Source§fn clone(&self) -> Langevin1DF32
fn clone(&self) -> Langevin1DF32
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Langevin1DF32
impl Debug for Langevin1DF32
Source§impl<'de> Deserialize<'de> for Langevin1DF32
impl<'de> Deserialize<'de> for Langevin1DF32
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'py> IntoPyObject<'py> for Langevin1DF32
impl<'py> IntoPyObject<'py> for Langevin1DF32
Source§type Target = Langevin1DF32
type Target = Langevin1DF32
The Python output type
Source§type Output = Bound<'py, <Langevin1DF32 as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <Langevin1DF32 as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Performs the conversion.
Source§impl Mechanics<Matrix<f32, Const<1>, Const<1>, ArrayStorage<f32, 1, 1>>, Matrix<f32, Const<1>, Const<1>, ArrayStorage<f32, 1, 1>>, Matrix<f32, Const<1>, Const<1>, ArrayStorage<f32, 1, 1>>, f32> for Langevin1DF32
impl Mechanics<Matrix<f32, Const<1>, Const<1>, ArrayStorage<f32, 1, 1>>, Matrix<f32, Const<1>, Const<1>, ArrayStorage<f32, 1, 1>>, Matrix<f32, Const<1>, Const<1>, ArrayStorage<f32, 1, 1>>, f32> for Langevin1DF32
Source§fn get_random_contribution(
&self,
rng: &mut ChaCha8Rng,
dt: f32,
) -> Result<(SVector<f32, 1>, SVector<f32, 1>), RngError>
fn get_random_contribution( &self, rng: &mut ChaCha8Rng, dt: f32, ) -> Result<(SVector<f32, 1>, SVector<f32, 1>), RngError>
Define a new random variable in case that the mechanics type contains a random aspect to
its motion.
By default this function does nothing.
Source§fn calculate_increment(
&self,
force: SVector<f32, 1>,
) -> Result<(SVector<f32, 1>, SVector<f32, 1>), CalcError>
fn calculate_increment( &self, force: SVector<f32, 1>, ) -> Result<(SVector<f32, 1>, SVector<f32, 1>), CalcError>
Calculate the time-derivative of force and velocity given all the forces that act on the
cell.
Simple damping effects should be included in this trait if not explicitly given by the
SubDomainForce trait.
Source§impl PartialEq for Langevin1DF32
impl PartialEq for Langevin1DF32
Source§impl Position<Matrix<f32, Const<1>, Const<1>, ArrayStorage<f32, 1, 1>>> for Langevin1DF32
impl Position<Matrix<f32, Const<1>, Const<1>, ArrayStorage<f32, 1, 1>>> for Langevin1DF32
Source§impl PyClass for Langevin1DF32
impl PyClass for Langevin1DF32
Source§impl PyClassImpl for Langevin1DF32
impl PyClassImpl for Langevin1DF32
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
#[pyclass(immutable_type)]
Source§const RAW_DOC: &'static CStr = c"Langevin dynamics\n\n# Parameters & Variables\n| Symbol | Struct Field | Description |\n|:---:| --- | --- |\n| $M$ | `mass` | Mass of the particle. |\n| $\\gamma$ | `damping` | Damping constant |\n| $k_BT$ | `kb_temperature` | Product of temperature $T$ and Boltzmann constant $k_B$. |\n| | | |\n| $\\vec{X}$ | `pos` | Position of the particle. |\n| $\\dot{\\vec{X}}$ | `vel` | Velocity of the particle. |\n| $R(t)$ | (automatically generated) | Gaussian process |\n\n# Equations\n\n\\\\begin{equation}\n M \\ddot{\\mathbf{X}} = - \\mathbf{\\nabla} U(\\mathbf{X}) - \\gamma M\\dot{\\mathbf{X}} + \\sqrt{2 M \\gamma k_{\\rm B} T}\\mathbf{R}(t)\n\\\\end{equation}\x00"
const RAW_DOC: &'static CStr = c"Langevin dynamics\n\n# Parameters & Variables\n| Symbol | Struct Field | Description |\n|:---:| --- | --- |\n| $M$ | `mass` | Mass of the particle. |\n| $\\gamma$ | `damping` | Damping constant |\n| $k_BT$ | `kb_temperature` | Product of temperature $T$ and Boltzmann constant $k_B$. |\n| | | |\n| $\\vec{X}$ | `pos` | Position of the particle. |\n| $\\dot{\\vec{X}}$ | `vel` | Velocity of the particle. |\n| $R(t)$ | (automatically generated) | Gaussian process |\n\n# Equations\n\n\\\\begin{equation}\n M \\ddot{\\mathbf{X}} = - \\mathbf{\\nabla} U(\\mathbf{X}) - \\gamma M\\dot{\\mathbf{X}} + \\sqrt{2 M \\gamma k_{\\rm B} T}\\mathbf{R}(t)\n\\\\end{equation}\x00"
Docstring for the class provided on the struct or enum. Read more
Source§const DOC: &'static CStr
const DOC: &'static CStr
Fully rendered class doc, including the
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<Langevin1DF32>
type ThreadChecker = SendablePyClass<Langevin1DF32>
This handles following two situations: Read more
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature for Langevin1DF32
impl PyClassNewTextSignature for Langevin1DF32
const TEXT_SIGNATURE: &'static str = "(pos, vel, mass, damping, kb_temperature)"
Source§impl PyMethods<Langevin1DF32> for PyClassImplCollector<Langevin1DF32>
impl PyMethods<Langevin1DF32> for PyClassImplCollector<Langevin1DF32>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for Langevin1DF32
impl PyTypeInfo for Langevin1DF32
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
Returns the safe abstraction over the type object.
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
Checks if
object is an instance of this type.Source§impl RelativeEq for Langevin1DF32
impl RelativeEq for Langevin1DF32
Source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
Source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
The inverse of [
RelativeEq::relative_eq].Source§impl Serialize for Langevin1DF32
impl Serialize for Langevin1DF32
Source§impl Velocity<Matrix<f32, Const<1>, Const<1>, ArrayStorage<f32, 1, 1>>> for Langevin1DF32
impl Velocity<Matrix<f32, Const<1>, Const<1>, ArrayStorage<f32, 1, 1>>> for Langevin1DF32
impl DerefToPyAny for Langevin1DF32
impl ExtractPyClassWithClone for Langevin1DF32
impl StructuralPartialEq for Langevin1DF32
Auto Trait Implementations§
impl Freeze for Langevin1DF32
impl RefUnwindSafe for Langevin1DF32
impl Send for Langevin1DF32
impl Sync for Langevin1DF32
impl Unpin for Langevin1DF32
impl UnwindSafe for Langevin1DF32
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
Converts
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
Converts
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
Converts
self into a Python object. Read more§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
👎Deprecated since 0.27.0: Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.
Name of self. This is used in error messages, for example.
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
Returns the expected type as a possible argument for the
isinstance and issubclass function. Read more§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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.