[]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.

Methods

impl 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 Computation for TableComputation

Compute the energy value at r

Compute the force value at r

impl PairPotential for TableComputation

Compute the tail correction to the energy for the given cutoff. Read more

Compute the tail correction to the virial for the given cutoff. Read more

Compute the virial contribution corresponding to the distance r between the particles. Read more

impl Clone for TableComputation

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl FromTomlWithData for TableComputation

The type of the additional data needed.

Do the conversion from table and data to Self.

Auto Trait Implementations

impl Send for TableComputation

impl Sync for TableComputation

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Important traits for &'a mut R

Immutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Important traits for &'a mut R

Mutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

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

Get the energy corresponding to the variable x

Get the force norm corresponding to the variable x