castep_param_io/param/geom_opt/
geom_energy_tol.rs

1use castep_param_derive::KeywordDisplayStruct;
2use derive_builder::Builder;
3use serde::{Deserialize, Serialize};
4
5use crate::param::EnergyUnit;
6
7#[derive(
8    Debug, Clone, Copy, PartialEq, PartialOrd, Serialize, Deserialize, KeywordDisplayStruct, Builder,
9)]
10#[builder(setter(into, strip_option), default)]
11#[keyword_display(field = "GEOM_ENERGY_TOL", display_format = "{:20.15} {}", from=f64, default_value=2e-5)]
12/// This keyword controls the tolerance for accepting convergence of the free energy
13/// per atom during a geometry optimization.
14/// # Note
15/// The difference between maximum and minimum values of the free energy over
16/// GEOM_CONVERGENCE_WIN iterations must be less than this value.
17/// # Default
18/// 2×10-5 eV per atom
19/// # Example
20/// `GEOM_ENERGY_TOL : 0.00005 eV`
21pub struct GeomEnergyTol {
22    pub tol: f64,
23    #[keyword_display(is_option = true)]
24    pub unit: Option<EnergyUnit>,
25}