|
| 1 | +from dataclasses import dataclass |
| 2 | +import numpy as np |
| 3 | +from typing import Optional, List |
| 4 | + |
| 5 | + |
| 6 | +@dataclass |
| 7 | +class DensityOfStates: |
| 8 | + energies: str |
| 9 | + int_densities: str |
| 10 | + tot_densities: str |
| 11 | + |
| 12 | + |
| 13 | +@dataclass |
| 14 | +class ElectronicStructure: |
| 15 | + efermi: float |
| 16 | + eig_matrix: np.ndarray |
| 17 | + k_points: np.ndarray |
| 18 | + k_weights: np.ndarray |
| 19 | + occ_matrix: np.ndarray |
| 20 | + dos: DensityOfStates |
| 21 | + |
| 22 | + |
| 23 | +@dataclass |
| 24 | +class OutputGenericDFT: |
| 25 | + energy_free: np.ndarray |
| 26 | + energy_int: np.ndarray |
| 27 | + energy_zero: np.ndarray |
| 28 | + scf_energy_free: np.ndarray |
| 29 | + scf_energy_int: np.ndarray |
| 30 | + scf_energy_zero: np.ndarray |
| 31 | + cbm_list: Optional[np.ndarray] |
| 32 | + e_fermi_list: Optional[np.ndarray] |
| 33 | + final_magmoms: Optional[np.ndarray] |
| 34 | + magnetization: Optional[np.ndarray] |
| 35 | + n_elect: Optional[float] |
| 36 | + n_valence: Optional[dict] |
| 37 | + potentiostat_output: Optional[np.ndarray] |
| 38 | + bands_k_weights: Optional[np.ndarray] |
| 39 | + kpoints_cartesian: Optional[np.ndarray] |
| 40 | + bands_e_fermi: Optional[np.ndarray] |
| 41 | + bands_occ: Optional[np.ndarray] |
| 42 | + bands_eigen_values: Optional[np.ndarray] |
| 43 | + scf_convergence: Optional[List[bool]] |
| 44 | + scf_dipole_mom: Optional[np.ndarray] |
| 45 | + scf_computation_time: Optional[np.ndarray] |
| 46 | + valence_charges: Optional[np.ndarray] |
| 47 | + vbm_list: Optional[np.ndarray] |
| 48 | + bands: Optional[ElectronicStructure] |
| 49 | + scf_energy_band: Optional[np.ndarray] |
| 50 | + scf_electronic_entropy: Optional[np.ndarray] |
| 51 | + scf_residue: Optional[np.ndarray] |
| 52 | + computation_time: Optional[np.ndarray] |
| 53 | + energy_band: Optional[np.ndarray] |
| 54 | + electronic_entropy: Optional[np.ndarray] |
| 55 | + residue: Optional[np.ndarray] |
| 56 | + |
| 57 | + |
| 58 | +@dataclass |
| 59 | +class GenericOutput: |
| 60 | + cells: np.ndarray # N_steps * 3 *3 [Angstrom] |
| 61 | + energy_pot: np.ndarray # N_steps [eV] |
| 62 | + energy_tot: np.ndarray # N_steps [eV] |
| 63 | + forces: np.ndarray # N_steps * N_atoms * 3 [eV/Angstrom] |
| 64 | + positions: np.ndarray # N_steps * N_atoms * 3 [Angstrom] |
| 65 | + volume: np.ndarray # N_steps |
| 66 | + indices: Optional[np.ndarray] # N_steps * N_atoms |
| 67 | + natoms: Optional[np.ndarray] # N_steps |
| 68 | + pressures: Optional[np.ndarray] # N_steps * 3 * 3 |
| 69 | + steps: Optional[np.ndarray] # N_steps |
| 70 | + stresses: Optional[np.ndarray] # N_steps |
| 71 | + temperature: Optional[np.ndarray] # N_steps |
| 72 | + unwrapped_positions: Optional[np.ndarray] # N_steps * N_atoms * 3 [Angstrom] |
| 73 | + velocities: Optional[np.ndarray] # N_steps * N_atoms * 3 [Angstrom/fs] |
| 74 | + dft: Optional[OutputGenericDFT] |
| 75 | + elastic_constants: Optional[np.ndarray] |
| 76 | + |
| 77 | + |
| 78 | +@dataclass |
| 79 | +class ChargeDensity: |
| 80 | + total: np.ndarray |
| 81 | + |
| 82 | + |
| 83 | +@dataclass |
| 84 | +class Server: |
| 85 | + user: str |
| 86 | + host: str |
| 87 | + run_mode: str |
| 88 | + cores: int |
| 89 | + threads: int |
| 90 | + new_h5: bool |
| 91 | + accept_crash: bool |
| 92 | + run_time: int # [seconds] |
| 93 | + structure_id: Optional[int] |
| 94 | + memory_limit: Optional[str] |
| 95 | + queue: Optional[str] |
| 96 | + qid: Optional[int] |
| 97 | + |
| 98 | + |
| 99 | +@dataclass |
| 100 | +class Executable: |
| 101 | + version: str |
| 102 | + name: str |
| 103 | + operation_system_nt: bool |
| 104 | + executable: Optional[str] |
| 105 | + mpi: bool |
| 106 | + accepted_return_codes: List[int] |
| 107 | + |
| 108 | + |
| 109 | +@dataclass |
| 110 | +class GenericDict: |
| 111 | + restart_file_list: list |
| 112 | + restart_file_dict: dict |
| 113 | + exclude_nodes_hdf: list |
| 114 | + exclude_groups_hdf: list |
| 115 | + |
| 116 | + |
| 117 | +@dataclass |
| 118 | +class Interactive: |
| 119 | + interactive_flush_frequency: int |
| 120 | + interactive_write_frequency: int |
| 121 | + |
| 122 | + |
| 123 | +@dataclass |
| 124 | +class GenericInput: |
| 125 | + calc_mode: str |
| 126 | + structure: str |
| 127 | + fix_symmetry: Optional[bool] |
| 128 | + k_mesh_spacing: Optional[float] |
| 129 | + k_mesh_center_shift: Optional[np.ndarray] |
| 130 | + reduce_kpoint_symmetry: Optional[bool] |
| 131 | + restart_for_band_structure: Optional[bool] |
| 132 | + path_name: Optional[str] |
| 133 | + n_path: Optional[str] |
| 134 | + fix_spin_constraint: Optional[bool] |
| 135 | + max_iter: Optional[int] |
| 136 | + temperature: Optional[float] |
| 137 | + n_ionic_steps: Optional[int] |
| 138 | + n_print: Optional[int] |
| 139 | + temperature_damping_timescale: Optional[float] |
| 140 | + pressure_damping_timescale: Optional[float] |
| 141 | + time_step: Optional[int] |
| 142 | + |
| 143 | + |
| 144 | +@dataclass |
| 145 | +class Units: |
| 146 | + length: str |
| 147 | + mass: str |
| 148 | + |
| 149 | + |
| 150 | +@dataclass |
| 151 | +class Cell: |
| 152 | + cell: np.ndarray # 3 * 3 [Angstrom] |
| 153 | + pbc: np.ndarray # 3 |
| 154 | + |
| 155 | + |
| 156 | +@dataclass |
| 157 | +class Structure: |
| 158 | + dimension: int |
| 159 | + indices: np.array |
| 160 | + info: dict |
| 161 | + positions: np.ndarray # N_atoms * 3 [Angstrom] |
| 162 | + species: List[str] |
| 163 | + cell: Cell |
| 164 | + units: Units |
0 commit comments