You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/stitching.nim
+62-4Lines changed: 62 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,68 @@ suite "Set up two 3C simplex grids that happen to share a common 2C subspace and
58
58
check p1 == p2
59
59
60
60
echo fmt"Finished test in {cpuTime()-t0} seconds."
61
-
61
+
62
+
suite "Enhance the previous suite by (1) assigning higher order elemental space with chemical element names (Ti Al V Cr Ni) \nand (2) setting up the elemental space to be composed of alloys rather than pure elements":
63
+
let comps =@["Ti", "Al", "V", "Cr", "Ni"]
64
+
let t0 = cpuTime()
65
+
# A - (Ti0.8 Al0.15 V0.05) TiAlloy
66
+
# B - V0.25 Cr0.75 - CrV
67
+
# C - V0.75 Ni0.25 - VNi
68
+
# D - Al0.9 Cr0.1 - AlCr
69
+
70
+
# Set up A B C
71
+
let grid1 = nimplex.simplex_grid_fractional(3, 5).attainable2elemental(@[
72
+
# Ti Al V Cr Ni
73
+
@[ 0.8, 0.15, 0.05, 0.0, 0.0], # A
74
+
@[ 0.0, 0.0, 0.25, 0.75, 0.0], # B
75
+
@[ 0.0, 0.0, 0.75, 0.0, 0.25]] # C
76
+
)
77
+
78
+
# Set up D C A
79
+
let grid2 = nimplex.simplex_grid_fractional(3, 5).attainable2elemental(@[
80
+
# Ti Al V Cr Ni
81
+
@[ 0.0, 0.9, 0.0, 0.1, 0.0], # D
82
+
@[ 0.0, 0.0, 0.75, 0.0, 0.25], # C
83
+
@[ 0.8, 0.15, 0.05, 0.0, 0.0]] # A
84
+
)
85
+
86
+
test "Points generated and are in different spaces":
87
+
check grid1 != grid2
88
+
89
+
let stitch1Table = findStitchingPoints(3, 5, components =@["TiAlloy", "CrV", "VNi"])
90
+
let stitch2Table = findStitchingPoints(3, 5, components =@["AlCr", "VNi", "TiAlloy"])
91
+
92
+
test "Stitching tables generated and of correct size (6 ternaries, 6 binaries, 3 unaries = 15)":
93
+
check stitch1Table.len ==15
94
+
check stitch2Table.len ==15
95
+
96
+
let stitch1 = stitch1Table["TiAlloy-VNi"]
97
+
let stitch2 = stitch2Table["TiAlloy-VNi"]
98
+
99
+
test "Binary stitching points were extracted from table and are of correct size (ndiv+1 = 5)":
100
+
check stitch1.len ==6
101
+
check stitch2.len ==6
102
+
103
+
test "Binary stitching points are differently indexed (because they are in different spaces)":
104
+
check stitch1 != stitch2
105
+
106
+
test "Stitching points match expected reference values":
0 commit comments