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

Functions

 check (name, ok, detail="")
 
 last (key)
 

Variables

 ROOT = Path(r"d:/GitHub/RadCluster/radcluster_code")
 
dict BASELINE
 
int RTOL = 1e-5
 
list failures = []
 
 sim
 
 rag = getattr(sim, "material_rag", None)
 
 layout = getattr(sim, "state_layout", None)
 
bool rag_ok = True
 
dict active = {ec for ec in EdgeClass if rag.edges_of_class(ec)}
 
dict expected
 
 cfg = sim._default_solver_config()
 
 results
 
 val = last(key)
 
 rel = abs(val - ref) / abs(ref)
 
 dfp
 
 dhe
 

Detailed Description

Stage-4 validation — the two-layer RadCluster_2_1 on the im5vm2 case.

This is the capstone regression test for the graph-based two-layer
refactor.  It reproduces the RadCluster_1_0 reference case

    full_system / full_CD_fission, I = V = 1000, i_mobile = 5,
    v_mobile = 2, T = 673 K, G = 1e-6 dpa/s, t in [1e-6, 1e-2] s

and checks two things:

  (A) STRUCTURE — that a RadClusterSimulation now carries the live
      two-layer description: an abstract-core ReactionAdmissibilityGraph
      instantiated by the EUROFER-97 material layer (Layer 1 + Layer 2).

  (B) PHYSICS  — that running through the restructured (core/ + materials/)
      C++ solver still reproduces the locked post-Stage-2 baseline, i.e.
      the refactor is behaviour-preserving.

Reference values are the post-Stage-2 baseline (the G_He single-source
fix is included by design); agreement to 1e-5 relative — comfortably
above the ~5e-7 solver-tolerance noise — counts as a pass.

Run:  python codes/Python_Testing/test_two_layer_im5vm2.py
Exit code 0 = PASS, 1 = FAIL.

Function Documentation

◆ check()

test_two_layer_im5vm2.check (   name,
  ok,
  detail = "" 
)

Definition at line 50 of file test_two_layer_im5vm2.py.

◆ last()

test_two_layer_im5vm2.last (   key)

Definition at line 122 of file test_two_layer_im5vm2.py.

Variable Documentation

◆ active

dict test_two_layer_im5vm2.active = {ec for ec in EdgeClass if rag.edges_of_class(ec)}

Definition at line 92 of file test_two_layer_im5vm2.py.

◆ BASELINE

dict test_two_layer_im5vm2.BASELINE
Initial value:
1= {
2 "C_SIA_tot": 1.49422818e20,
3 "C_VAC_tot": 2.37571338e20,
4 "C_He_tot": 1.58830031e13,
5 "mean_n_i": 7.11591710,
6 "mean_n_v": 3.09365893,
7 "swelling": 2.80334179e-9,
8}

Definition at line 37 of file test_two_layer_im5vm2.py.

◆ cfg

test_two_layer_im5vm2.cfg = sim._default_solver_config()

Definition at line 106 of file test_two_layer_im5vm2.py.

◆ dfp

test_two_layer_im5vm2.dfp

Definition at line 137 of file test_two_layer_im5vm2.py.

◆ dhe

test_two_layer_im5vm2.dhe

Definition at line 137 of file test_two_layer_im5vm2.py.

◆ expected

dict test_two_layer_im5vm2.expected
Initial value:
1= {EdgeClass.GROWTH, EdgeClass.SHRINKAGE, EdgeClass.DISSOCIATION,
2 EdgeClass.RECOMBINATION, EdgeClass.ANNIHILATION,
3 EdgeClass.COALESCENCE, EdgeClass.SOURCE, EdgeClass.SINK}

Definition at line 93 of file test_two_layer_im5vm2.py.

◆ failures

list test_two_layer_im5vm2.failures = []

Definition at line 47 of file test_two_layer_im5vm2.py.

◆ layout

test_two_layer_im5vm2.layout = getattr(sim, "state_layout", None)

Definition at line 75 of file test_two_layer_im5vm2.py.

◆ rag

test_two_layer_im5vm2.rag = getattr(sim, "material_rag", None)

Definition at line 74 of file test_two_layer_im5vm2.py.

◆ rag_ok

bool test_two_layer_im5vm2.rag_ok = True

Definition at line 81 of file test_two_layer_im5vm2.py.

◆ rel

test_two_layer_im5vm2.rel = abs(val - ref) / abs(ref)

Definition at line 132 of file test_two_layer_im5vm2.py.

◆ results

test_two_layer_im5vm2.results
Initial value:
1= sim.run_adaptive(solver_config=cfg, save_output=False,
2 max_doublings=0, points_per_segment=200)

Definition at line 114 of file test_two_layer_im5vm2.py.

◆ ROOT

test_two_layer_im5vm2.ROOT = Path(r"d:/GitHub/RadCluster/radcluster_code")

Definition at line 30 of file test_two_layer_im5vm2.py.

◆ RTOL

int test_two_layer_im5vm2.RTOL = 1e-5

Definition at line 45 of file test_two_layer_im5vm2.py.

◆ sim

test_two_layer_im5vm2.sim
Initial value:
1= RadClusterSimulation(
2 I=1000, V=1000, solver_mode="full_system",
3 physics_option="full_CD_fission",
4 C_floor=1e-25, he_kinetics="quasi_steady_state",
5 i_mobile=5, v_mobile=2,
6)

Definition at line 62 of file test_two_layer_im5vm2.py.

◆ val

test_two_layer_im5vm2.val = last(key)

Definition at line 131 of file test_two_layer_im5vm2.py.