Skip to main content

MdConfig

Struct MdConfig 

Source
pub struct MdConfig {
Show 19 fields pub integrator: Integrator, pub zero_com_drift: bool, pub temp_target: f32, pub pressure_target: f32, pub tau_pressure: f32, pub hydrogen_constraint: HydrogenConstraint, pub snapshot_handlers: SnapshotHandlers, pub sim_box: SimBoxInit, pub solvent: Solvent, pub max_init_relaxation_iters: Option<usize>, pub neighbor_skin: f32, pub overrides: MdOverrides, pub water_template_path: Option<String>, pub skip_water_pbc_filter: bool, pub spme_mesh_spacing: f32, pub spme_alpha: f32, pub coulomb_cutoff: f32, pub lj_cutoff: f32, pub energy_minimization_tolerance: f32,
}
Expand description

This is the primary way of configurating an MD run. It’s passed at init, along with the molecule list and FF params.

Fields§

§integrator: Integrator

Defaults to Velocity Verlet.

§zero_com_drift: bool

If enabled, zero the drift in center of mass of the system.

§temp_target: f32

Kelvin. Defaults to 310 K.

§pressure_target: f32

Bar (Pa/100). Defaults to 1 bar.

§tau_pressure: f32

ps. Defaults to 5; this is what GROMACS uses.

§hydrogen_constraint: HydrogenConstraint

Allows constraining Hydrogens to be rigid with their bonded atom, using SHAKE and RATTLE algorithms. This allows for higher time steps.

§snapshot_handlers: SnapshotHandlers§sim_box: SimBoxInit§solvent: Solvent§max_init_relaxation_iters: Option<usize>

Prior to the first integrator step, we attempt to relax energy in the system. Use no more than this many iterations to do so. Higher can produce better results, but is slower. If None, don’t relax.

§neighbor_skin: f32

Distance threshold, in Å, used to determine when we rebuild neighbor lists. 2-4Å are common values. Higher values rebuild less often, and have more computationally-intense rebuilds. Rebuild the list if an atom moved > skin/2.

§overrides: MdOverrides§water_template_path: Option<String>

Optional path to a pre-equilibrated water template file. When set, this template is used instead of the built-in 60 Å template. A box-specific template (e.g. 30 Å) is required for accurate initial pressures, because the built-in template is cut from a larger equilibrated cell and lacks the long-range Coulomb correlations appropriate for the target PBC cell size. Generate one with the generate_water_init_template test (marked #[ignore]).

§skip_water_pbc_filter: bool

Skip the PBC-boundary proximity check (2.8 Å cross-boundary O-O filter) when placing water molecules. Use this only when generating a pre-equilibrated template at the correct density: the ~88 boundary molecules that the filter would otherwise reject are needed to reach 1 g/cm³, and the MD equilibration run will push them to their natural distances.

§spme_mesh_spacing: f32

SPME mesh spacing in Å. Smaller = higher-resolution reciprocal mesh, more accurate but slower. 1.0 Å is a good default; equivalent to GROMACS fourierspacing = 0.1 nm.

§spme_alpha: f32

A bigger α means more damping, and a smaller real-space contribution. (Cheaper real), but larger reciprocal load. Common rule for α: erfc(α r_c) ≲ 10⁻⁴…10⁻⁵ Å^-1. 0.35 is good for cutoff of 10–12 Å.

§coulomb_cutoff: f32

The distance at which we cut off short-range (Direct) Coulomb operations, and transtion to SPME reciprical forces. Å

§lj_cutoff: f32

A hard distance cutoff for VDW forces. Å

§energy_minimization_tolerance: f32

Simliar to GROMACS’ emtol. kcal mol⁻¹ Å⁻¹

Implementations§

Source§

impl MdConfig

Source

pub fn to_gromacs(&self, n_steps: usize, dt: f32) -> MdpParams

Creates a similar config for use with GROMACS. Attempts to replicate this library’s settings where we don’t have an applicable MdConfig field.

Not From trait: This lib depends on bio_files, but not the other way around.

Source

pub fn save_mdp(&self, path: &Path, n_steps: usize, dt: f32) -> Result<()>

Convenience function to save in Gromacs’ .mdp format.

Source

pub fn load_from_mdp(path: &Path) -> Result<Self>

Trait Implementations§

Source§

impl Clone for MdConfig

Source§

fn clone(&self) -> MdConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MdConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MdConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl From<MdpParams> for MdConfig

Source§

fn from(p: MdpParams) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for MdConfig

Source§

fn eq(&self, other: &MdConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for MdConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,