castep_param_io/param/pseudopotentials/
relativistic_treatment.rs

1use std::fmt::Display;
2
3use serde::{Deserialize, Serialize};
4
5use crate::param::KeywordDisplay;
6
7/// Selects the method used to treat relativistic effects. This functionality is implemented for on-the-fly generated pseudopotentials, so this keyword has no effect when pseudopotentials are read from a file.
8/// Available options are:
9/// - SCHROEDINGER - this option produces completely non-relativistic pseudopotentials.
10/// - ZORA - scalar relativistic treatment, which is equivalent to the zeroth-order expansion of the Koelling-Harmon equation.
11/// - KOELLING-HARMON - scalar relativistic treatment.
12/// - DIRAC - fully relativistic treatment.
13/// # Default
14/// `KOELLING-HARMON`
15/// # Example
16/// `RELATIVISTIC_TREATMENT : ZORA`
17#[derive(
18    Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, Hash, Default,
19)]
20pub enum RelativisticTreatment {
21    Schroedinger,
22    Zora,
23    #[default]
24    KoellingHarmon,
25    Dirac,
26}
27
28impl Display for RelativisticTreatment {
29    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
30        match self {
31            RelativisticTreatment::Schroedinger => f.write_str("sCHROEDINGER"),
32            RelativisticTreatment::Zora => f.write_str("ZORA"),
33            RelativisticTreatment::KoellingHarmon => f.write_str("KOELLING-HARMON"),
34            RelativisticTreatment::Dirac => f.write_str("DIRAC"),
35        }
36    }
37}
38
39impl KeywordDisplay for RelativisticTreatment {
40    fn field(&self) -> String {
41        "RELATIVISTIC_TREATMENT".to_string()
42    }
43}