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

Functions

 _node_key (str node)
 
 find_hyperedge (rag, edge_class, tails, head)
 
 _draw_example (ax, x0, y, tails, head, edge_class, label, n_max, note=None)
 
None build_figure (int n_max, Path out, bool examples=True)
 

Variables

int _LABEL_FONTSIZE = 22
 
int _TICK_FONTSIZE = 20
 
int _PLOT_FONTSIZE = 20
 
int _NODE_FONTSIZE = 26
 
float _LW = 3.0
 
float _LW_THIN = 2.4
 
int _DPI = 150
 
str _INK = "#1a1a1a"
 
str _NODE_RING = "#3f3f3f"
 
str _SENTINEL = "#b4b4b4"
 
str _FAN_SIA = "#1a1a1a"
 
str _FAN_VAC = "#1a4f8a"
 
str _GREY_TEXT = "#6a6a6a"
 
dict _POP
 
dict _EDGE
 
float _X_SCALE = 3.00
 
dict _LANE_Y = {"bulk-111": 6.2, "bulk-100": 3.1, "bulk": 0.0}
 
float _R = 0.44
 
float _EX_R = 0.64
 
dict _POP_SHORT
 
dict _HYPER = {"coalescence": "#256abf", "annihilation": "#d03b3b"}
 
 ap = argparse.ArgumentParser(description=__doc__)
 
 type
 
 int
 
 default
 
 action
 
 help
 
 a = ap.parse_args()
 
 out
 
 examples
 

Detailed Description

make_rag_figure.py — node-link drawing of the EUROFER-97 RAG.

Renders the reaction admissibility graph declared in
``py_utils/materials/eurofer97`` as a three-lane ladder: one lane per
population, cluster size along x, one arc per declared edge family.

The drawing is generated from the MATERIALIZED graph
(``py_utils.core.to_networkx``), not from a hand-transcribed edge list, so
it cannot drift from the declaration.  If a family is added to the host
declaration it appears here on the next run.

Binary classes (COALESCENCE, ANNIHILATION) are omitted: they are directed
hyperedges and O(n_max**2) in count -- 6564 of the 7078 arcs at n_max=30 --
and drawing them turns the figure into a solid block.  Their count is
reported on the figure instead.

ENCODING.  Colour carries the EDGE CLASS here, not the population, because
the edge classes are what must be told apart: several share a vertex pair
and are drawn as nested arcs millimetres from each other.  Population
identity is carried instead by a tinted lane band plus a direct lane label
-- a large, low-saturation mark that cannot be confused with a thin
saturated arc, and which leaves the whole categorical budget for the arcs.
The lane tints are the suite population colours from
py_utils/visualization.py, so the association with the physics figures
survives.

The four arc hues are reference categorical slots 1/2/3/7, validated under
the ALL-PAIRS gate (worst CVD dE 9.2, worst normal-vision dE 16.3).
All-pairs is the right gate here because nested arcs sit side by side
rather than in a legend-ordered stack.  Line style is a redundant second
channel, so the figure survives greyscale printing.

Style otherwise follows py_utils/visualization.py: titles suppressed (the
document captions the figure) and type set once via rcParams at 22/20/16.

Usage::

    cd radcluster_code
    python codes/make_rag_figure.py --n-max 12 \
        --out ../docs/Formulation/reaction_admissibility_graph/figures/eurofer_rag_figure.png

Function Documentation

◆ _draw_example()

make_rag_figure._draw_example (   ax,
  x0,
  y,
  tails,
  head,
  edge_class,
  label,
  n_max,
  note = None 
)
protected
One hyperedge: two tails -> reaction vertex -> one head.

Definition at line 172 of file make_rag_figure.py.

◆ _node_key()

make_rag_figure._node_key ( str  node)
protected
'sia:bulk-111:7' -> ('bulk-111', 7); sentinels -> (None, None).

Definition at line 118 of file make_rag_figure.py.

◆ build_figure()

None make_rag_figure.build_figure ( int  n_max,
Path  out,
bool   examples = True 
)

Definition at line 236 of file make_rag_figure.py.

◆ find_hyperedge()

make_rag_figure.find_hyperedge (   rag,
  edge_class,
  tails,
  head 
)
Assert that (tails -> head) is really declared, and name its family.

The examples are hand-picked sizes, so unlike everything else in this
figure they could drift from the declaration.  This looks them up in a
graph materialized wide enough to contain them and returns the family
label, so a stale example fails loudly instead of drawing a reaction
the host does not admit.

Definition at line 143 of file make_rag_figure.py.

Variable Documentation

◆ _DPI

int make_rag_figure._DPI = 150
protected

Definition at line 69 of file make_rag_figure.py.

◆ _EDGE

