Skip to content

Commit 8c098a1

Browse files
committed
Updated 2D circular cross-section boron nitride example; added context to error message regarding zero-size triangles.
1 parent 2710f47 commit 8c098a1

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

examples/boron_nitride_wire.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[options]
2+
name = "boron_nitride_"
3+
weak_collision_order = 0
4+
num_threads = 4
5+
6+
[material_parameters]
7+
energy_unit = "EV"
8+
mass_unit = "AMU"
9+
Eb = [ 0.0, 0.0,]
10+
Es = [ 5.76, 0.0,]
11+
Ec = [ 1.0, 1.0,]
12+
Z = [ 5, 7,]
13+
m = [ 10.811, 14,]
14+
15+
[particle_parameters]
16+
length_unit = "MICRON"
17+
energy_unit = "EV"
18+
mass_unit = "AMU"
19+
N = [ 10000 ]
20+
m = [ 1.008 ]
21+
Z = [ 1 ]
22+
E = [ 1000.0 ]
23+
Ec = [ 1.0 ]
24+
Es = [ 10.0 ]
25+
pos = [ [ 0.0, 0.0, 0.0,] ]
26+
dir = [ [ 0.9999999999984769, 1.7453292519934434e-6, 0.0,] ]
27+
28+
[geometry_input]
29+
length_unit = "ANGSTROM"
30+
triangles = [ [ 0, 1, 2,], [ 0, 2, 3,], [ 0, 3, 4,], [ 0, 4, 5,], [ 0, 5, 6,], [ 0, 6, 7,], [ 0, 7, 8,], [ 0, 8, 9,], [ 0, 9, 10,], [ 0, 10, 11,], [ 0, 11, 12,], [ 0, 12, 13,], [ 0, 13, 14,], [ 0, 14, 15,], [ 0, 15, 16,], [ 0, 16, 17,], [ 0, 17, 18,], [ 0, 18, 19,], [ 0, 19, 20,], [ 0, 20, 21,], [ 0, 21, 22,], [ 0, 22, 23,], [ 0, 23, 24,], [ 0, 24, 25,], [ 0, 25, 26,], [ 0, 26, 27,], [ 0, 27, 28,], [ 0, 28, 29,], [ 0, 29, 30,], [ 0, 30, 31,], [ 0, 31, 32,], [ 0, 32, 33,], [ 0, 33, 34,], [ 0, 34, 35,], [ 0, 35, 36,], [ 0, 36, 37,], [ 0, 37, 38,], [ 0, 38, 39,], [ 0, 39, 40,], [ 0, 40, 41,], [ 0, 41, 42,], [ 0, 42, 43,], [ 0, 43, 44,], [ 0, 44, 45,], [ 0, 45, 46,], [ 0, 46, 47,], [ 0, 47, 48,], [ 0, 48, 49,], [ 0, 49, 50,], [ 0, 50, 51,], [ 0, 51, 52,], [ 0, 52, 53,], [ 0, 53, 54,], [ 0, 54, 55,], [ 0, 55, 56,], [ 0, 56, 57,], [ 0, 57, 58,], [ 0, 58, 59,], [ 0, 59, 60,], [ 0, 60, 61,], [ 0, 61, 62,], [ 0, 62, 63,], [ 0, 63, 64,], [ 0, 64, 65,], [ 0, 65, 66,], [ 0, 66, 67,], [ 0, 67, 68,], [ 0, 68, 69,], [ 0, 69, 70,], [ 0, 70, 71,], [ 0, 71, 72,], [ 0, 72, 73,], [ 0, 73, 74,], [ 0, 74, 75,], [ 0, 75, 76,], [ 0, 76, 77,], [ 0, 77, 78,], [ 0, 78, 79,], [ 0, 79, 80,], [ 0, 80, 81,], [ 0, 81, 82,], [ 0, 82, 83,], [ 0, 83, 84,], [ 0, 84, 85,], [ 0, 85, 86,], [ 0, 86, 87,], [ 0, 87, 88,], [ 0, 88, 89,], [ 0, 89, 90,], [ 0, 90, 91,], [ 0, 91, 92,], [ 0, 92, 93,], [ 0, 93, 94,], [ 0, 94, 95,], [ 0, 95, 96,], [ 0, 96, 97,], [ 0, 97, 98,], [ 0, 98, 99,], [ 0, 99, 100,], [ 0, 100, 101,], [ 0, 101, 1,],]
31+
points = [ [ 0.0, 0.0,], [ 1000.0, 0.0,], [ 998.0267284282716, 62.79051952931337,], [ 992.1147013144779, 125.33323356430427,], [ 982.2872507286887, 187.38131458572462,], [ 968.5831611286311, 248.68988716485478,], [ 951.0565162951535, 309.0169943749474,], [ 929.7764858882514, 368.12455268467795,], [ 904.8270524660195, 425.7792915650727,], [ 876.3066800438636, 481.7536741017153,], [ 844.3279255020151, 535.8267949789966,], [ 809.0169943749474, 587.7852522924732,], [ 770.5132427757892, 637.4239897486898,], [ 728.9686274214115, 684.5471059286888,], [ 684.5471059286887, 728.9686274214115,], [ 637.4239897486897, 770.5132427757893,], [ 587.785252292473, 809.0169943749474,], [ 535.8267949789965, 844.3279255020151,], [ 481.75367410171515, 876.3066800438637,], [ 425.77929156507264, 904.8270524660196,], [ 368.12455268467784, 929.7764858882515,], [ 309.01699437494744, 951.0565162951535,], [ 248.68988716485475, 968.5831611286311,], [ 187.3813145857245, 982.2872507286887,], [ 125.33323356430427, 992.1147013144779,], [ 62.79051952931331, 998.0267284282716,], [ -1.6081226496766366e-13, 1000.0,], [ -62.7905195293134, 998.0267284282716,], [ -125.33323356430436, 992.1147013144778,], [ -187.38131458572482, 982.2872507286886,], [ -248.68988716485484, 968.5831611286311,], [ -309.01699437494756, 951.0565162951535,], [ -368.12455268467795, 929.7764858882515,], [ -425.7792915650727, 904.8270524660195,], [ -481.75367410171543, 876.3066800438635,], [ -535.8267949789969, 844.327925502015,], [ -587.785252292473, 809.0169943749474,], [ -637.4239897486898, 770.5132427757893,], [ -684.5471059286888, 728.9686274214115,], [ -728.9686274214116, 684.5471059286886,], [ -770.5132427757893, 637.4239897486896,], [ -809.0169943749473, 587.7852522924733,], [ -844.3279255020151, 535.8267949789966,], [ -876.3066800438636, 481.7536741017152,], [ -904.8270524660196, 425.77929156507247,], [ -929.7764858882515, 368.1245526846778,], [ -951.0565162951536, 309.0169943749471,], [ -968.5831611286311, 248.6898871648548,], [ -982.2872507286887, 187.38131458572457,], [ -992.1147013144779, 125.3332335643041,], [ -998.0267284282716, 62.79051952931314,], [ -1000.0, -3.216245299353273e-13,], [ -998.0267284282716, -62.79051952931334,], [ -992.1147013144779, -125.33323356430428,], [ -982.2872507286886, -187.38131458572477,], [ -968.5831611286311, -248.689887164855,], [ -951.0565162951535, -309.0169943749477,], [ -929.7764858882513, -368.1245526846783,], [ -904.8270524660195, -425.77929156507264,], [ -876.3066800438636, -481.7536741017154,], [ -844.327925502015, -535.8267949789968,], [ -809.0169943749472, -587.7852522924734,], [ -770.5132427757891, -637.42398974869,], [ -728.9686274214115, -684.5471059286888,], [ -684.5471059286887, -728.9686274214115,], [ -637.4239897486896, -770.5132427757893,], [ -587.7852522924733, -809.0169943749473,], [ -535.8267949789963, -844.3279255020153,], [ -481.75367410171526, -876.3066800438636,], [ -425.7792915650722, -904.8270524660198,], [ -368.1245526846778, -929.7764858882515,], [ -309.01699437494756, -951.0565162951535,], [ -248.68988716485444, -968.5831611286312,], [ -187.38131458572462, -982.2872507286887,], [ -125.33323356430373, -992.1147013144779,], [ -62.79051952931321, -998.0267284282716,], [ -1.8369701987210297e-13, -1000.0,], [ 62.79051952931372, -998.0267284282716,], [ 125.33323356430424, -992.1147013144779,], [ 187.38131458572514, -982.2872507286886,], [ 248.68988716485492, -968.5831611286311,], [ 309.0169943749472, -951.0565162951536,], [ 368.12455268467824, -929.7764858882513,], [ 425.7792915650726, -904.8270524660196,], [ 481.7536741017157, -876.3066800438634,], [ 535.8267949789968, -844.327925502015,], [ 587.7852522924737, -809.016994374947,], [ 637.42398974869, -770.5132427757891,], [ 684.5471059286887, -728.9686274214115,], [ 728.9686274214118, -684.5471059286883,], [ 770.5132427757893, -637.4239897486897,], [ 809.0169943749478, -587.7852522924726,], [ 844.3279255020152, -535.8267949789963,], [ 876.3066800438636, -481.7536741017153,], [ 904.8270524660197, -425.77929156507224,], [ 929.7764858882515, -368.12455268467784,], [ 951.0565162951538, -309.01699437494676,], [ 968.5831611286312, -248.6898871648545,], [ 982.2872507286887, -187.38131458572468,], [ 992.1147013144779, -125.33323356430378,], [ 998.0267284282716, -62.790519529313265,], [ 1000.0, -2.4492935982947065e-13,],]
32+
boundary = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,]
33+
simulation_boundary_points = [ [ -1100.0, -1100.0,], [ -1100.0, 1100.0,], [ 1100.0, 1100.0,], [ 1100.0, -1100.0,],]
34+
densities = [ [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,], [ 0.065, 0.065,],]
35+
electronic_stopping_correction_factors = [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,]
36+
energy_barrier_thickness = 2.5

src/geometry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ impl Triangle2D {
655655
for segment in &self.segments {
656656
let length_2 = (segment.2 - segment.0)*(segment.2 - segment.0) + (segment.3 - segment.1)*(segment.3 - segment.1);
657657

658-
assert!(length_2 != 0., "Geometry error: mesh contains triangle with zero-length side.");
658+
assert!(length_2 != 0., "Geometry error: mesh contains triangle with zero-length side. (x1, y1), (x2, y2) = ({}, {}) ({}, {})", segment.0, segment.2, segment.1, segment.3);
659659

660660
let u = ((x - segment.0)*(segment.2 - segment.0) + (y - segment.1)*(segment.3 - segment.1))/length_2;
661661

0 commit comments

Comments
 (0)