castep_param_io/param/electro_min/
metals_method.rs1use castep_param_derive::KeywordDisplay;
2use serde::{Deserialize, Serialize};
3
4use super::FixOccupancy;
5
6#[derive(
7 Debug,
8 Clone,
9 Copy,
10 PartialEq,
11 Eq,
12 PartialOrd,
13 Ord,
14 Hash,
15 Serialize,
16 Deserialize,
17 Default,
18 KeywordDisplay,
19)]
20#[keyword_display(field = "METALS_METHOD")]
21pub enum MetalsMethod {
22 DM,
23 #[default]
24 EDFT,
25}
26
27impl MetalsMethod {
28 pub fn default_value(fix_occupancy: FixOccupancy) -> Self {
29 if !fix_occupancy.value() {
30 Self::DM
31 } else {
32 Self::EDFT
33 }
34 }
35}