[]Struct lumol::energy::TableComputation

pub struct TableComputation { /* fields omitted */ }

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.


impl TableComputation

pub fn new(
    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.


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

impl Computation for TableComputation

impl FromTomlWithData for TableComputation

type Data = Box<dyn PairPotential + 'static, Global>

The type of the additional data needed.

impl PairPotential for TableComputation

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<P> Potential for P where
    P: 'static + Computation + Clone

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,