dict make_rag_figure._EDGE
protected
Initial value:
1= {
2 "growth": ("#2a78d6", "-", _LW),
3 "shrinkage": ("#eb6834", "--", _LW_THIN),
4 "dissociation": ("#1baf7a", ":", _LW_THIN),
5 "recombination": ("#4a3aa7", "-.", _LW_THIN),
6 "inter_population": (_INK, "-", _LW),
7 "solute_trapping": ("#4a4a4a", "-", _LW_THIN),
8 "source": (_FAN_SIA, "-", 1.4),
9 "sink": (_FAN_SIA, (0, (7, 3)), 1.4),
10}

Definition at line 100 of file make_rag_figure.py.

◆ _EX_R

float make_rag_figure._EX_R = 0.64
protected

Definition at line 131 of file make_rag_figure.py.

◆ _FAN_SIA

str make_rag_figure._FAN_SIA = "#1a1a1a"
protected

Definition at line 84 of file make_rag_figure.py.

◆ _FAN_VAC

str make_rag_figure._FAN_VAC = "#1a4f8a"
protected

Definition at line 85 of file make_rag_figure.py.

◆ _GREY_TEXT

str make_rag_figure._GREY_TEXT = "#6a6a6a"
protected

Definition at line 86 of file make_rag_figure.py.

◆ _HYPER

dict make_rag_figure._HYPER = {"coalescence": "#256abf", "annihilation": "#d03b3b"}
protected

Definition at line 140 of file make_rag_figure.py.

◆ _INK

str make_rag_figure._INK = "#1a1a1a"
protected

Definition at line 81 of file make_rag_figure.py.

◆ _LABEL_FONTSIZE

int make_rag_figure._LABEL_FONTSIZE = 22
protected

Definition at line 63 of file make_rag_figure.py.

◆ _LANE_Y

dict make_rag_figure._LANE_Y = {"bulk-111": 6.2, "bulk-100": 3.1, "bulk": 0.0}
protected

Definition at line 114 of file make_rag_figure.py.

◆ _LW

float make_rag_figure._LW = 3.0
protected

Definition at line 67 of file make_rag_figure.py.

◆ _LW_THIN

float make_rag_figure._LW_THIN = 2.4
protected

Definition at line 68 of file make_rag_figure.py.

◆ _NODE_FONTSIZE

int make_rag_figure._NODE_FONTSIZE = 26
protected

Definition at line 66 of file make_rag_figure.py.

◆ _NODE_RING

str make_rag_figure._NODE_RING = "#3f3f3f"
protected

Definition at line 82 of file make_rag_figure.py.

◆ _PLOT_FONTSIZE

int make_rag_figure._PLOT_FONTSIZE = 20
protected

Definition at line 65 of file make_rag_figure.py.

◆ _POP

dict make_rag_figure._POP
protected
Initial value:
1= {
2 "bulk-111": ("steelblue", r"$\frac{1}{2}\langle 111\rangle$ SIA loops"),
3 "bulk-100": ("darkviolet", r"$\langle 100\rangle$ SIA loops"),
4 "bulk": ("tomato", "vacancy clusters / cavities"),
5}

Definition at line 89 of file make_rag_figure.py.

◆ _POP_SHORT

dict make_rag_figure._POP_SHORT
protected
Initial value:
1= {
2 "bulk-111": r"$\frac{1}{2}\langle 111\rangle$",
3 "bulk-100": r"$\langle 100\rangle$",
4 "bulk": "vacancy",
5}

Definition at line 132 of file make_rag_figure.py.

◆ _R

float make_rag_figure._R = 0.44
protected

Definition at line 115 of file make_rag_figure.py.

◆ _SENTINEL

str make_rag_figure._SENTINEL = "#b4b4b4"
protected

Definition at line 83 of file make_rag_figure.py.

◆ _TICK_FONTSIZE

int make_rag_figure._TICK_FONTSIZE = 20
protected

Definition at line 64 of file make_rag_figure.py.

◆ _X_SCALE

float make_rag_figure._X_SCALE = 3.00
protected

Definition at line 113 of file make_rag_figure.py.

◆ a

make_rag_figure.a = ap.parse_args()

Definition at line 407 of file make_rag_figure.py.

◆ action

make_rag_figure.action

Definition at line 403 of file make_rag_figure.py.

◆ ap

make_rag_figure.ap = argparse.ArgumentParser(description=__doc__)

Definition at line 401 of file make_rag_figure.py.

◆ default

make_rag_figure.default

Definition at line 402 of file make_rag_figure.py.

◆ examples

make_rag_figure.examples

Definition at line 408 of file make_rag_figure.py.

◆ help

make_rag_figure.help

Definition at line 404 of file make_rag_figure.py.

◆ int

make_rag_figure.int

Definition at line 402 of file make_rag_figure.py.

◆ out

make_rag_figure.out

Definition at line 408 of file make_rag_figure.py.

◆ type

make_rag_figure.type

Definition at line 402 of file make_rag_figure.py.