use std::path::PathBuf;
use crate::control_input::{BandInput, FullSpectrumInput, OpconsInput, ReciprocalInput};
use crate::global_input::CfAverage;
use crate::screen_input::ScreenInput;
use crate::sfconv_input::SfconvInput;
use crate::xsph_input::XsphAdvanced;
#[derive(Debug, Clone, PartialEq)]
pub struct FeffDocument {
pub source: PathBuf,
pub active_cards: Vec<String>,
pub input_cards: Vec<String>,
pub titles: Vec<String>,
pub edge: Option<Edge>,
pub hole: Option<i32>,
pub s02: Option<f64>,
pub corrections: [f64; 2],
pub chsh_type: i32,
pub xsph_handoff: XsphHandoffControls,
pub xsph_advanced: XsphAdvanced,
pub cfaverage: CfAverage,
pub corval_emin: f64,
pub control: Option<[i32; 6]>,
pub print: Option<[i32; 6]>,
pub scf: Option<Scf>,
pub exchange: Option<Exchange>,
pub exafs: Option<Exafs>,
pub spectrum_grid: SpectrumGrid,
pub reciprocal: bool,
pub cif_equivalence: i32,
pub coordinate_mode: i32,
pub reciprocal_input: Option<ReciprocalInput>,
pub band_input: BandInput,
pub full_spectrum_input: FullSpectrumInput,
pub screen_input: ScreenInput,
pub i_grid: i32,
pub egrid_records: Vec<String>,
pub density_records: Vec<String>,
pub electronic_temperature: f64,
pub iscfxc: i32,
pub rgrid: f64,
pub critcw: f64,
pub critpw: f64,
pub pcritk: f64,
pub pcrith: f64,
pub lreal: i32,
pub iorder: i32,
pub nstar: bool,
pub i_plsmn: i32,
pub n_poles: i32,
pub opcons: bool,
pub opcons_input: OpconsInput,
pub sfconv: bool,
pub sfconv_input: SfconvInput,
pub many_body_convolution: bool,
pub fine_structure_damping: FineStructureDamping,
pub unfreezef: bool,
pub external_pot: bool,
pub restart_from_pot_bin: bool,
pub config_type: i32,
pub config_records: Vec<String>,
pub warn_ion: bool,
pub finite_nucleus: bool,
pub scf_thermal: ScfThermal,
pub scf_ramp: ScfRamp,
pub scf_tolerances: ScfTolerances,
pub nohole: i32,
pub jump_removal: bool,
pub ispec: i32,
pub ipol: i32,
pub le2: i32,
pub l2lp: i32,
pub ellipticity: f64,
pub polarization_vector: [f64; 3],
pub incidence_vector: [f64; 3],
pub spin: i32,
pub spin_vector: [f64; 3],
pub absolute: bool,
pub fms: Option<Fms>,
pub crpa: Crpa,
pub compton: Compton,
pub hubbard: Hubbard,
pub eels: Eels,
pub rixs: Rixs,
pub nrixs: Option<Nrixs>,
pub mdff: Mdff,
pub debye: Option<Debye>,
pub spring_input_text: Option<String>,
pub dym_input: Option<AuxiliaryTextFile>,
pub rpath: Option<f64>,
pub nleg: Option<i32>,
pub path_symmetry: i32,
pub no_geom: bool,
pub r_multiplier: f64,
pub dims: Option<DimensionLimits>,
pub ldos: Option<Ldos>,
pub interstitial: Option<Interstitial>,
pub afolp: f64,
pub overlap_factors: Vec<OverlapFactor>,
pub ionizations: Vec<Ionization>,
pub overlap_shells: Vec<OverlapShell>,
pub single_scattering_paths: Vec<SingleScatteringPath>,
pub potentials: Vec<Potential>,
pub atoms: Vec<Atom>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Edge {
pub label: String,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Scf {
pub radius: f64,
pub lfms: i32,
pub iterations: i32,
pub ca: f64,
pub nmix: i32,
pub ecv: f64,
pub icoul: i32,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Exchange {
pub ixc: i32,
pub vr0: f64,
pub vi0: f64,
pub ixc0: Option<i32>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Exafs {
pub xkmax: f64,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct SpectrumGrid {
pub ixc0: i32,
pub xkstep: f64,
pub xkmax: f64,
pub vixan: f64,
}
impl Default for SpectrumGrid {
fn default() -> Self {
Self {
ixc0: 0,
xkstep: 0.07,
xkmax: 20.0,
vixan: 0.0,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct FineStructureDamping {
pub alphat: f64,
pub thetae: f64,
pub sig2g: f64,
pub sig_gk: f64,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct XsphHandoffControls {
pub core_hole_broadening: i32,
pub core_state: i32,
pub eps0: f64,
pub egap: f64,
pub core_hole_width: Option<f64>,
pub set_edge: bool,
pub print_radial_wavefunctions: bool,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Fms {
pub radius: f64,
pub lfms: i32,
pub minv: i32,
pub toler1: f64,
pub toler2: f64,
pub rdirec: f64,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Crpa {
pub enabled: bool,
pub l: i32,
pub rcut: f64,
}
impl Default for Crpa {
fn default() -> Self {
Self {
enabled: false,
l: 3,
rcut: 1.600_000_023_841_858,
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub struct Compton {
pub do_compton: bool,
pub do_rhozzp: bool,
pub force_jzzp: bool,
pub pqmax: f64,
pub npq: i32,
pub ns: i32,
pub nphi: i32,
pub nz: i32,
pub nzp: i32,
pub zpmax: f64,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Hubbard {
pub i_hubbard: i32,
pub mldos_hubb: i32,
pub u: f64,
pub j: f64,
pub fermi_shift: f64,
pub l: i32,
}
impl Default for Hubbard {
fn default() -> Self {
Self {
i_hubbard: 1,
mldos_hubb: 1,
u: 0.0,
j: 0.0,
fermi_shift: 0.0,
l: 0,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Eels {
pub enabled: bool,
pub average: i32,
pub relativistic: i32,
pub cross_terms: i32,
pub input: i32,
pub spectrum_column: i32,
pub polarization_min: i32,
pub polarization_step: i32,
pub polarization_max: i32,
pub beam_energy: f64,
pub beam_direction: [f64; 3],
pub collection_angle: f64,
pub convergence_angle: f64,
pub qmesh_radial: i32,
pub qmesh_angular: i32,
pub detector: [f64; 2],
pub magic: i32,
pub magic_energy: f64,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Rixs {
pub run: bool,
pub gamma_exp: [Option<f64>; 2],
pub xmu: Option<f64>,
pub read_poles: bool,
pub skip_calc: bool,
pub mbconv: bool,
pub read_sigma: bool,
pub edges: Vec<String>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Nrixs {
pub nq: i32,
pub qaverage: bool,
pub qvec: [f64; 3],
pub qnorm: f64,
pub q_vectors: Vec<NrixsQVector>,
pub ldecmx: i32,
pub lj: i32,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct NrixsQVector {
pub vector: [f64; 3],
pub norm: f64,
pub weight: [f64; 2],
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Mdff {
pub imdff: i32,
pub qqmdff: f64,
pub cosmdff_angle: f64,
}
impl Default for Eels {
fn default() -> Self {
Self {
enabled: false,
average: 0,
relativistic: 1,
cross_terms: 1,
input: 1,
spectrum_column: 4,
polarization_min: 1,
polarization_step: 1,
polarization_max: 1,
beam_energy: 0.0,
beam_direction: [0.0; 3],
collection_angle: 0.0,
convergence_angle: 0.0,
qmesh_radial: 0,
qmesh_angular: 0,
detector: [0.0; 2],
magic: 0,
magic_energy: 0.0,
}
}
}
impl Default for Rixs {
fn default() -> Self {
Self {
run: false,
gamma_exp: [None, None],
xmu: None,
read_poles: true,
skip_calc: false,
mbconv: false,
read_sigma: false,
edges: vec!["NULL".to_string()],
}
}
}
impl Default for Compton {
fn default() -> Self {
Self {
do_compton: false,
do_rhozzp: false,
force_jzzp: false,
pqmax: 5.0,
npq: 1000,
ns: 32,
nphi: 32,
nz: 32,
nzp: 144,
zpmax: 10.0,
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub struct Debye {
pub temperature: f64,
pub debye_temperature: f64,
pub idwopt: i32,
pub requested_idwopt: i32,
pub dym_file: Option<String>,
pub dmdw_order: i32,
pub dmdw_type: i32,
pub dmdw_route: i32,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct AuxiliaryTextFile {
pub output_name: String,
pub text: String,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Ldos {
pub emin: f64,
pub emax: f64,
pub eimag: f64,
pub neldos: i32,
pub ldostype: i32,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Interstitial {
pub mode: i32,
pub volume_scale: f64,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ScfThermal {
pub iscfth: i32,
pub xntol: f64,
pub nmu: i32,
pub negrid: i32,
pub emaxscf: f64,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ScfRamp {
pub enabled: bool,
pub rfms_start: f64,
pub nramp: i32,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct ScfTolerances {
pub tolmu: f64,
pub tolq: f64,
pub tolqp: f64,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct DimensionLimits {
pub nclusx: i32,
pub lx: i32,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct OverlapFactor {
pub potential_index: i32,
pub factor: f64,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Ionization {
pub potential_index: i32,
pub value: f64,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct OverlapShell {
pub potential_index: i32,
pub neighbor_potential_index: i32,
pub count: i32,
pub distance: f64,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct SingleScatteringPath {
pub index: i32,
pub potential_index: i32,
pub degeneracy: f64,
pub distance: f64,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Potential {
pub ipot: i32,
pub z: Option<i32>,
pub z_token: String,
pub tag: Option<String>,
pub lmax1: Option<i32>,
pub lmax2: Option<i32>,
pub xnatph: Option<f64>,
pub spinph: Option<f64>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Atom {
pub x: f64,
pub y: f64,
pub z: f64,
pub ipot: i32,
pub tag: Option<String>,
pub distance: Option<f64>,
pub index: Option<usize>,
}