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: IntegratorDefaults to Velocity Verlet.
zero_com_drift: boolLegacy on/off switch for COM motion removal.
Use together with com_motion_removal and com_removal_interval.
com_motion_removal: ComMotionRemovalGROMACS-style COM-motion removal mode.
com_removal_interval: usizeInterval, in steps, for COM-motion removal. GROMACS defaults to 100.
temp_target: f32Kelvin. Defaults to 310 K.
barostat_cfg: Option<BarostatCfg>None to disable it.
hydrogen_constraint: HydrogenConstraintAllows 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: SimBoxInitSets 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: f32Simliar to GROMACS’ emtol. kcal mol⁻¹ Å⁻¹
neighbor_skin: f32Distance 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: SolventTemplateTypeOptional 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: boolSkip 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: f32SPME 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: f32A 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: f32The distance at which we cut off short-range (Direct) Coulomb operations, and transtion to SPME reciprical forces. Å
lj_cutoff: f32A hard distance cutoff for VDW forces. Å
recenter_sim_box: boolIf 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: MdOverridesImplementations§
Source§impl MdConfig
impl MdConfig
Sourcepub fn to_gromacs(&self, n_steps: usize, dt: f32) -> MdpParams
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.
Sourcepub fn save_mdp(&self, path: &Path, n_steps: usize, dt: f32) -> Result<()>
pub fn save_mdp(&self, path: &Path, n_steps: usize, dt: f32) -> Result<()>
Convenience function to save in Gromacs’ .mdp format.
pub fn load_from_mdp(path: &Path) -> Result<Self>
Trait Implementations§
impl StructuralPartialEq for MdConfig
Auto Trait Implementations§
impl Freeze for MdConfig
impl RefUnwindSafe for MdConfig
impl Send for MdConfig
impl Sync for MdConfig
impl Unpin for MdConfig
impl UnsafeUnpin for MdConfig
impl UnwindSafe for MdConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.