|
RadCluster
Graph-based cluster dynamics for irradiated materials
|
Functions | |
| latin_hypercube (n_samples, n_dims, rng) | |
| unit_to_physical (u, spec) | |
| physical_to_unit (val, spec) | |
| sample_to_params (unit_vec) | |
| atoms_to_loop_diameter_nm (mean_n_i) | |
| atoms_to_void_diameter_nm (mean_n_v) | |
| evaluate_cost (results, sim) | |
| run_single (params, timeout_s=180, run_id=0) | |
| append_log (log_path, row_dict) | |
| build_row (run_id, phase, params, cost, metrics, wall) | |
| main () | |
Variables | |
| SCRIPT_DIR = Path(__file__).resolve().parent | |
| BASE_DIR = SCRIPT_DIR.parent.parent | |
| float | OMEGA = 1.18e-29 |
| float | B_111 = 2.482e-10 |
| list | PARAM_SPEC |
| list | PARAM_NAMES = [p[0] for p in PARAM_SPEC] |
| float | TARGET_DOSE = 10.0 |
| float | TARGET_N_LOOPS = 1.0e22 |
| float | TARGET_D_I_NM = 10.0 |
| float | TARGET_N_VOIDS = 4.0e21 |
| float | TARGET_D_V_NM = 3.0 |
| int | N_MIN_TEM = 10 |
| tuple | LOG_FIELDS |
calibrate.py — Autonomous parameter calibration for RadCluster_2_1.
Explores the parameter space using Latin Hypercube Sampling, runs bin-moment
cluster dynamics simulations via the C++ solver, and identifies parameter
combinations that match experimental TEM data at 10 dpa for EUROFER97:
SIA loop density ~ 10^22 m^-3 diameter ~ 10 nm
Void density ~ 3-5 x 10^21 m^-3 diameter ~ 2-4 nm
Usage
-----
cd radcluster_code
python codes/calibrate.py # default 20 + 10 runs
python codes/calibrate.py --phase1 30 # more exploration
python codes/calibrate.py --timeout 120 # 2 min per run
| calibrate.append_log | ( | log_path, | |
| row_dict | |||
| ) |
Append one row to the CSV log, creating headers if needed.
Definition at line 314 of file calibrate.py.
| calibrate.atoms_to_loop_diameter_nm | ( | mean_n_i | ) |
Convert mean SIA cluster size (atoms) to loop diameter (nm).
Definition at line 115 of file calibrate.py.
| calibrate.atoms_to_void_diameter_nm | ( | mean_n_v | ) |
Convert mean vacancy cluster size (atoms) to void diameter (nm).
Definition at line 123 of file calibrate.py.
| calibrate.build_row | ( | run_id, | |
| phase, | |||
| params, | |||
| cost, | |||
| metrics, | |||
| wall | |||
| ) |
Assemble a log row dict.
Definition at line 324 of file calibrate.py.
| calibrate.evaluate_cost | ( | results, | |
| sim | |||
| ) |
Compute scalar cost measuring deviation from experimental targets at TARGET_DOSE dpa. Uses TEM-visible clusters only (n,m >= N_MIN_TEM). Returns (cost, metrics_dict) or (inf, None) on failure.
Definition at line 131 of file calibrate.py.
| calibrate.latin_hypercube | ( | n_samples, | |
| n_dims, | |||
| rng | |||
| ) |
Simple LHS: stratified random in [0,1]^d.
Definition at line 62 of file calibrate.py.
| calibrate.main | ( | ) |
Definition at line 340 of file calibrate.py.
| calibrate.physical_to_unit | ( | val, | |
| spec | |||
| ) |
Map physical value back to [0,1].
Definition at line 83 of file calibrate.py.
| calibrate.run_single | ( | params, | |
timeout_s = 180, |
|||
run_id = 0 |
|||
| ) |
Run one simulation with the given parameter dict. Returns (cost, metrics, wall_time) or (inf, None, wall_time).
Definition at line 239 of file calibrate.py.
| calibrate.sample_to_params | ( | unit_vec | ) |
Convert a [0,1]^d vector to a dict of physical parameters.
Definition at line 94 of file calibrate.py.
| calibrate.unit_to_physical | ( | u, | |
| spec | |||
| ) |
Map u in [0,1] to physical value according to spec.
Definition at line 72 of file calibrate.py.
| float calibrate.B_111 = 2.482e-10 |
Definition at line 33 of file calibrate.py.
| calibrate.BASE_DIR = SCRIPT_DIR.parent.parent |
Definition at line 26 of file calibrate.py.
| tuple calibrate.LOG_FIELDS |
Definition at line 306 of file calibrate.py.
| int calibrate.N_MIN_TEM = 10 |
Definition at line 112 of file calibrate.py.
| float calibrate.OMEGA = 1.18e-29 |
Definition at line 32 of file calibrate.py.
| list calibrate.PARAM_NAMES = [p[0] for p in PARAM_SPEC] |
Definition at line 59 of file calibrate.py.
| list calibrate.PARAM_SPEC |
Definition at line 40 of file calibrate.py.
| calibrate.SCRIPT_DIR = Path(__file__).resolve().parent |
Definition at line 25 of file calibrate.py.
| float calibrate.TARGET_D_I_NM = 10.0 |
Definition at line 107 of file calibrate.py.
| float calibrate.TARGET_D_V_NM = 3.0 |
Definition at line 109 of file calibrate.py.
| float calibrate.TARGET_DOSE = 10.0 |
Definition at line 105 of file calibrate.py.
| float calibrate.TARGET_N_LOOPS = 1.0e22 |
Definition at line 106 of file calibrate.py.
| float calibrate.TARGET_N_VOIDS = 4.0e21 |
Definition at line 108 of file calibrate.py.