Skip to main content

MdConfig

Struct MdConfig 

Source
pub struct MdConfig {
Show 21 fields pub integrator: Integrator, pub zero_com_drift: bool, pub com_motion_removal: ComMotionRemoval, pub com_removal_interval: usize, pub temp_target: f32, pub barostat_cfg: Option<BarostatCfg>, pub hydrogen_constraint: HydrogenConstraint, pub snapshot_handlers: SnapshotHandlers, pub sim_box: SimBoxInit, pub solvent: Solvent, pub max_init_relaxation_iters: Option<usize>, pub energy_minimization_tolerance: f32, pub neighbor_skin: f32, pub solvent_template_type: SolventTemplateType, pub skip_water_pbc_filter: bool, pub spme_mesh_spacing: f32, pub spme_alpha: f32, pub coulomb_cutoff: f32, pub lj_cutoff: f32, pub recenter_sim_box: bool, pub overrides: MdOverrides,
}
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

Legacy on/off switch for COM motion removal. Use together with com_motion_removal and com_removal_interval.

§com_motion_removal: ComMotionRemoval

GROMACS-style COM-motion removal mode.

§com_removal_interval: usize

Interval, in steps, for COM-motion removal. GROMACS defaults to 100.

§temp_target: f32

Kelvin. Defaults to 310 K.

§barostat_cfg: Option<BarostatCfg>

None to disable it.

§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

Sets the bounds for the entire simulation. This is used both to populate the solvent, and to set periodic boundary conditions for SPME computatations and general wrapping/min-image.

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

§energy_minimization_tolerance: f32

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

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

§solvent_template_type: SolventTemplateType

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. Å

§recenter_sim_box: bool

If enabled, keep the cell centered on the dynamic atoms at init and during the run. Disable this for pulling / driven systems where you want the box to remain fixed.

§overrides: MdOverrides

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 (const: unstable) · 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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
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> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

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