castep_param_io/param/electro_min/
elec_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, Serialize, Deserialize, PartialEq, PartialOrd, KeywordDisplayStruct, Builder,
9)]
10#[keyword_display(field = "ELEC_ENERGY_TOL", display_format = "{:20.15e} {}", from=f64, default_value=1e-5 )]
11#[builder(setter(into), default)]
12/// This keyword controls the tolerance for accepting convergence of the total
13/// energy in an electronic minimization.
14/// # Note
15/// The difference between maximum and minimum energies over ELEC_CONVERGENCE_WIN
16/// iterations must be less than this value.
17/// # Default
18/// 1x10-5 eV per atom
19pub struct ElecEnergyTol {
20    pub tol: f64,
21    #[keyword_display(is_option = true)]
22    pub unit: Option<EnergyUnit>,
23}