RadCluster
Graph-based cluster dynamics for irradiated materials
Loading...
Searching...
No Matches
Functions | Variables
check_binwise_moments Namespace Reference

Functions

 load (pat)
 

Variables

str OUT = "/Users/ghoni/Documents/GitHub/RadCluster/radcluster_code/output"
 
int I = 1000
 
int NB = int(sys.argv[1]) if len(sys.argv) > 1 else 32
 
 sim
 
 RE = sim.rate_equations
 
 bins = list(RE.bins)
 
 i_d
 
 P
 
 ref = load("*_M1_D1000_*")
 
 bm = load(f"*_M2R_B{NB}_*")
 
 yr = np.asarray(ref["results"]["y"], float)
 
 yb = np.asarray(bm["results"]["y"], float)
 
 C_floor = float(ref["input_data"].reactions.get("C_floor", 1e-15))
 
 jr
 
 jb
 
 c_ref = np.maximum(yr[:I, jr], 0.0)
 
dict tot = {"e0": 0.0, "b0": 0.0, "e1": 0.0, "b1": 0.0}
 
 he = float(np.sum(np.maximum(c_ref[1:i_d] - C_floor, 0.0)))
 
 hb = float(np.sum(np.maximum(yb[1:i_d, jb] - C_floor, 0.0)))
 
 ns = np.arange(2, i_d + 1)
 
 he1 = float(np.dot(ns, np.maximum(c_ref[1:i_d] - C_floor, 0.0)))
 
 hb1 = float(np.dot(ns, np.maximum(yb[1:i_d, jb] - C_floor, 0.0)))
 
 hi = min(nhi, I)
 
 seg = c_ref[nlo - 1:hi]
 
 sizes = np.arange(nlo, hi + 1)
 
 e0 = float(np.dot(sizes, seg))
 
 off = i_d + P * k
 
int b0 = 2 else 0.0
 
tuple d0 = (b0 - e0) / e0 * 100 if e0 else float("nan")
 
tuple d1 = (b1 - e1) / e1 * 100 if e1 else float("nan")
 

Detailed Description

Bin-by-bin comparison, with NO reconstruction anywhere.

Takes the exact arm's per-size 1/2<111> spectrum, SUMS it onto the binned
run's own bin edges to form the exact mu0 and mu1 per bin, and compares those
against the moments the binned run actually carries.  Reconstruction is what
the closure approximates, so comparing reconstructed spectra would measure the
closure twice; comparing moments measures the dynamics alone.

Function Documentation

◆ load()

check_binwise_moments.load (   pat)

Definition at line 22 of file check_binwise_moments.py.

Variable Documentation

◆ b0

int check_binwise_moments.b0 = 2 else 0.0

Definition at line 76 of file check_binwise_moments.py.

◆ bins

check_binwise_moments.bins = list(RE.bins)

Definition at line 37 of file check_binwise_moments.py.

◆ bm

check_binwise_moments.bm = load(f"*_M2R_B{NB}_*")

Definition at line 42 of file check_binwise_moments.py.

◆ C_floor

check_binwise_moments.C_floor = float(ref["input_data"].reactions.get("C_floor", 1e-15))

Definition at line 48 of file check_binwise_moments.py.

◆ c_ref

check_binwise_moments.c_ref = np.maximum(yr[:I, jr], 0.0)

Definition at line 53 of file check_binwise_moments.py.

◆ d0

tuple check_binwise_moments.d0 = (b0 - e0) / e0 * 100 if e0 else float("nan")

Definition at line 77 of file check_binwise_moments.py.

◆ d1

tuple check_binwise_moments.d1 = (b1 - e1) / e1 * 100 if e1 else float("nan")

Definition at line 78 of file check_binwise_moments.py.

◆ e0

check_binwise_moments.e0 = float(np.dot(sizes, seg))

Definition at line 74 of file check_binwise_moments.py.

◆ hb

check_binwise_moments.hb = float(np.sum(np.maximum(yb[1:i_d, jb] - C_floor, 0.0)))

Definition at line 59 of file check_binwise_moments.py.

◆ hb1

check_binwise_moments.hb1 = float(np.dot(ns, np.maximum(yb[1:i_d, jb] - C_floor, 0.0)))

Definition at line 62 of file check_binwise_moments.py.

◆ he

check_binwise_moments.he = float(np.sum(np.maximum(c_ref[1:i_d] - C_floor, 0.0)))

Definition at line 58 of file check_binwise_moments.py.

◆ he1

check_binwise_moments.he1 = float(np.dot(ns, np.maximum(c_ref[1:i_d] - C_floor, 0.0)))

Definition at line 61 of file check_binwise_moments.py.

◆ hi

check_binwise_moments.hi = min(nhi, I)

Definition at line 71 of file check_binwise_moments.py.

◆ I

int check_binwise_moments.I = 1000

Definition at line 18 of file check_binwise_moments.py.

◆ i_d

check_binwise_moments.i_d

Definition at line 38 of file check_binwise_moments.py.

◆ jb

check_binwise_moments.jb

Definition at line 49 of file check_binwise_moments.py.

◆ jr

check_binwise_moments.jr

Definition at line 49 of file check_binwise_moments.py.

◆ NB

int check_binwise_moments.NB = int(sys.argv[1]) if len(sys.argv) > 1 else 32

Definition at line 19 of file check_binwise_moments.py.

◆ ns

check_binwise_moments.ns = np.arange(2, i_d + 1)

Definition at line 60 of file check_binwise_moments.py.

◆ off

check_binwise_moments.off = i_d + P * k

Definition at line 75 of file check_binwise_moments.py.

◆ OUT

str check_binwise_moments.OUT = "/Users/ghoni/Documents/GitHub/RadCluster/radcluster_code/output"

Definition at line 17 of file check_binwise_moments.py.

◆ P

check_binwise_moments.P

Definition at line 38 of file check_binwise_moments.py.

◆ RE

check_binwise_moments.RE = sim.rate_equations

Definition at line 36 of file check_binwise_moments.py.

◆ ref

check_binwise_moments.ref = load("*_M1_D1000_*")

Definition at line 41 of file check_binwise_moments.py.

◆ seg

check_binwise_moments.seg = c_ref[nlo - 1:hi]

Definition at line 72 of file check_binwise_moments.py.

◆ sim

check_binwise_moments.sim
Initial value:
1= RadClusterSimulation(I=I, V=I, solver_mode="full_system",
2 equations="bin_moment", cascade="fission",
3 he_kinetics="quasi_steady_state",
4 i_mobile=5, v_mobile=5)

Definition at line 28 of file check_binwise_moments.py.

◆ sizes

check_binwise_moments.sizes = np.arange(nlo, hi + 1)

Definition at line 73 of file check_binwise_moments.py.

◆ tot

dict check_binwise_moments.tot = {"e0": 0.0, "b0": 0.0, "e1": 0.0, "b1": 0.0}

Definition at line 56 of file check_binwise_moments.py.

◆ yb

check_binwise_moments.yb = np.asarray(bm["results"]["y"], float)

Definition at line 47 of file check_binwise_moments.py.

◆ yr

check_binwise_moments.yr = np.asarray(ref["results"]["y"], float)

Definition at line 46 of file check_binwise_moments.py.