[−]Struct lumol::TableComputation
Computation of a potential using tabulated values.
This can be faster than direct computation for smooth potentials, but will
uses more memory and be less precise than direct computation. Values are
tabulated in the [0, max)
range, and a cutoff is applied after max
.
Implementations
impl TableComputation
pub fn new(
potential: Box<dyn PairPotential + 'static, Global>,
size: usize,
max: f64
) -> TableComputation
potential: Box<dyn PairPotential + 'static, Global>,
size: usize,
max: f64
) -> TableComputation
Create a new TableComputation
for potential
, with size
points and
a maximum value of max
.
Examples
use lumol_core::energy::TableComputation; use lumol_core::energy::Harmonic; let potential = Box::new(Harmonic{x0: 0.5, k: 4.2}); let table = TableComputation::new(potential, 1000, 2.0); assert_eq!(table.energy(1.0), 0.525); assert_eq!(table.energy(3.0), 0.0);
Trait Implementations
impl Clone for TableComputation
pub fn clone(&self) -> TableComputation
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Computation for TableComputation
pub fn compute_energy(&self, r: f64) -> f64
pub fn compute_force(&self, r: f64) -> f64
impl FromTomlWithData for TableComputation
type Data = Box<dyn PairPotential + 'static, Global>
The type of the additional data needed.
pub fn from_toml(
table: &Map<String, Value>,
potential: Box<dyn PairPotential + 'static, Global>
) -> Result<TableComputation, Error>
table: &Map<String, Value>,
potential: Box<dyn PairPotential + 'static, Global>
) -> Result<TableComputation, Error>
impl PairPotential for TableComputation
pub fn tail_energy(&self, cutoff: f64) -> f64
pub fn tail_virial(&self, cutoff: f64) -> f64
fn virial(&self, r: &Vector3D) -> Matrix3
Auto Trait Implementations
impl !RefUnwindSafe for TableComputation
impl Send for TableComputation
impl Sync for TableComputation
impl Unpin for TableComputation
impl !UnwindSafe for TableComputation
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<P> Potential for P where
P: 'static + Computation + Clone,
P: 'static + Computation + Clone,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,