https://mooseframework.inl.gov
Functions
HexagonalLatticeTest.C File Reference

Go to the source code of this file.

Functions

 TEST_F (HexagonalLatticeTest, rings_and_pins)
 
 TEST_F (HexagonalLatticeTest, variation_with_rings)
 
 TEST_F (HexagonalLatticeTest, pin_bundle_spacing)
 
 TEST_F (HexagonalLatticeTest, hydraulic_diameters)
 
 TEST_F (HexagonalLatticeTest, pin_centers)
 
 TEST_F (HexagonalLatticeTest, pin_centers_rotated_pi)
 
 TEST_F (HexagonalLatticeTest, channel_index_shifted)
 
 TEST_F (HexagonalLatticeTest, channel_index)
 
 TEST_F (HexagonalLatticeTest, gaps1)
 
 TEST_F (HexagonalLatticeTest, gaps2)
 
 TEST_F (HexagonalLatticeTest, gaps3)
 
 TEST_F (HexagonalLatticeTest, closest_gap)
 
 TEST_F (HexagonalLatticeTest, normals1)
 
 TEST_F (HexagonalLatticeTest, normals2)
 
 TEST_F (HexagonalLatticeTest, normals3)
 
 TEST_F (HexagonalLatticeTest, pin_corners)
 
 TEST_F (HexagonalLatticeTest, constructor)
 

Function Documentation

◆ TEST_F() [1/17]

TEST_F ( HexagonalLatticeTest  ,
rings_and_pins   
)

Definition at line 12 of file HexagonalLatticeTest.C.

13 {
14  Real bp = 10.0, pp = 0.1, pd = 0.04, wd = 0.01, wp = 50.0;
15  unsigned int nr = 1, a = 2;
16  HexagonalLatticeUtils hl1(bp, pp, pd, wd, wp, nr, a);
17 
18  // Test number of rings given number of pins
19  EXPECT_EQ(hl1.rings(1), (unsigned int)1);
20  EXPECT_EQ(hl1.rings(7), (unsigned int)2);
21  EXPECT_EQ(hl1.rings(19), (unsigned int)3);
22  EXPECT_EQ(hl1.rings(37), (unsigned int)4);
23 
24  try
25  {
26  hl1.rings(100);
27  FAIL() << "missing expected error";
28  }
29  catch (const std::exception & e)
30  {
31  std::string msg(e.what());
32  ASSERT_NE(msg.find("Number of pins 100 not evenly divisible in a hexagonal lattice!"),
33  std::string::npos)
34  << "failed with unexpected error: " << msg;
35  }
36 
37  // Test number of pins in given ring
38  EXPECT_EQ(hl1.pins(1), (unsigned int)1);
39  EXPECT_EQ(hl1.pins(2), (unsigned int)6);
40  EXPECT_EQ(hl1.pins(3), (unsigned int)12);
41 
42  // Test first and last pins in given ring
43  EXPECT_EQ(hl1.firstPinInRing(1), (unsigned int)0);
44  EXPECT_EQ(hl1.lastPinInRing(1), (unsigned int)0);
45 
46  EXPECT_EQ(hl1.firstPinInRing(2), (unsigned int)1);
47  EXPECT_EQ(hl1.lastPinInRing(2), (unsigned int)6);
48 
49  EXPECT_EQ(hl1.firstPinInRing(3), (unsigned int)7);
50  EXPECT_EQ(hl1.lastPinInRing(3), (unsigned int)18);
51 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void ErrorVector unsigned int

◆ TEST_F() [2/17]

TEST_F ( HexagonalLatticeTest  ,
variation_with_rings   
)

Definition at line 53 of file HexagonalLatticeTest.C.

54 {
55  Real bp = 10.0, pp = 0.1, pd = 0.04, wd = 0.01, wp = 50.0;
56  unsigned int nr = 1, a = 2;
57  HexagonalLatticeUtils hl1(bp, pp, pd, wd, wp, nr, a);
58 
59  nr = 2;
60  HexagonalLatticeUtils hl2(bp, pp, pd, wd, wp, nr, a);
61 
62  nr = 3;
63  HexagonalLatticeUtils hl3(bp, pp, pd, wd, wp, nr, a);
64 
65  nr = 4;
66  HexagonalLatticeUtils hl4(bp, pp, pd, wd, wp, nr, a);
67 
68  EXPECT_EQ(hl1.nPins(), (unsigned int)1);
69  EXPECT_EQ(hl1.nInteriorPins(), (unsigned int)1);
70  EXPECT_EQ(hl1.nEdgePins(), (unsigned int)0);
71  EXPECT_EQ(hl1.nCornerPins(), (unsigned int)0);
72  EXPECT_EQ(hl1.nChannels(), (unsigned int)6);
73  EXPECT_EQ(hl1.nInteriorChannels(), (unsigned int)0);
74  EXPECT_EQ(hl1.nEdgeChannels(), (unsigned int)0);
75  EXPECT_EQ(hl1.nCornerChannels(), (unsigned int)6);
76 
77  EXPECT_EQ(hl2.nPins(), (unsigned int)7);
78  EXPECT_EQ(hl2.nInteriorPins(), (unsigned int)1);
79  EXPECT_EQ(hl2.nEdgePins(), (unsigned int)0);
80  EXPECT_EQ(hl2.nCornerPins(), (unsigned int)6);
81  EXPECT_EQ(hl2.nChannels(), (unsigned int)18);
82  EXPECT_EQ(hl2.nInteriorChannels(), (unsigned int)6);
83  EXPECT_EQ(hl2.nEdgeChannels(), (unsigned int)6);
84  EXPECT_EQ(hl2.nCornerChannels(), (unsigned int)6);
85 
86  EXPECT_EQ(hl3.nPins(), (unsigned int)19);
87  EXPECT_EQ(hl3.nInteriorPins(), (unsigned int)7);
88  EXPECT_EQ(hl3.nEdgePins(), (unsigned int)6);
89  EXPECT_EQ(hl3.nCornerPins(), (unsigned int)6);
90  EXPECT_EQ(hl3.nChannels(), (unsigned int)42);
91  EXPECT_EQ(hl3.nInteriorChannels(), (unsigned int)24);
92  EXPECT_EQ(hl3.nEdgeChannels(), (unsigned int)12);
93  EXPECT_EQ(hl3.nCornerChannels(), (unsigned int)6);
94 
95  EXPECT_EQ(hl4.nPins(), (unsigned int)37);
96  EXPECT_EQ(hl4.nInteriorPins(), (unsigned int)19);
97  EXPECT_EQ(hl4.nEdgePins(), (unsigned int)12);
98  EXPECT_EQ(hl4.nCornerPins(), (unsigned int)6);
99  EXPECT_EQ(hl4.nChannels(), (unsigned int)78);
100  EXPECT_EQ(hl4.nInteriorChannels(), (unsigned int)54);
101  EXPECT_EQ(hl4.nEdgeChannels(), (unsigned int)18);
102  EXPECT_EQ(hl4.nCornerChannels(), (unsigned int)6);
103 
104  auto interior_pins2 = hl2.interiorChannelPinIndices();
105  EXPECT_EQ(interior_pins2[0][0], (unsigned int)0);
106  EXPECT_EQ(interior_pins2[0][1], (unsigned int)1);
107  EXPECT_EQ(interior_pins2[0][2], (unsigned int)2);
108  EXPECT_EQ(interior_pins2[1][0], (unsigned int)0);
109  EXPECT_EQ(interior_pins2[1][1], (unsigned int)2);
110  EXPECT_EQ(interior_pins2[1][2], (unsigned int)3);
111  EXPECT_EQ(interior_pins2[2][0], (unsigned int)0);
112  EXPECT_EQ(interior_pins2[2][1], (unsigned int)3);
113  EXPECT_EQ(interior_pins2[2][2], (unsigned int)4);
114  EXPECT_EQ(interior_pins2[3][0], (unsigned int)0);
115  EXPECT_EQ(interior_pins2[3][1], (unsigned int)4);
116  EXPECT_EQ(interior_pins2[3][2], (unsigned int)5);
117  EXPECT_EQ(interior_pins2[4][0], (unsigned int)0);
118  EXPECT_EQ(interior_pins2[4][1], (unsigned int)5);
119  EXPECT_EQ(interior_pins2[4][2], (unsigned int)6);
120  EXPECT_EQ(interior_pins2[5][0], (unsigned int)0);
121  EXPECT_EQ(interior_pins2[5][1], (unsigned int)6);
122  EXPECT_EQ(interior_pins2[5][2], (unsigned int)1);
123 
124  auto edge_pins2 = hl2.edgeChannelPinIndices();
125  EXPECT_EQ(edge_pins2[0][0], (unsigned int)1);
126  EXPECT_EQ(edge_pins2[0][1], (unsigned int)2);
127  EXPECT_EQ(edge_pins2[1][0], (unsigned int)2);
128  EXPECT_EQ(edge_pins2[1][1], (unsigned int)3);
129  EXPECT_EQ(edge_pins2[2][0], (unsigned int)3);
130  EXPECT_EQ(edge_pins2[2][1], (unsigned int)4);
131  EXPECT_EQ(edge_pins2[3][0], (unsigned int)4);
132  EXPECT_EQ(edge_pins2[3][1], (unsigned int)5);
133  EXPECT_EQ(edge_pins2[4][0], (unsigned int)5);
134  EXPECT_EQ(edge_pins2[4][1], (unsigned int)6);
135  EXPECT_EQ(edge_pins2[5][0], (unsigned int)6);
136  EXPECT_EQ(edge_pins2[5][1], (unsigned int)1);
137 
138  auto corner_pins2 = hl2.cornerChannelPinIndices();
139  EXPECT_EQ(corner_pins2[0][0], (unsigned int)1);
140  EXPECT_EQ(corner_pins2[1][0], (unsigned int)2);
141  EXPECT_EQ(corner_pins2[2][0], (unsigned int)3);
142  EXPECT_EQ(corner_pins2[3][0], (unsigned int)4);
143  EXPECT_EQ(corner_pins2[4][0], (unsigned int)5);
144  EXPECT_EQ(corner_pins2[5][0], (unsigned int)6);
145 
146  auto interior_pins3 = hl3.interiorChannelPinIndices();
147  EXPECT_EQ(interior_pins3[0][0], (unsigned int)0);
148  EXPECT_EQ(interior_pins3[0][1], (unsigned int)1);
149  EXPECT_EQ(interior_pins3[0][2], (unsigned int)2);
150  EXPECT_EQ(interior_pins3[1][0], (unsigned int)0);
151  EXPECT_EQ(interior_pins3[1][1], (unsigned int)2);
152  EXPECT_EQ(interior_pins3[1][2], (unsigned int)3);
153  EXPECT_EQ(interior_pins3[2][0], (unsigned int)0);
154  EXPECT_EQ(interior_pins3[2][1], (unsigned int)3);
155  EXPECT_EQ(interior_pins3[2][2], (unsigned int)4);
156  EXPECT_EQ(interior_pins3[3][0], (unsigned int)0);
157  EXPECT_EQ(interior_pins3[3][1], (unsigned int)4);
158  EXPECT_EQ(interior_pins3[3][2], (unsigned int)5);
159  EXPECT_EQ(interior_pins3[4][0], (unsigned int)0);
160  EXPECT_EQ(interior_pins3[4][1], (unsigned int)5);
161  EXPECT_EQ(interior_pins3[4][2], (unsigned int)6);
162  EXPECT_EQ(interior_pins3[5][0], (unsigned int)0);
163  EXPECT_EQ(interior_pins3[5][1], (unsigned int)6);
164  EXPECT_EQ(interior_pins3[5][2], (unsigned int)1);
165  EXPECT_EQ(interior_pins3[6][0], (unsigned int)1);
166  EXPECT_EQ(interior_pins3[6][1], (unsigned int)7);
167  EXPECT_EQ(interior_pins3[6][2], (unsigned int)8);
168  EXPECT_EQ(interior_pins3[7][0], (unsigned int)8);
169  EXPECT_EQ(interior_pins3[7][1], (unsigned int)2);
170  EXPECT_EQ(interior_pins3[7][2], (unsigned int)1);
171  EXPECT_EQ(interior_pins3[8][0], (unsigned int)2);
172  EXPECT_EQ(interior_pins3[8][1], (unsigned int)8);
173  EXPECT_EQ(interior_pins3[8][2], (unsigned int)9);
174  EXPECT_EQ(interior_pins3[9][0], (unsigned int)2);
175  EXPECT_EQ(interior_pins3[9][1], (unsigned int)9);
176  EXPECT_EQ(interior_pins3[9][2], (unsigned int)10);
177  EXPECT_EQ(interior_pins3[10][0], (unsigned int)10);
178  EXPECT_EQ(interior_pins3[10][1], (unsigned int)3);
179  EXPECT_EQ(interior_pins3[10][2], (unsigned int)2);
180  EXPECT_EQ(interior_pins3[11][0], (unsigned int)3);
181  EXPECT_EQ(interior_pins3[11][1], (unsigned int)10);
182  EXPECT_EQ(interior_pins3[11][2], (unsigned int)11);
183  EXPECT_EQ(interior_pins3[12][0], (unsigned int)3);
184  EXPECT_EQ(interior_pins3[12][1], (unsigned int)11);
185  EXPECT_EQ(interior_pins3[12][2], (unsigned int)12);
186  EXPECT_EQ(interior_pins3[13][0], (unsigned int)12);
187  EXPECT_EQ(interior_pins3[13][1], (unsigned int)4);
188  EXPECT_EQ(interior_pins3[13][2], (unsigned int)3);
189  EXPECT_EQ(interior_pins3[14][0], (unsigned int)4);
190  EXPECT_EQ(interior_pins3[14][1], (unsigned int)12);
191  EXPECT_EQ(interior_pins3[14][2], (unsigned int)13);
192  EXPECT_EQ(interior_pins3[15][0], (unsigned int)4);
193  EXPECT_EQ(interior_pins3[15][1], (unsigned int)13);
194  EXPECT_EQ(interior_pins3[15][2], (unsigned int)14);
195  EXPECT_EQ(interior_pins3[16][0], (unsigned int)14);
196  EXPECT_EQ(interior_pins3[16][1], (unsigned int)5);
197  EXPECT_EQ(interior_pins3[16][2], (unsigned int)4);
198  EXPECT_EQ(interior_pins3[17][0], (unsigned int)5);
199  EXPECT_EQ(interior_pins3[17][1], (unsigned int)14);
200  EXPECT_EQ(interior_pins3[17][2], (unsigned int)15);
201  EXPECT_EQ(interior_pins3[18][0], (unsigned int)5);
202  EXPECT_EQ(interior_pins3[18][1], (unsigned int)15);
203  EXPECT_EQ(interior_pins3[18][2], (unsigned int)16);
204  EXPECT_EQ(interior_pins3[19][0], (unsigned int)16);
205  EXPECT_EQ(interior_pins3[19][1], (unsigned int)6);
206  EXPECT_EQ(interior_pins3[19][2], (unsigned int)5);
207  EXPECT_EQ(interior_pins3[20][0], (unsigned int)6);
208  EXPECT_EQ(interior_pins3[20][1], (unsigned int)16);
209  EXPECT_EQ(interior_pins3[20][2], (unsigned int)17);
210  EXPECT_EQ(interior_pins3[21][0], (unsigned int)6);
211  EXPECT_EQ(interior_pins3[21][1], (unsigned int)17);
212  EXPECT_EQ(interior_pins3[21][2], (unsigned int)18);
213  EXPECT_EQ(interior_pins3[22][0], (unsigned int)18);
214  EXPECT_EQ(interior_pins3[22][1], (unsigned int)1);
215  EXPECT_EQ(interior_pins3[22][2], (unsigned int)6);
216  EXPECT_EQ(interior_pins3[23][0], (unsigned int)1);
217  EXPECT_EQ(interior_pins3[23][1], (unsigned int)18);
218  EXPECT_EQ(interior_pins3[23][2], (unsigned int)7);
219 
220  auto edge_pins3 = hl3.edgeChannelPinIndices();
221  EXPECT_EQ(edge_pins3[0][0], (unsigned int)7);
222  EXPECT_EQ(edge_pins3[0][1], (unsigned int)8);
223  EXPECT_EQ(edge_pins3[1][0], (unsigned int)8);
224  EXPECT_EQ(edge_pins3[1][1], (unsigned int)9);
225  EXPECT_EQ(edge_pins3[2][0], (unsigned int)9);
226  EXPECT_EQ(edge_pins3[2][1], (unsigned int)10);
227  EXPECT_EQ(edge_pins3[3][0], (unsigned int)10);
228  EXPECT_EQ(edge_pins3[3][1], (unsigned int)11);
229  EXPECT_EQ(edge_pins3[4][0], (unsigned int)11);
230  EXPECT_EQ(edge_pins3[4][1], (unsigned int)12);
231  EXPECT_EQ(edge_pins3[5][0], (unsigned int)12);
232  EXPECT_EQ(edge_pins3[5][1], (unsigned int)13);
233  EXPECT_EQ(edge_pins3[6][0], (unsigned int)13);
234  EXPECT_EQ(edge_pins3[6][1], (unsigned int)14);
235  EXPECT_EQ(edge_pins3[7][0], (unsigned int)14);
236  EXPECT_EQ(edge_pins3[7][1], (unsigned int)15);
237  EXPECT_EQ(edge_pins3[8][0], (unsigned int)15);
238  EXPECT_EQ(edge_pins3[8][1], (unsigned int)16);
239  EXPECT_EQ(edge_pins3[9][0], (unsigned int)16);
240  EXPECT_EQ(edge_pins3[9][1], (unsigned int)17);
241  EXPECT_EQ(edge_pins3[10][0], (unsigned int)17);
242  EXPECT_EQ(edge_pins3[10][1], (unsigned int)18);
243  EXPECT_EQ(edge_pins3[11][0], (unsigned int)18);
244  EXPECT_EQ(edge_pins3[11][1], (unsigned int)7);
245 
246  auto corner_pins3 = hl3.cornerChannelPinIndices();
247  EXPECT_EQ(corner_pins3[0][0], (unsigned int)7);
248  EXPECT_EQ(corner_pins3[1][0], (unsigned int)9);
249  EXPECT_EQ(corner_pins3[2][0], (unsigned int)11);
250  EXPECT_EQ(corner_pins3[3][0], (unsigned int)13);
251  EXPECT_EQ(corner_pins3[4][0], (unsigned int)15);
252  EXPECT_EQ(corner_pins3[5][0], (unsigned int)17);
253 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void ErrorVector unsigned int

◆ TEST_F() [3/17]

TEST_F ( HexagonalLatticeTest  ,
pin_bundle_spacing   
)

Definition at line 255 of file HexagonalLatticeTest.C.

256 {
257  Real bp = 5.0, pp = 1.0, pd = 0.8, wd = 0.05, wp = 50.0;
258  unsigned int nr = 1, a = 2;
259  HexagonalLatticeUtils hl5(bp, pp, pd, wd, wp, nr, a);
260 
261  nr = 2;
262  HexagonalLatticeUtils hl6(bp, pp, pd, wd, wp, nr, a);
263 
264  wd = 0.0;
265  nr = 1;
266  HexagonalLatticeUtils hl7(bp, pp, pd, wd, wp, nr, a);
267 
268  nr = 2;
269  HexagonalLatticeUtils hl8(bp, pp, pd, wd, wp, nr, a);
270 
271  // wire-wrapped bundles
272  EXPECT_DOUBLE_EQ(hl5.pinBundleSpacing(), 2.1);
273  EXPECT_DOUBLE_EQ(hl6.pinBundleSpacing(), (5.0 - (std::sqrt(3.0) + 0.8)) / 2.);
274 
275  // bare bundles
276  EXPECT_DOUBLE_EQ(hl7.pinBundleSpacing(), 2.1);
277  EXPECT_DOUBLE_EQ(hl8.pinBundleSpacing(), (5.0 - (std::sqrt(3.0) + 0.8)) / 2.);
278 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [4/17]

TEST_F ( HexagonalLatticeTest  ,
hydraulic_diameters   
)

Definition at line 280 of file HexagonalLatticeTest.C.

281 {
282  int n_interior, n_edge, n_corner;
283  Real flow_interior, flow_edge, flow_corner;
284  Real area_interior, area_edge, area_corner;
285 
286  Real bp = 5.0, pp = 1.0, pd = 0.8, wd = 0.1, wp = 50.0;
287  unsigned int nr = 1, a = 2;
288  HexagonalLatticeUtils hl9(bp, pp, pd, wd, wp, nr, a);
289 
290  nr = 2;
291  HexagonalLatticeUtils hl10(bp, pp, pd, wd, wp, nr, a);
292 
293  pp = 0.99;
294  nr = 3;
295  HexagonalLatticeUtils hl11(bp, pp, pd, wd, wp, nr, a);
296 
297  pp = 1.0;
298  wd = 0.0;
299  nr = 1;
300  HexagonalLatticeUtils hl12(bp, pp, pd, wd, wp, nr, a);
301 
302  nr = 2;
303  HexagonalLatticeUtils hl13(bp, pp, pd, wd, wp, nr, a);
304 
305  pp = 0.99;
306  nr = 3;
307  HexagonalLatticeUtils hl14(bp, pp, pd, wd, wp, nr, a);
308 
309  // values are obtained from a completely separately-developed Python script for
310  // verifying the bundle-wide hydraulic diameter. We verify the diameters for each
311  // individual channel by requiring that the n-channel-weighted sum equals the
312  // bundle-wide values for volume and areas, since we can verify that easily.
313  EXPECT_DOUBLE_EQ(hl9.hydraulicDiameter(), 4.196872851813099);
314  n_interior = hl9.nInteriorChannels();
315  n_edge = hl9.nEdgeChannels();
316  n_corner = hl9.nCornerChannels();
317  flow_interior = hl9.interiorFlowVolume();
318  flow_edge = hl9.edgeFlowVolume();
319  flow_corner = hl9.cornerFlowVolume();
320  area_interior = hl9.interiorWettedArea();
321  area_edge = hl9.edgeWettedArea();
322  area_corner = hl9.cornerWettedArea();
323  EXPECT_DOUBLE_EQ(hl9.flowVolume(),
324  n_interior * flow_interior + n_edge * flow_edge + n_corner * flow_corner);
325  EXPECT_DOUBLE_EQ(hl9.wettedArea(),
326  n_interior * area_interior + n_edge * area_edge + n_corner * area_corner);
327 
328  EXPECT_DOUBLE_EQ(hl10.hydraulicDiameter(), 1.948158075579034);
329  n_interior = hl10.nInteriorChannels();
330  n_edge = hl10.nEdgeChannels();
331  n_corner = hl10.nCornerChannels();
332  flow_interior = hl10.interiorFlowVolume();
333  flow_edge = hl10.edgeFlowVolume();
334  flow_corner = hl10.cornerFlowVolume();
335  area_interior = hl10.interiorWettedArea();
336  area_edge = hl10.edgeWettedArea();
337  area_corner = hl10.cornerWettedArea();
338  EXPECT_DOUBLE_EQ(hl10.flowVolume(),
339  n_interior * flow_interior + n_edge * flow_edge + n_corner * flow_corner);
340  EXPECT_DOUBLE_EQ(hl10.wettedArea(),
341  n_interior * area_interior + n_edge * area_edge + n_corner * area_corner);
342 
343  EXPECT_DOUBLE_EQ(hl11.hydraulicDiameter(), 0.6727946134052672);
344  n_interior = hl11.nInteriorChannels();
345  n_edge = hl11.nEdgeChannels();
346  n_corner = hl11.nCornerChannels();
347  flow_interior = hl11.interiorFlowVolume();
348  flow_edge = hl11.edgeFlowVolume();
349  flow_corner = hl11.cornerFlowVolume();
350  area_interior = hl11.interiorWettedArea();
351  area_edge = hl11.edgeWettedArea();
352  area_corner = hl11.cornerWettedArea();
353  EXPECT_DOUBLE_EQ(hl11.flowVolume(),
354  n_interior * flow_interior + n_edge * flow_edge + n_corner * flow_corner);
355  EXPECT_DOUBLE_EQ(hl11.wettedArea(),
356  n_interior * area_interior + n_edge * area_edge + n_corner * area_corner);
357 
358  // bare bundles
359  EXPECT_DOUBLE_EQ(hl12.hydraulicDiameter(), 4.2650423521483205);
360  n_interior = hl12.nInteriorChannels();
361  n_edge = hl12.nEdgeChannels();
362  n_corner = hl12.nCornerChannels();
363  flow_interior = hl12.interiorFlowVolume();
364  flow_edge = hl12.edgeFlowVolume();
365  flow_corner = hl12.cornerFlowVolume();
366  area_interior = hl12.interiorWettedArea();
367  area_edge = hl12.edgeWettedArea();
368  area_corner = hl12.cornerWettedArea();
369  EXPECT_DOUBLE_EQ(hl12.flowVolume(),
370  n_interior * flow_interior + n_edge * flow_edge + n_corner * flow_corner);
371  EXPECT_DOUBLE_EQ(hl12.wettedArea(),
372  n_interior * area_interior + n_edge * area_edge + n_corner * area_corner);
373 
374  EXPECT_DOUBLE_EQ(hl13.hydraulicDiameter(), 2.077372852104904);
375  n_interior = hl13.nInteriorChannels();
376  n_edge = hl13.nEdgeChannels();
377  n_corner = hl13.nCornerChannels();
378  flow_interior = hl13.interiorFlowVolume();
379  flow_edge = hl13.edgeFlowVolume();
380  flow_corner = hl13.cornerFlowVolume();
381  area_interior = hl13.interiorWettedArea();
382  area_edge = hl13.edgeWettedArea();
383  area_corner = hl13.cornerWettedArea();
384  EXPECT_DOUBLE_EQ(hl13.flowVolume(),
385  n_interior * flow_interior + n_edge * flow_edge + n_corner * flow_corner);
386  EXPECT_DOUBLE_EQ(hl13.wettedArea(),
387  n_interior * area_interior + n_edge * area_edge + n_corner * area_corner);
388 
389  EXPECT_DOUBLE_EQ(hl14.hydraulicDiameter(), 0.7437951937590452);
390  n_interior = hl14.nInteriorChannels();
391  n_edge = hl14.nEdgeChannels();
392  n_corner = hl14.nCornerChannels();
393  flow_interior = hl14.interiorFlowVolume();
394  flow_edge = hl14.edgeFlowVolume();
395  flow_corner = hl14.cornerFlowVolume();
396  area_interior = hl14.interiorWettedArea();
397  area_edge = hl14.edgeWettedArea();
398  area_corner = hl14.cornerWettedArea();
399  EXPECT_DOUBLE_EQ(hl14.flowVolume(),
400  n_interior * flow_interior + n_edge * flow_edge + n_corner * flow_corner);
401  EXPECT_DOUBLE_EQ(hl14.wettedArea(),
402  n_interior * area_interior + n_edge * area_edge + n_corner * area_corner);
403 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [5/17]

TEST_F ( HexagonalLatticeTest  ,
pin_centers   
)

Definition at line 405 of file HexagonalLatticeTest.C.

406 {
407  Real bp = 5.0, pp = 0.99, pd = 0.8, wd = 0.0, wp = 50.0;
408  unsigned int nr = 3, a = 2;
409  HexagonalLatticeUtils hl14(bp, pp, pd, wd, wp, nr, a);
410 
411  nr = 1;
412  HexagonalLatticeUtils hl15(bp, pp, pd, wd, wp, nr, a);
413 
414  nr = 2;
415  HexagonalLatticeUtils hl16(bp, pp, pd, wd, wp, nr, a);
416 
417  bp = 10.0;
418  nr = 4;
419  HexagonalLatticeUtils hl17(bp, pp, pd, wd, wp, nr, a);
420 
421  Real cos60 = 0.5;
422  Real sin60 = std::sqrt(3.0) / 2.0;
423 
424  auto & centers = hl15.pinCenters();
425  EXPECT_EQ(centers.size(), hl15.nPins());
426  EXPECT_DOUBLE_EQ(centers[0](0), 0.0);
427  EXPECT_DOUBLE_EQ(centers[0](1), 0.0);
428  EXPECT_DOUBLE_EQ(centers[0](2), 0.0);
429 
430  Real p = 0.99;
431  auto & centers2 = hl16.pinCenters();
432  EXPECT_EQ(centers2.size(), hl16.nPins());
433  EXPECT_DOUBLE_EQ(centers2[0](0), 0.0);
434  EXPECT_DOUBLE_EQ(centers2[0](1), 0.0);
435  EXPECT_DOUBLE_EQ(centers2[1](0), cos60 * p);
436  EXPECT_DOUBLE_EQ(centers2[1](1), sin60 * p);
437  EXPECT_DOUBLE_EQ(centers2[2](0), -cos60 * p);
438  EXPECT_DOUBLE_EQ(centers2[2](1), sin60 * p);
439  EXPECT_DOUBLE_EQ(centers2[3](0), -p);
440  EXPECT_DOUBLE_EQ(centers2[3](1), 0.0);
441  EXPECT_DOUBLE_EQ(centers2[4](0), -cos60 * p);
442  EXPECT_DOUBLE_EQ(centers2[4](1), -sin60 * p);
443  EXPECT_DOUBLE_EQ(centers2[5](0), cos60 * p);
444  EXPECT_DOUBLE_EQ(centers2[5](1), -sin60 * p);
445  EXPECT_DOUBLE_EQ(centers2[6](0), p);
446  EXPECT_DOUBLE_EQ(centers2[6](1), (unsigned int)0);
447 
448  for (const auto i : make_range(hl16.nPins()))
449  EXPECT_DOUBLE_EQ(centers2[i](2), 0.0);
450 
451  auto & centers3 = hl14.pinCenters();
452  EXPECT_EQ(centers3.size(), hl14.nPins());
453  EXPECT_DOUBLE_EQ(centers3[0](0), 0.0);
454  EXPECT_DOUBLE_EQ(centers3[0](1), 0.0);
455  EXPECT_DOUBLE_EQ(centers3[1](0), cos60 * p);
456  EXPECT_DOUBLE_EQ(centers3[1](1), sin60 * p);
457  EXPECT_DOUBLE_EQ(centers3[2](0), -cos60 * p);
458  EXPECT_DOUBLE_EQ(centers3[2](1), sin60 * p);
459  EXPECT_DOUBLE_EQ(centers3[3](0), -p);
460  EXPECT_DOUBLE_EQ(centers3[3](1), 0.0);
461  EXPECT_DOUBLE_EQ(centers3[4](0), -cos60 * p);
462  EXPECT_DOUBLE_EQ(centers3[4](1), -sin60 * p);
463  EXPECT_DOUBLE_EQ(centers3[5](0), cos60 * p);
464  EXPECT_DOUBLE_EQ(centers3[5](1), -sin60 * p);
465  EXPECT_DOUBLE_EQ(centers3[6](0), p);
466  EXPECT_DOUBLE_EQ(centers3[6](1), (unsigned int)0);
467 
468  EXPECT_DOUBLE_EQ(centers3[7](0), p);
469  EXPECT_DOUBLE_EQ(centers3[7](1), 2 * p * sin60);
470  EXPECT_DOUBLE_EQ(centers3[8](0), (unsigned int)0);
471  EXPECT_DOUBLE_EQ(centers3[8](1), 2 * p * sin60);
472  EXPECT_DOUBLE_EQ(centers3[9](0), -p);
473  EXPECT_DOUBLE_EQ(centers3[9](1), 2 * p * sin60);
474  EXPECT_DOUBLE_EQ(centers3[10](0), -p - p * cos60);
475  EXPECT_DOUBLE_EQ(centers3[10](1), p * sin60);
476  EXPECT_DOUBLE_EQ(centers3[11](0), -2 * p);
477  EXPECT_DOUBLE_EQ(centers3[11](1), (unsigned int)0);
478  EXPECT_DOUBLE_EQ(centers3[12](0), -p - p * cos60);
479  EXPECT_DOUBLE_EQ(centers3[12](1), -p * sin60);
480  EXPECT_DOUBLE_EQ(centers3[13](0), -p);
481  EXPECT_DOUBLE_EQ(centers3[13](1), -2 * p * sin60);
482  EXPECT_DOUBLE_EQ(centers3[14](0), (unsigned int)0);
483  EXPECT_DOUBLE_EQ(centers3[14](1), -2 * p * sin60);
484  EXPECT_DOUBLE_EQ(centers3[15](0), p);
485  EXPECT_DOUBLE_EQ(centers3[15](1), -2 * p * sin60);
486  EXPECT_DOUBLE_EQ(centers3[16](0), p + p * cos60);
487  EXPECT_DOUBLE_EQ(centers3[16](1), -p * sin60);
488  EXPECT_DOUBLE_EQ(centers3[17](0), 2 * p);
489  EXPECT_DOUBLE_EQ(centers3[17](1), 0.0);
490  EXPECT_DOUBLE_EQ(centers3[18](0), p + p * cos60);
491  EXPECT_DOUBLE_EQ(centers3[18](1), p * sin60);
492 
493  for (const auto i : make_range(hl14.nPins()))
494  EXPECT_DOUBLE_EQ(centers3[i](2), 0.0);
495 
496  auto & centers4 = hl17.pinCenters();
497  EXPECT_EQ(centers4.size(), hl17.nPins());
498  EXPECT_DOUBLE_EQ(centers4[0](0), 0.0);
499  EXPECT_DOUBLE_EQ(centers4[0](1), 0.0);
500  EXPECT_DOUBLE_EQ(centers4[1](0), cos60 * p);
501  EXPECT_DOUBLE_EQ(centers4[1](1), sin60 * p);
502  EXPECT_DOUBLE_EQ(centers4[2](0), -cos60 * p);
503  EXPECT_DOUBLE_EQ(centers4[2](1), sin60 * p);
504  EXPECT_DOUBLE_EQ(centers4[3](0), -p);
505  EXPECT_DOUBLE_EQ(centers4[3](1), 0.0);
506  EXPECT_DOUBLE_EQ(centers4[4](0), -cos60 * p);
507  EXPECT_DOUBLE_EQ(centers4[4](1), -sin60 * p);
508  EXPECT_DOUBLE_EQ(centers4[5](0), cos60 * p);
509  EXPECT_DOUBLE_EQ(centers4[5](1), -sin60 * p);
510  EXPECT_DOUBLE_EQ(centers4[6](0), p);
511  EXPECT_DOUBLE_EQ(centers4[6](1), (unsigned int)0);
512 
513  EXPECT_DOUBLE_EQ(centers4[7](0), p);
514  EXPECT_DOUBLE_EQ(centers4[7](1), 2 * p * sin60);
515  EXPECT_DOUBLE_EQ(centers4[8](0), (unsigned int)0);
516  EXPECT_DOUBLE_EQ(centers4[8](1), 2 * p * sin60);
517  EXPECT_DOUBLE_EQ(centers4[9](0), -p);
518  EXPECT_DOUBLE_EQ(centers4[9](1), 2 * p * sin60);
519  EXPECT_DOUBLE_EQ(centers4[10](0), -p - p * cos60);
520  EXPECT_DOUBLE_EQ(centers4[10](1), p * sin60);
521  EXPECT_DOUBLE_EQ(centers4[11](0), -2 * p);
522  EXPECT_DOUBLE_EQ(centers4[11](1), (unsigned int)0);
523  EXPECT_DOUBLE_EQ(centers4[12](0), -p - p * cos60);
524  EXPECT_DOUBLE_EQ(centers4[12](1), -p * sin60);
525  EXPECT_DOUBLE_EQ(centers4[13](0), -p);
526  EXPECT_DOUBLE_EQ(centers4[13](1), -2 * p * sin60);
527  EXPECT_DOUBLE_EQ(centers4[14](0), (unsigned int)0);
528  EXPECT_DOUBLE_EQ(centers4[14](1), -2 * p * sin60);
529  EXPECT_DOUBLE_EQ(centers4[15](0), p);
530  EXPECT_DOUBLE_EQ(centers4[15](1), -2 * p * sin60);
531  EXPECT_DOUBLE_EQ(centers4[16](0), p + p * cos60);
532  EXPECT_DOUBLE_EQ(centers4[16](1), -p * sin60);
533  EXPECT_DOUBLE_EQ(centers4[17](0), 2 * p);
534  EXPECT_DOUBLE_EQ(centers4[17](1), 0.0);
535  EXPECT_DOUBLE_EQ(centers4[18](0), p + p * cos60);
536  EXPECT_DOUBLE_EQ(centers4[18](1), p * sin60);
537 
538  EXPECT_DOUBLE_EQ(centers4[19](0), p + p * cos60);
539  EXPECT_DOUBLE_EQ(centers4[19](1), 3 * p * sin60);
540  EXPECT_DOUBLE_EQ(centers4[20](0), p * cos60);
541  EXPECT_DOUBLE_EQ(centers4[20](1), 3 * p * sin60);
542  EXPECT_DOUBLE_EQ(centers4[21](0), -p * cos60);
543  EXPECT_DOUBLE_EQ(centers4[21](1), 3 * p * sin60);
544  EXPECT_DOUBLE_EQ(centers4[22](0), -p - p * cos60);
545  EXPECT_DOUBLE_EQ(centers4[22](1), 3 * p * sin60);
546  EXPECT_DOUBLE_EQ(centers4[23](0), -2 * p);
547  EXPECT_DOUBLE_EQ(centers4[23](1), 2 * p * sin60);
548  EXPECT_DOUBLE_EQ(centers4[24](0), -2 * p - p * cos60);
549  EXPECT_DOUBLE_EQ(centers4[24](1), p * sin60);
550  EXPECT_DOUBLE_EQ(centers4[25](0), -3 * p);
551  EXPECT_DOUBLE_EQ(centers4[25](1), (unsigned int)0);
552  EXPECT_DOUBLE_EQ(centers4[26](0), -2 * p - p * cos60);
553  EXPECT_DOUBLE_EQ(centers4[26](1), -p * sin60);
554  EXPECT_DOUBLE_EQ(centers4[27](0), -2 * p);
555  EXPECT_DOUBLE_EQ(centers4[27](1), -2 * p * sin60);
556  EXPECT_DOUBLE_EQ(centers4[28](0), -p - p * cos60);
557  EXPECT_DOUBLE_EQ(centers4[28](1), -3 * p * sin60);
558  EXPECT_DOUBLE_EQ(centers4[29](0), -p * cos60);
559  EXPECT_DOUBLE_EQ(centers4[29](1), -3 * p * sin60);
560  EXPECT_DOUBLE_EQ(centers4[30](0), p * cos60);
561  EXPECT_DOUBLE_EQ(centers4[30](1), -3 * p * sin60);
562  EXPECT_DOUBLE_EQ(centers4[31](0), p + p * cos60);
563  EXPECT_DOUBLE_EQ(centers4[31](1), -3 * p * sin60);
564  EXPECT_DOUBLE_EQ(centers4[32](0), 2 * p);
565  EXPECT_DOUBLE_EQ(centers4[32](1), -2 * p * sin60);
566  EXPECT_DOUBLE_EQ(centers4[33](0), 2 * p + p * cos60);
567  EXPECT_DOUBLE_EQ(centers4[33](1), -p * sin60);
568  EXPECT_DOUBLE_EQ(centers4[34](0), 3 * p);
569  EXPECT_DOUBLE_EQ(centers4[34](1), (unsigned int)0);
570  EXPECT_DOUBLE_EQ(centers4[35](0), 2 * p + p * cos60);
571  EXPECT_DOUBLE_EQ(centers4[35](1), p * sin60);
572  EXPECT_DOUBLE_EQ(centers4[36](0), 2 * p);
573  EXPECT_DOUBLE_EQ(centers4[36](1), 2 * p * sin60);
574 
575  for (const auto i : make_range(hl17.nPins()))
576  EXPECT_DOUBLE_EQ(centers4[i](2), 0.0);
577 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)

◆ TEST_F() [6/17]

TEST_F ( HexagonalLatticeTest  ,
pin_centers_rotated_pi   
)

Definition at line 579 of file HexagonalLatticeTest.C.

580 {
581  Real bp = 5.0, pp = 0.99, pd = 0.8, wd = 0.0, wp = 50.0;
582  unsigned int nr = 3, a = 2;
583  HexagonalLatticeUtils hl14(bp, pp, pd, wd, wp, nr, a, 180);
584 
585  nr = 1;
586  HexagonalLatticeUtils hl15(bp, pp, pd, wd, wp, nr, a, 180);
587 
588  nr = 2;
589  HexagonalLatticeUtils hl16(bp, pp, pd, wd, wp, nr, a, 180);
590 
591  bp = 10.0;
592  nr = 4;
593  HexagonalLatticeUtils hl17(bp, pp, pd, wd, wp, nr, a, 180);
594 
595  Real cos60 = 0.5;
596  Real sin60 = std::sqrt(3.0) / 2.0;
597 
598  auto & centers = hl15.pinCenters();
599  EXPECT_EQ(centers.size(), hl15.nPins());
600  ABS_DOUBLE_TEST(centers[0](0), 0.0);
601  ABS_DOUBLE_TEST(centers[0](1), 0.0);
602  ABS_DOUBLE_TEST(centers[0](2), 0.0);
603 
604  Real p = 0.99;
605  auto & centers2 = hl16.pinCenters();
606  EXPECT_EQ(centers2.size(), hl16.nPins());
607  ABS_DOUBLE_TEST(centers2[0](0), 0.0);
608  ABS_DOUBLE_TEST(centers2[0](1), 0.0);
609  ABS_DOUBLE_TEST(centers2[1](0), -cos60 * p);
610  ABS_DOUBLE_TEST(centers2[1](1), -sin60 * p);
611  ABS_DOUBLE_TEST(centers2[2](0), cos60 * p);
612  ABS_DOUBLE_TEST(centers2[2](1), -sin60 * p);
613  ABS_DOUBLE_TEST(centers2[3](0), p);
614  ABS_DOUBLE_TEST(centers2[3](1), 0.0);
615  ABS_DOUBLE_TEST(centers2[4](0), cos60 * p);
616  ABS_DOUBLE_TEST(centers2[4](1), sin60 * p);
617  ABS_DOUBLE_TEST(centers2[5](0), -cos60 * p);
618  ABS_DOUBLE_TEST(centers2[5](1), sin60 * p);
619  ABS_DOUBLE_TEST(centers2[6](0), -p);
620  ABS_DOUBLE_TEST(centers2[6](1), (unsigned int)0);
621 
622  for (const auto i : make_range(hl16.nPins()))
623  ABS_DOUBLE_TEST(centers2[i](2), 0.0);
624 
625  auto & centers3 = hl14.pinCenters();
626  EXPECT_EQ(centers3.size(), hl14.nPins());
627  ABS_DOUBLE_TEST(centers3[0](0), 0.0);
628  ABS_DOUBLE_TEST(centers3[0](1), 0.0);
629  ABS_DOUBLE_TEST(centers3[1](0), -cos60 * p);
630  ABS_DOUBLE_TEST(centers3[1](1), -sin60 * p);
631  ABS_DOUBLE_TEST(centers3[2](0), cos60 * p);
632  ABS_DOUBLE_TEST(centers3[2](1), -sin60 * p);
633  ABS_DOUBLE_TEST(centers3[3](0), p);
634  ABS_DOUBLE_TEST(centers3[3](1), 0.0);
635  ABS_DOUBLE_TEST(centers3[4](0), cos60 * p);
636  ABS_DOUBLE_TEST(centers3[4](1), sin60 * p);
637  ABS_DOUBLE_TEST(centers3[5](0), -cos60 * p);
638  ABS_DOUBLE_TEST(centers3[5](1), sin60 * p);
639  ABS_DOUBLE_TEST(centers3[6](0), -p);
640  ABS_DOUBLE_TEST(centers3[6](1), (unsigned int)0);
641 
642  ABS_DOUBLE_TEST(centers3[7](0), -p);
643  ABS_DOUBLE_TEST(centers3[7](1), -2 * p * sin60);
644  ABS_DOUBLE_TEST(centers3[8](0), (unsigned int)0);
645  ABS_DOUBLE_TEST(centers3[8](1), -2 * p * sin60);
646  ABS_DOUBLE_TEST(centers3[9](0), p);
647  ABS_DOUBLE_TEST(centers3[9](1), -2 * p * sin60);
648  ABS_DOUBLE_TEST(centers3[10](0), p + p * cos60);
649  ABS_DOUBLE_TEST(centers3[10](1), -p * sin60);
650  ABS_DOUBLE_TEST(centers3[11](0), 2 * p);
651  ABS_DOUBLE_TEST(centers3[11](1), (unsigned int)0);
652  ABS_DOUBLE_TEST(centers3[12](0), p + p * cos60);
653  ABS_DOUBLE_TEST(centers3[12](1), p * sin60);
654  ABS_DOUBLE_TEST(centers3[13](0), p);
655  ABS_DOUBLE_TEST(centers3[13](1), 2 * p * sin60);
656  ABS_DOUBLE_TEST(centers3[14](0), (unsigned int)0);
657  ABS_DOUBLE_TEST(centers3[14](1), 2 * p * sin60);
658  ABS_DOUBLE_TEST(centers3[15](0), -p);
659  ABS_DOUBLE_TEST(centers3[15](1), 2 * p * sin60);
660  ABS_DOUBLE_TEST(centers3[16](0), -p - p * cos60);
661  ABS_DOUBLE_TEST(centers3[16](1), p * sin60);
662  ABS_DOUBLE_TEST(centers3[17](0), -2 * p);
663  ABS_DOUBLE_TEST(centers3[17](1), 0.0);
664  ABS_DOUBLE_TEST(centers3[18](0), -p - p * cos60);
665  ABS_DOUBLE_TEST(centers3[18](1), -p * sin60);
666 
667  for (const auto i : make_range(hl14.nPins()))
668  ABS_DOUBLE_TEST(centers3[i](2), 0.0);
669 
670  auto & centers4 = hl17.pinCenters();
671  EXPECT_EQ(centers4.size(), hl17.nPins());
672  ABS_DOUBLE_TEST(centers4[0](0), 0.0);
673  ABS_DOUBLE_TEST(centers4[0](1), 0.0);
674  ABS_DOUBLE_TEST(centers4[1](0), -cos60 * p);
675  ABS_DOUBLE_TEST(centers4[1](1), -sin60 * p);
676  ABS_DOUBLE_TEST(centers4[2](0), cos60 * p);
677  ABS_DOUBLE_TEST(centers4[2](1), -sin60 * p);
678  ABS_DOUBLE_TEST(centers4[3](0), p);
679  ABS_DOUBLE_TEST(centers4[3](1), 0.0);
680  ABS_DOUBLE_TEST(centers4[4](0), cos60 * p);
681  ABS_DOUBLE_TEST(centers4[4](1), sin60 * p);
682  ABS_DOUBLE_TEST(centers4[5](0), -cos60 * p);
683  ABS_DOUBLE_TEST(centers4[5](1), sin60 * p);
684  ABS_DOUBLE_TEST(centers4[6](0), -p);
685  ABS_DOUBLE_TEST(centers4[6](1), (unsigned int)0);
686 
687  ABS_DOUBLE_TEST(centers4[7](0), -p);
688  ABS_DOUBLE_TEST(centers4[7](1), -2 * p * sin60);
689  ABS_DOUBLE_TEST(centers4[8](0), (unsigned int)0);
690  ABS_DOUBLE_TEST(centers4[8](1), -2 * p * sin60);
691  ABS_DOUBLE_TEST(centers4[9](0), p);
692  ABS_DOUBLE_TEST(centers4[9](1), -2 * p * sin60);
693  ABS_DOUBLE_TEST(centers4[10](0), p + p * cos60);
694  ABS_DOUBLE_TEST(centers4[10](1), -p * sin60);
695  ABS_DOUBLE_TEST(centers4[11](0), 2 * p);
696  ABS_DOUBLE_TEST(centers4[11](1), (unsigned int)0);
697  ABS_DOUBLE_TEST(centers4[12](0), p + p * cos60);
698  ABS_DOUBLE_TEST(centers4[12](1), p * sin60);
699  ABS_DOUBLE_TEST(centers4[13](0), p);
700  ABS_DOUBLE_TEST(centers4[13](1), 2 * p * sin60);
701  ABS_DOUBLE_TEST(centers4[14](0), (unsigned int)0);
702  ABS_DOUBLE_TEST(centers4[14](1), 2 * p * sin60);
703  ABS_DOUBLE_TEST(centers4[15](0), -p);
704  ABS_DOUBLE_TEST(centers4[15](1), 2 * p * sin60);
705  ABS_DOUBLE_TEST(centers4[16](0), -p - p * cos60);
706  ABS_DOUBLE_TEST(centers4[16](1), p * sin60);
707  ABS_DOUBLE_TEST(centers4[17](0), -2 * p);
708  ABS_DOUBLE_TEST(centers4[17](1), 0.0);
709  ABS_DOUBLE_TEST(centers4[18](0), -p - p * cos60);
710  ABS_DOUBLE_TEST(centers4[18](1), -p * sin60);
711 
712  ABS_DOUBLE_TEST(centers4[19](0), -p - p * cos60);
713  ABS_DOUBLE_TEST(centers4[19](1), -3 * p * sin60);
714  ABS_DOUBLE_TEST(centers4[20](0), -p * cos60);
715  ABS_DOUBLE_TEST(centers4[20](1), -3 * p * sin60);
716  ABS_DOUBLE_TEST(centers4[21](0), p * cos60);
717  ABS_DOUBLE_TEST(centers4[21](1), -3 * p * sin60);
718  ABS_DOUBLE_TEST(centers4[22](0), p + p * cos60);
719  ABS_DOUBLE_TEST(centers4[22](1), -3 * p * sin60);
720  ABS_DOUBLE_TEST(centers4[23](0), 2 * p);
721  ABS_DOUBLE_TEST(centers4[23](1), -2 * p * sin60);
722  ABS_DOUBLE_TEST(centers4[24](0), 2 * p + p * cos60);
723  ABS_DOUBLE_TEST(centers4[24](1), -p * sin60);
724  ABS_DOUBLE_TEST(centers4[25](0), 3 * p);
725  ABS_DOUBLE_TEST(centers4[25](1), (unsigned int)0);
726  ABS_DOUBLE_TEST(centers4[26](0), 2 * p + p * cos60);
727  ABS_DOUBLE_TEST(centers4[26](1), p * sin60);
728  ABS_DOUBLE_TEST(centers4[27](0), 2 * p);
729  ABS_DOUBLE_TEST(centers4[27](1), 2 * p * sin60);
730  ABS_DOUBLE_TEST(centers4[28](0), p + p * cos60);
731  ABS_DOUBLE_TEST(centers4[28](1), 3 * p * sin60);
732  ABS_DOUBLE_TEST(centers4[29](0), p * cos60);
733  ABS_DOUBLE_TEST(centers4[29](1), 3 * p * sin60);
734  ABS_DOUBLE_TEST(centers4[30](0), -p * cos60);
735  ABS_DOUBLE_TEST(centers4[30](1), 3 * p * sin60);
736  ABS_DOUBLE_TEST(centers4[31](0), -p - p * cos60);
737  ABS_DOUBLE_TEST(centers4[31](1), 3 * p * sin60);
738  ABS_DOUBLE_TEST(centers4[32](0), -2 * p);
739  ABS_DOUBLE_TEST(centers4[32](1), 2 * p * sin60);
740  ABS_DOUBLE_TEST(centers4[33](0), -2 * p - p * cos60);
741  ABS_DOUBLE_TEST(centers4[33](1), p * sin60);
742  ABS_DOUBLE_TEST(centers4[34](0), -3 * p);
743  ABS_DOUBLE_TEST(centers4[34](1), (unsigned int)0);
744  ABS_DOUBLE_TEST(centers4[35](0), -2 * p - p * cos60);
745  ABS_DOUBLE_TEST(centers4[35](1), -p * sin60);
746  ABS_DOUBLE_TEST(centers4[36](0), -2 * p);
747  ABS_DOUBLE_TEST(centers4[36](1), -2 * p * sin60);
748 
749  for (const auto i : make_range(hl17.nPins()))
750  ABS_DOUBLE_TEST(centers4[i](2), 0.0);
751 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)

◆ TEST_F() [7/17]

TEST_F ( HexagonalLatticeTest  ,
channel_index_shifted   
)

Definition at line 753 of file HexagonalLatticeTest.C.

754 {
755  Real bp = 4.0, pp = 0.8, pd = 0.6, wd = 0.05, wp = 50.0;
756  unsigned int nr = 3, a = 2;
757  HexagonalLatticeUtils hl(bp, pp, pd, wd, wp, nr, a);
758 
759  // check that the z-coordinate doesn't affect the channel index identification
760  Point pt0(0.06, 0.35, 3.5);
761  Point pt1(-0.47, 0.28, 3.5);
762  Point pt2(-0.26, -0.21, 3.5);
763  Point pt3(-0.12, -0.349, 3.5);
764  Point pt4(0.46, -0.27, 3.5);
765  Point pt5(0.37, 0.6, 3.5);
766 
767  EXPECT_EQ(hl.channelIndex(pt0), (unsigned int)0);
768  EXPECT_EQ(hl.channelIndex(pt1), (unsigned int)1);
769  EXPECT_EQ(hl.channelIndex(pt2), (unsigned int)2);
770  EXPECT_EQ(hl.channelIndex(pt3), (unsigned int)3);
771  EXPECT_EQ(hl.channelIndex(pt4), (unsigned int)4);
772  EXPECT_EQ(hl.channelIndex(pt5), (unsigned int)5);
773 
774  Point pt6(0.36, 1.06, -7.0);
775  Point pt7(0.11, 0.98, -7.0);
776  Point pt8(-0.43, 1.27, -7.0);
777  Point pt9(-0.81, 0.93, -7.0);
778  Point pt10(-0.75, 0.47, -7.0);
779  Point pt11(-1.06, 0.28, -7.0);
780  Point pt12(-1.16, -0.13, -7.0);
781  Point pt13(-0.73, -0.41, -7.0);
782  Point pt14(-0.73, -0.81, -7.0);
783  Point pt15(-0.46, -1.18, -7.0);
784  Point pt16(0.05, -0.98, -7.0);
785  Point pt17(0.27, -1.00, -7.0);
786  Point pt18(0.72, -0.98, -7.0);
787  Point pt19(0.75, -0.58, -7.0);
788  Point pt20(1.23, -0.23, -7.0);
789  Point pt21(1.17, 0.09, -7.0);
790  Point pt22(0.78, 0.38, -7.0);
791  Point pt23(0.74, 0.84, -7.0);
792 
793  EXPECT_EQ(hl.channelIndex(pt6), (unsigned int)6);
794  EXPECT_EQ(hl.channelIndex(pt7), (unsigned int)7);
795  EXPECT_EQ(hl.channelIndex(pt8), (unsigned int)8);
796  EXPECT_EQ(hl.channelIndex(pt9), (unsigned int)9);
797  EXPECT_EQ(hl.channelIndex(pt10), (unsigned int)10);
798  EXPECT_EQ(hl.channelIndex(pt11), (unsigned int)11);
799  EXPECT_EQ(hl.channelIndex(pt12), (unsigned int)12);
800  EXPECT_EQ(hl.channelIndex(pt13), (unsigned int)13);
801  EXPECT_EQ(hl.channelIndex(pt14), (unsigned int)14);
802  EXPECT_EQ(hl.channelIndex(pt15), (unsigned int)15);
803  EXPECT_EQ(hl.channelIndex(pt16), (unsigned int)16);
804  EXPECT_EQ(hl.channelIndex(pt17), (unsigned int)17);
805  EXPECT_EQ(hl.channelIndex(pt18), (unsigned int)18);
806  EXPECT_EQ(hl.channelIndex(pt19), (unsigned int)19);
807  EXPECT_EQ(hl.channelIndex(pt20), (unsigned int)20);
808  EXPECT_EQ(hl.channelIndex(pt21), (unsigned int)21);
809  EXPECT_EQ(hl.channelIndex(pt22), (unsigned int)22);
810  EXPECT_EQ(hl.channelIndex(pt23), (unsigned int)23);
811 
812  Point pt24(0.31, 1.44, -0.1);
813  Point pt25(-0.38, 1.61, -0.1);
814  Point pt26(-1.17, 1.52, -0.1);
815  Point pt27(-1.78, 0.38, -0.1);
816  Point pt28(-1.91, -0.42, -0.1);
817  Point pt29(-1.39, -1.24, -0.1);
818  Point pt30(-0.46, -1.74, -0.1);
819  Point pt31(0.18, -1.79, -0.1);
820  Point pt32(1.24, -1.17, -0.1);
821  Point pt33(1.75, -0.57, -0.1);
822  Point pt34(1.51, 0.37, -0.1);
823  Point pt35(1.16, 1.42, -0.1);
824 
825  EXPECT_EQ(hl.channelIndex(pt24), (unsigned int)24);
826  EXPECT_EQ(hl.channelIndex(pt25), (unsigned int)25);
827  // EXPECT_EQ(hl.channelIndex(pt26), (unsigned int)26);
828  EXPECT_EQ(hl.channelIndex(pt27), (unsigned int)27);
829  EXPECT_EQ(hl.channelIndex(pt28), (unsigned int)28);
830  EXPECT_EQ(hl.channelIndex(pt29), (unsigned int)29);
831  EXPECT_EQ(hl.channelIndex(pt30), (unsigned int)30);
832  EXPECT_EQ(hl.channelIndex(pt31), (unsigned int)31);
833  EXPECT_EQ(hl.channelIndex(pt32), (unsigned int)32);
834  EXPECT_EQ(hl.channelIndex(pt33), (unsigned int)33);
835  EXPECT_EQ(hl.channelIndex(pt34), (unsigned int)34);
836  EXPECT_EQ(hl.channelIndex(pt35), (unsigned int)35);
837 
838  Point pt36(1.05, 1.75, 1.2);
839  Point pt37(-1.02, 1.72, 1.2);
840  Point pt38(-2.03, -0.05, 1.2);
841  Point pt39(-1.01, -1.59, 1.2);
842  Point pt40(0.89, -1.79, 1.2);
843  Point pt41(1.98, 0.12, 1.2);
844 
845  EXPECT_EQ(hl.channelIndex(pt36), (unsigned int)36);
846  EXPECT_EQ(hl.channelIndex(pt37), (unsigned int)37);
847  EXPECT_EQ(hl.channelIndex(pt38), (unsigned int)38);
848  EXPECT_EQ(hl.channelIndex(pt39), (unsigned int)39);
849  EXPECT_EQ(hl.channelIndex(pt40), (unsigned int)40);
850  EXPECT_EQ(hl.channelIndex(pt41), (unsigned int)41);
851 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void ErrorVector unsigned int

◆ TEST_F() [8/17]

TEST_F ( HexagonalLatticeTest  ,
channel_index   
)

Definition at line 853 of file HexagonalLatticeTest.C.

854 {
855  Real bp = 4.0, pp = 0.8, pd = 0.6, wd = 0.05, wp = 50.0;
856  unsigned int nr = 3, a = 2;
857  HexagonalLatticeUtils hl(bp, pp, pd, wd, wp, nr, a);
858 
859  Point pt0(0.06, 0.35, 0.0);
860  Point pt1(-0.47, 0.28, 0.0);
861  Point pt2(-0.26, -0.21, 0.0);
862  Point pt3(-0.12, -0.349, 0.0);
863  Point pt4(0.46, -0.27, 0.0);
864  Point pt5(0.37, 0.6, 0.0);
865  EXPECT_EQ(hl.channelType(pt0), channel_type::interior);
866  EXPECT_EQ(hl.channelType(pt1), channel_type::interior);
867  EXPECT_EQ(hl.channelType(pt2), channel_type::interior);
868  EXPECT_EQ(hl.channelType(pt3), channel_type::interior);
869  EXPECT_EQ(hl.channelType(pt4), channel_type::interior);
870  EXPECT_EQ(hl.channelType(pt5), channel_type::interior);
871  EXPECT_EQ(hl.channelIndex(pt0), (unsigned int)0);
872  EXPECT_EQ(hl.channelIndex(pt1), (unsigned int)1);
873  EXPECT_EQ(hl.channelIndex(pt2), (unsigned int)2);
874  EXPECT_EQ(hl.channelIndex(pt3), (unsigned int)3);
875  EXPECT_EQ(hl.channelIndex(pt4), (unsigned int)4);
876  EXPECT_EQ(hl.channelIndex(pt5), (unsigned int)5);
877 
878  // check that a point exactly on the edge falls into one channel
879  pt0 = {0.5 * 0.8 * 0.5, 0.5 * 0.8 * std::sqrt(3.0) / 2.0, 0.0};
880  EXPECT_EQ(hl.channelIndex(pt0), (unsigned int)0);
881 
882  Point pt6(0.36, 1.06, 0.0);
883  Point pt7(0.11, 0.98, 0.0);
884  Point pt8(-0.43, 1.27, 0.0);
885  Point pt9(-0.81, 0.93, 0.0);
886  Point pt10(-0.75, 0.47, 0.0);
887  Point pt11(-1.06, 0.28, 0.0);
888  Point pt12(-1.16, -0.13, 0.0);
889  Point pt13(-0.73, -0.41, 0.0);
890  Point pt14(-0.73, -0.81, 0.0);
891  Point pt15(-0.46, -1.18, 0.0);
892  Point pt16(0.05, -0.98, 0.0);
893  Point pt17(0.27, -1.00, 0.0);
894  Point pt18(0.72, -0.98, 0.0);
895  Point pt19(0.75, -0.58, 0.0);
896  Point pt20(1.23, -0.23, 0.0);
897  Point pt21(1.17, 0.09, 0.0);
898  Point pt22(0.78, 0.38, 0.0);
899  Point pt23(0.74, 0.84, 0.0);
900 
901  EXPECT_EQ(hl.channelType(pt6), channel_type::interior);
902  EXPECT_EQ(hl.channelType(pt7), channel_type::interior);
903  EXPECT_EQ(hl.channelType(pt8), channel_type::interior);
904  EXPECT_EQ(hl.channelType(pt9), channel_type::interior);
905  EXPECT_EQ(hl.channelType(pt10), channel_type::interior);
906  EXPECT_EQ(hl.channelType(pt11), channel_type::interior);
907  EXPECT_EQ(hl.channelType(pt12), channel_type::interior);
908  EXPECT_EQ(hl.channelType(pt13), channel_type::interior);
909  EXPECT_EQ(hl.channelType(pt14), channel_type::interior);
910  EXPECT_EQ(hl.channelType(pt15), channel_type::interior);
911  EXPECT_EQ(hl.channelType(pt16), channel_type::interior);
912  EXPECT_EQ(hl.channelType(pt17), channel_type::interior);
913  EXPECT_EQ(hl.channelType(pt18), channel_type::interior);
914  EXPECT_EQ(hl.channelType(pt19), channel_type::interior);
915  EXPECT_EQ(hl.channelType(pt20), channel_type::interior);
916  EXPECT_EQ(hl.channelType(pt21), channel_type::interior);
917  EXPECT_EQ(hl.channelType(pt22), channel_type::interior);
918  EXPECT_EQ(hl.channelType(pt23), channel_type::interior);
919  EXPECT_EQ(hl.channelIndex(pt6), (unsigned int)6);
920  EXPECT_EQ(hl.channelIndex(pt7), (unsigned int)7);
921  EXPECT_EQ(hl.channelIndex(pt8), (unsigned int)8);
922  EXPECT_EQ(hl.channelIndex(pt9), (unsigned int)9);
923  EXPECT_EQ(hl.channelIndex(pt10), (unsigned int)10);
924  EXPECT_EQ(hl.channelIndex(pt11), (unsigned int)11);
925  EXPECT_EQ(hl.channelIndex(pt12), (unsigned int)12);
926  EXPECT_EQ(hl.channelIndex(pt13), (unsigned int)13);
927  EXPECT_EQ(hl.channelIndex(pt14), (unsigned int)14);
928  EXPECT_EQ(hl.channelIndex(pt15), (unsigned int)15);
929  EXPECT_EQ(hl.channelIndex(pt16), (unsigned int)16);
930  EXPECT_EQ(hl.channelIndex(pt17), (unsigned int)17);
931  EXPECT_EQ(hl.channelIndex(pt18), (unsigned int)18);
932  EXPECT_EQ(hl.channelIndex(pt19), (unsigned int)19);
933  EXPECT_EQ(hl.channelIndex(pt20), (unsigned int)20);
934  EXPECT_EQ(hl.channelIndex(pt21), (unsigned int)21);
935  EXPECT_EQ(hl.channelIndex(pt22), (unsigned int)22);
936  EXPECT_EQ(hl.channelIndex(pt23), (unsigned int)23);
937 
938  Point pt24(0.31, 1.44, 0.0);
939  Point pt25(-0.38, 1.61, 0.0);
940  Point pt26(-1.17, 1.52, 0.0);
941  Point pt27(-1.78, 0.38, 0.0);
942  Point pt28(-1.91, -0.42, 0.0);
943  Point pt29(-1.39, -1.24, 0.0);
944  Point pt30(-0.46, -1.74, 0.0);
945  Point pt31(0.18, -1.79, 0.0);
946  Point pt32(1.24, -1.17, 0.0);
947  Point pt33(1.75, -0.57, 0.0);
948  Point pt34(1.51, 0.37, 0.0);
949  Point pt35(1.16, 1.42, 0.0);
950 
951  EXPECT_EQ(hl.channelType(pt24), channel_type::edge);
952  EXPECT_EQ(hl.channelType(pt25), channel_type::edge);
953  EXPECT_EQ(hl.channelType(pt26), channel_type::edge);
954  EXPECT_EQ(hl.channelType(pt27), channel_type::edge);
955  EXPECT_EQ(hl.channelType(pt28), channel_type::edge);
956  EXPECT_EQ(hl.channelType(pt29), channel_type::edge);
957  EXPECT_EQ(hl.channelType(pt30), channel_type::edge);
958  EXPECT_EQ(hl.channelType(pt31), channel_type::edge);
959  EXPECT_EQ(hl.channelType(pt32), channel_type::edge);
960  EXPECT_EQ(hl.channelType(pt33), channel_type::edge);
961  EXPECT_EQ(hl.channelType(pt34), channel_type::edge);
962  EXPECT_EQ(hl.channelType(pt35), channel_type::edge);
963  EXPECT_EQ(hl.channelIndex(pt24), (unsigned int)24);
964  EXPECT_EQ(hl.channelIndex(pt25), (unsigned int)25);
965  // EXPECT_EQ(hl.channelIndex(pt26), (unsigned int)26);
966  EXPECT_EQ(hl.channelIndex(pt27), (unsigned int)27);
967  EXPECT_EQ(hl.channelIndex(pt28), (unsigned int)28);
968  EXPECT_EQ(hl.channelIndex(pt29), (unsigned int)29);
969  EXPECT_EQ(hl.channelIndex(pt30), (unsigned int)30);
970  EXPECT_EQ(hl.channelIndex(pt31), (unsigned int)31);
971  EXPECT_EQ(hl.channelIndex(pt32), (unsigned int)32);
972  EXPECT_EQ(hl.channelIndex(pt33), (unsigned int)33);
973  EXPECT_EQ(hl.channelIndex(pt34), (unsigned int)34);
974  EXPECT_EQ(hl.channelIndex(pt35), (unsigned int)35);
975 
976  Point pt36(1.05, 1.75, 0.0);
977  Point pt37(-1.02, 1.72, 0.0);
978  Point pt38(-2.03, -0.05, 0.0);
979  Point pt39(-1.01, -1.59, 0.0);
980  Point pt40(0.89, -1.79, 0.0);
981  Point pt41(1.98, 0.12, 0.0);
982 
983  EXPECT_EQ(hl.channelType(pt36), channel_type::corner);
984  EXPECT_EQ(hl.channelType(pt37), channel_type::corner);
985  EXPECT_EQ(hl.channelType(pt38), channel_type::corner);
986  EXPECT_EQ(hl.channelType(pt39), channel_type::corner);
987  EXPECT_EQ(hl.channelType(pt40), channel_type::corner);
988  EXPECT_EQ(hl.channelType(pt41), channel_type::corner);
989  EXPECT_EQ(hl.channelIndex(pt36), (unsigned int)36);
990  EXPECT_EQ(hl.channelIndex(pt37), (unsigned int)37);
991  EXPECT_EQ(hl.channelIndex(pt38), (unsigned int)38);
992  EXPECT_EQ(hl.channelIndex(pt39), (unsigned int)39);
993  EXPECT_EQ(hl.channelIndex(pt40), (unsigned int)40);
994  EXPECT_EQ(hl.channelIndex(pt41), (unsigned int)41);
995 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void ErrorVector unsigned int

◆ TEST_F() [9/17]

TEST_F ( HexagonalLatticeTest  ,
gaps1   
)

Definition at line 997 of file HexagonalLatticeTest.C.

998 {
999  Real bp = 4.0, pp = 0.8, pd = 0.6, wd = 0.05, wp = 50.0;
1000  unsigned int nr = 1, a = 2;
1001  HexagonalLatticeUtils hl(bp, pp, pd, wd, wp, nr, a);
1002  const auto & gi = hl.gapIndices();
1003  const auto & lg = hl.localToGlobalGaps();
1004 
1005  EXPECT_EQ(hl.nInteriorGaps(), (unsigned int)0);
1006 
1007  int i = 0;
1008  EXPECT_EQ(gi[i].first, 0);
1009  EXPECT_EQ(gi[i++].second, -1);
1010 
1011  EXPECT_EQ(gi[i].first, 0);
1012  EXPECT_EQ(gi[i++].second, -2);
1013 
1014  EXPECT_EQ(gi[i].first, 0);
1015  EXPECT_EQ(gi[i++].second, -3);
1016 
1017  EXPECT_EQ(gi[i].first, 0);
1018  EXPECT_EQ(gi[i++].second, -4);
1019 
1020  EXPECT_EQ(gi[i].first, 0);
1021  EXPECT_EQ(gi[i++].second, -5);
1022 
1023  EXPECT_EQ(gi[i].first, 0);
1024  EXPECT_EQ(gi[i++].second, -6);
1025 
1026  for (unsigned int i = 0; i < hl.nGaps(); ++i)
1027  EXPECT_FALSE(hl.lastGapInRing(i));
1028 
1029  i = 0;
1030  EXPECT_EQ(lg[i][0], 5);
1031  EXPECT_EQ(lg[i++][1], 0);
1032 
1033  EXPECT_EQ(lg[i][0], 0);
1034  EXPECT_EQ(lg[i++][1], 1);
1035 
1036  EXPECT_EQ(lg[i][0], 1);
1037  EXPECT_EQ(lg[i++][1], 2);
1038 
1039  EXPECT_EQ(lg[i][0], 2);
1040  EXPECT_EQ(lg[i++][1], 3);
1041 
1042  EXPECT_EQ(lg[i][0], 3);
1043  EXPECT_EQ(lg[i++][1], 4);
1044 
1045  EXPECT_EQ(lg[i][0], 4);
1046  EXPECT_EQ(lg[i++][1], 5);
1047 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void ErrorVector unsigned int

◆ TEST_F() [10/17]

TEST_F ( HexagonalLatticeTest  ,
gaps2   
)

Definition at line 1049 of file HexagonalLatticeTest.C.

1050 {
1051  Real bp = 4.0, pp = 0.8, pd = 0.6, wd = 0.05, wp = 50.0;
1052  unsigned int nr = 2, a = 2;
1053  HexagonalLatticeUtils hl(bp, pp, pd, wd, wp, nr, a);
1054  const auto & gi = hl.gapIndices();
1055  const auto & lg = hl.localToGlobalGaps();
1056 
1057  EXPECT_EQ(hl.nInteriorGaps(), (unsigned int)12);
1058 
1059  int i = 0;
1060  EXPECT_EQ(gi[i].first, 0);
1061  EXPECT_EQ(gi[i++].second, 1);
1062 
1063  EXPECT_EQ(gi[i].first, 0);
1064  EXPECT_EQ(gi[i++].second, 2);
1065 
1066  EXPECT_EQ(gi[i].first, 0);
1067  EXPECT_EQ(gi[i++].second, 3);
1068 
1069  EXPECT_EQ(gi[i].first, 0);
1070  EXPECT_EQ(gi[i++].second, 4);
1071 
1072  EXPECT_EQ(gi[i].first, 0);
1073  EXPECT_EQ(gi[i++].second, 5);
1074 
1075  EXPECT_EQ(gi[i].first, 0);
1076  EXPECT_EQ(gi[i++].second, 6);
1077 
1078  EXPECT_EQ(gi[i].first, 1);
1079  EXPECT_EQ(gi[i++].second, 2);
1080 
1081  EXPECT_EQ(gi[i].first, 1);
1082  EXPECT_EQ(gi[i++].second, 6);
1083 
1084  EXPECT_EQ(gi[i].first, 2);
1085  EXPECT_EQ(gi[i++].second, 3);
1086 
1087  EXPECT_EQ(gi[i].first, 3);
1088  EXPECT_EQ(gi[i++].second, 4);
1089 
1090  EXPECT_EQ(gi[i].first, 4);
1091  EXPECT_EQ(gi[i++].second, 5);
1092 
1093  EXPECT_EQ(gi[i].first, 5);
1094  EXPECT_EQ(gi[i++].second, 6);
1095 
1096  EXPECT_EQ(gi[i].first, 1);
1097  EXPECT_EQ(gi[i++].second, -1);
1098 
1099  EXPECT_EQ(gi[i].first, 2);
1100  EXPECT_EQ(gi[i++].second, -1);
1101 
1102  EXPECT_EQ(gi[i].first, 2);
1103  EXPECT_EQ(gi[i++].second, -2);
1104 
1105  EXPECT_EQ(gi[i].first, 3);
1106  EXPECT_EQ(gi[i++].second, -2);
1107 
1108  EXPECT_EQ(gi[i].first, 3);
1109  EXPECT_EQ(gi[i++].second, -3);
1110 
1111  EXPECT_EQ(gi[i].first, 4);
1112  EXPECT_EQ(gi[i++].second, -3);
1113 
1114  EXPECT_EQ(gi[i].first, 4);
1115  EXPECT_EQ(gi[i++].second, -4);
1116 
1117  EXPECT_EQ(gi[i].first, 5);
1118  EXPECT_EQ(gi[i++].second, -4);
1119 
1120  EXPECT_EQ(gi[i].first, 5);
1121  EXPECT_EQ(gi[i++].second, -5);
1122 
1123  EXPECT_EQ(gi[i].first, 6);
1124  EXPECT_EQ(gi[i++].second, -5);
1125 
1126  EXPECT_EQ(gi[i].first, 6);
1127  EXPECT_EQ(gi[i++].second, -6);
1128 
1129  EXPECT_EQ(gi[i].first, 1);
1130  EXPECT_EQ(gi[i++].second, -6);
1131 
1132  for (unsigned int i = 0; i < hl.nGaps(); ++i)
1133  {
1134  if (i == 7)
1135  EXPECT_TRUE(hl.lastGapInRing(i));
1136  else
1137  EXPECT_FALSE(hl.lastGapInRing(i));
1138  }
1139 
1140  i = 0;
1141  EXPECT_EQ(lg[i][0], 0);
1142  EXPECT_EQ(lg[i][1], 6);
1143  EXPECT_EQ(lg[i++][2], 1);
1144 
1145  EXPECT_EQ(lg[i][0], 1);
1146  EXPECT_EQ(lg[i][1], 8);
1147  EXPECT_EQ(lg[i++][2], 2);
1148 
1149  EXPECT_EQ(lg[i][0], 2);
1150  EXPECT_EQ(lg[i][1], 9);
1151  EXPECT_EQ(lg[i++][2], 3);
1152 
1153  EXPECT_EQ(lg[i][0], 3);
1154  EXPECT_EQ(lg[i][1], 10);
1155  EXPECT_EQ(lg[i++][2], 4);
1156 
1157  EXPECT_EQ(lg[i][0], 4);
1158  EXPECT_EQ(lg[i][1], 11);
1159  EXPECT_EQ(lg[i++][2], 5);
1160 
1161  EXPECT_EQ(lg[i][0], 5);
1162  EXPECT_EQ(lg[i][1], 7);
1163  EXPECT_EQ(lg[i++][2], 0);
1164 
1165  EXPECT_EQ(lg[i][0], 6);
1166  EXPECT_EQ(lg[i][1], 13);
1167  EXPECT_EQ(lg[i++][2], 12);
1168 
1169  EXPECT_EQ(lg[i][0], 8);
1170  EXPECT_EQ(lg[i][1], 15);
1171  EXPECT_EQ(lg[i++][2], 14);
1172 
1173  EXPECT_EQ(lg[i][0], 9);
1174  EXPECT_EQ(lg[i][1], 17);
1175  EXPECT_EQ(lg[i++][2], 16);
1176 
1177  EXPECT_EQ(lg[i][0], 10);
1178  EXPECT_EQ(lg[i][1], 19);
1179  EXPECT_EQ(lg[i++][2], 18);
1180 
1181  EXPECT_EQ(lg[i][0], 11);
1182  EXPECT_EQ(lg[i][1], 21);
1183  EXPECT_EQ(lg[i++][2], 20);
1184 
1185  EXPECT_EQ(lg[i][0], 7);
1186  EXPECT_EQ(lg[i][1], 23);
1187  EXPECT_EQ(lg[i++][2], 22);
1188 
1189  EXPECT_EQ(lg[i][0], 23);
1190  EXPECT_EQ(lg[i++][1], 12);
1191 
1192  EXPECT_EQ(lg[i][0], 13);
1193  EXPECT_EQ(lg[i++][1], 14);
1194 
1195  EXPECT_EQ(lg[i][0], 15);
1196  EXPECT_EQ(lg[i++][1], 16);
1197 
1198  EXPECT_EQ(lg[i][0], 17);
1199  EXPECT_EQ(lg[i++][1], 18);
1200 
1201  EXPECT_EQ(lg[i][0], 19);
1202  EXPECT_EQ(lg[i++][1], 20);
1203 
1204  EXPECT_EQ(lg[i][0], 21);
1205  EXPECT_EQ(lg[i++][1], 22);
1206 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void ErrorVector unsigned int

◆ TEST_F() [11/17]

TEST_F ( HexagonalLatticeTest  ,
gaps3   
)

Definition at line 1208 of file HexagonalLatticeTest.C.

1209 {
1210  Real bp = 4.0, pp = 0.8, pd = 0.6, wd = 0.05, wp = 50.0;
1211  unsigned int nr = 3, a = 2;
1212  HexagonalLatticeUtils hl(bp, pp, pd, wd, wp, nr, a);
1213  const auto & gi = hl.gapIndices();
1214  const auto & lg = hl.localToGlobalGaps();
1215 
1216  EXPECT_EQ(hl.nInteriorGaps(), (unsigned int)42);
1217 
1218  int i = 0;
1219  EXPECT_EQ(gi[i].first, 0);
1220  EXPECT_EQ(gi[i++].second, 1);
1221 
1222  EXPECT_EQ(gi[i].first, 0);
1223  EXPECT_EQ(gi[i++].second, 2);
1224 
1225  EXPECT_EQ(gi[i].first, 0);
1226  EXPECT_EQ(gi[i++].second, 3);
1227 
1228  EXPECT_EQ(gi[i].first, 0);
1229  EXPECT_EQ(gi[i++].second, 4);
1230 
1231  EXPECT_EQ(gi[i].first, 0);
1232  EXPECT_EQ(gi[i++].second, 5);
1233 
1234  EXPECT_EQ(gi[i].first, 0);
1235  EXPECT_EQ(gi[i++].second, 6);
1236 
1237  EXPECT_EQ(gi[i].first, 1);
1238  EXPECT_EQ(gi[i++].second, 2);
1239 
1240  EXPECT_EQ(gi[i].first, 1);
1241  EXPECT_EQ(gi[i++].second, 6);
1242 
1243  EXPECT_EQ(gi[i].first, 1);
1244  EXPECT_EQ(gi[i++].second, 7);
1245 
1246  EXPECT_EQ(gi[i].first, 1);
1247  EXPECT_EQ(gi[i++].second, 8);
1248 
1249  EXPECT_EQ(gi[i].first, 1);
1250  EXPECT_EQ(gi[i++].second, 18);
1251 
1252  EXPECT_EQ(gi[i].first, 2);
1253  EXPECT_EQ(gi[i++].second, 3);
1254 
1255  EXPECT_EQ(gi[i].first, 2);
1256  EXPECT_EQ(gi[i++].second, 8);
1257 
1258  EXPECT_EQ(gi[i].first, 2);
1259  EXPECT_EQ(gi[i++].second, 9);
1260 
1261  EXPECT_EQ(gi[i].first, 2);
1262  EXPECT_EQ(gi[i++].second, 10);
1263 
1264  EXPECT_EQ(gi[i].first, 3);
1265  EXPECT_EQ(gi[i++].second, 4);
1266 
1267  EXPECT_EQ(gi[i].first, 3);
1268  EXPECT_EQ(gi[i++].second, 10);
1269 
1270  EXPECT_EQ(gi[i].first, 3);
1271  EXPECT_EQ(gi[i++].second, 11);
1272 
1273  EXPECT_EQ(gi[i].first, 3);
1274  EXPECT_EQ(gi[i++].second, 12);
1275 
1276  EXPECT_EQ(gi[i].first, 4);
1277  EXPECT_EQ(gi[i++].second, 5);
1278 
1279  EXPECT_EQ(gi[i].first, 4);
1280  EXPECT_EQ(gi[i++].second, 12);
1281 
1282  EXPECT_EQ(gi[i].first, 4);
1283  EXPECT_EQ(gi[i++].second, 13);
1284 
1285  EXPECT_EQ(gi[i].first, 4);
1286  EXPECT_EQ(gi[i++].second, 14);
1287 
1288  EXPECT_EQ(gi[i].first, 5);
1289  EXPECT_EQ(gi[i++].second, 6);
1290 
1291  EXPECT_EQ(gi[i].first, 5);
1292  EXPECT_EQ(gi[i++].second, 14);
1293 
1294  EXPECT_EQ(gi[i].first, 5);
1295  EXPECT_EQ(gi[i++].second, 15);
1296 
1297  EXPECT_EQ(gi[i].first, 5);
1298  EXPECT_EQ(gi[i++].second, 16);
1299 
1300  EXPECT_EQ(gi[i].first, 6);
1301  EXPECT_EQ(gi[i++].second, 16);
1302 
1303  EXPECT_EQ(gi[i].first, 6);
1304  EXPECT_EQ(gi[i++].second, 17);
1305 
1306  EXPECT_EQ(gi[i].first, 6);
1307  EXPECT_EQ(gi[i++].second, 18);
1308 
1309  EXPECT_EQ(gi[i].first, 7);
1310  EXPECT_EQ(gi[i++].second, 8);
1311 
1312  EXPECT_EQ(gi[i].first, 7);
1313  EXPECT_EQ(gi[i++].second, 18);
1314 
1315  EXPECT_EQ(gi[i].first, 8);
1316  EXPECT_EQ(gi[i++].second, 9);
1317 
1318  EXPECT_EQ(gi[i].first, 9);
1319  EXPECT_EQ(gi[i++].second, 10);
1320 
1321  EXPECT_EQ(gi[i].first, 10);
1322  EXPECT_EQ(gi[i++].second, 11);
1323 
1324  EXPECT_EQ(gi[i].first, 11);
1325  EXPECT_EQ(gi[i++].second, 12);
1326 
1327  EXPECT_EQ(gi[i].first, 12);
1328  EXPECT_EQ(gi[i++].second, 13);
1329 
1330  EXPECT_EQ(gi[i].first, 13);
1331  EXPECT_EQ(gi[i++].second, 14);
1332 
1333  EXPECT_EQ(gi[i].first, 14);
1334  EXPECT_EQ(gi[i++].second, 15);
1335 
1336  EXPECT_EQ(gi[i].first, 15);
1337  EXPECT_EQ(gi[i++].second, 16);
1338 
1339  EXPECT_EQ(gi[i].first, 16);
1340  EXPECT_EQ(gi[i++].second, 17);
1341 
1342  EXPECT_EQ(gi[i].first, 17);
1343  EXPECT_EQ(gi[i++].second, 18);
1344 
1345  EXPECT_EQ(gi[i].first, 7);
1346  EXPECT_EQ(gi[i++].second, -1);
1347 
1348  EXPECT_EQ(gi[i].first, 8);
1349  EXPECT_EQ(gi[i++].second, -1);
1350 
1351  EXPECT_EQ(gi[i].first, 9);
1352  EXPECT_EQ(gi[i++].second, -1);
1353 
1354  EXPECT_EQ(gi[i].first, 9);
1355  EXPECT_EQ(gi[i++].second, -2);
1356 
1357  EXPECT_EQ(gi[i].first, 10);
1358  EXPECT_EQ(gi[i++].second, -2);
1359 
1360  EXPECT_EQ(gi[i].first, 11);
1361  EXPECT_EQ(gi[i++].second, -2);
1362 
1363  EXPECT_EQ(gi[i].first, 11);
1364  EXPECT_EQ(gi[i++].second, -3);
1365 
1366  EXPECT_EQ(gi[i].first, 12);
1367  EXPECT_EQ(gi[i++].second, -3);
1368 
1369  EXPECT_EQ(gi[i].first, 13);
1370  EXPECT_EQ(gi[i++].second, -3);
1371 
1372  EXPECT_EQ(gi[i].first, 13);
1373  EXPECT_EQ(gi[i++].second, -4);
1374 
1375  EXPECT_EQ(gi[i].first, 14);
1376  EXPECT_EQ(gi[i++].second, -4);
1377 
1378  EXPECT_EQ(gi[i].first, 15);
1379  EXPECT_EQ(gi[i++].second, -4);
1380 
1381  EXPECT_EQ(gi[i].first, 15);
1382  EXPECT_EQ(gi[i++].second, -5);
1383 
1384  EXPECT_EQ(gi[i].first, 16);
1385  EXPECT_EQ(gi[i++].second, -5);
1386 
1387  EXPECT_EQ(gi[i].first, 17);
1388  EXPECT_EQ(gi[i++].second, -5);
1389 
1390  EXPECT_EQ(gi[i].first, 17);
1391  EXPECT_EQ(gi[i++].second, -6);
1392 
1393  EXPECT_EQ(gi[i].first, 18);
1394  EXPECT_EQ(gi[i++].second, -6);
1395 
1396  EXPECT_EQ(gi[i].first, 7);
1397  EXPECT_EQ(gi[i++].second, -6);
1398 
1399  for (unsigned int i = 0; i < hl.nGaps(); ++i)
1400  {
1401  if (i == 7 || i == 31)
1402  EXPECT_TRUE(hl.lastGapInRing(i));
1403  else
1404  EXPECT_FALSE(hl.lastGapInRing(i));
1405  }
1406 
1407  i = 0;
1408  EXPECT_EQ(lg[i][0], 0);
1409  EXPECT_EQ(lg[i][1], 6);
1410  EXPECT_EQ(lg[i++][2], 1);
1411 
1412  EXPECT_EQ(lg[i][0], 1);
1413  EXPECT_EQ(lg[i][1], 11);
1414  EXPECT_EQ(lg[i++][2], 2);
1415 
1416  EXPECT_EQ(lg[i][0], 2);
1417  EXPECT_EQ(lg[i][1], 15);
1418  EXPECT_EQ(lg[i++][2], 3);
1419 
1420  EXPECT_EQ(lg[i][0], 3);
1421  EXPECT_EQ(lg[i][1], 19);
1422  EXPECT_EQ(lg[i++][2], 4);
1423 
1424  EXPECT_EQ(lg[i][0], 4);
1425  EXPECT_EQ(lg[i][1], 23);
1426  EXPECT_EQ(lg[i++][2], 5);
1427 
1428  EXPECT_EQ(lg[i][0], 5);
1429  EXPECT_EQ(lg[i][1], 7);
1430  EXPECT_EQ(lg[i++][2], 0);
1431 
1432  EXPECT_EQ(lg[i][0], 8);
1433  EXPECT_EQ(lg[i][1], 30);
1434  EXPECT_EQ(lg[i++][2], 9);
1435 
1436  EXPECT_EQ(lg[i][0], 12);
1437  EXPECT_EQ(lg[i][1], 6);
1438  EXPECT_EQ(lg[i++][2], 9);
1439 
1440  EXPECT_EQ(lg[i][0], 12);
1441  EXPECT_EQ(lg[i][1], 32);
1442  EXPECT_EQ(lg[i++][2], 13);
1443 
1444  EXPECT_EQ(lg[i][0], 13);
1445  EXPECT_EQ(lg[i][1], 33);
1446  EXPECT_EQ(lg[i++][2], 14);
1447 
1448  EXPECT_EQ(lg[i][0], 16);
1449  EXPECT_EQ(lg[i][1], 11);
1450  EXPECT_EQ(lg[i++][2], 14);
1451 
1452  EXPECT_EQ(lg[i][0], 16);
1453  EXPECT_EQ(lg[i][1], 34);
1454  EXPECT_EQ(lg[i++][2], 17);
1455 
1456  EXPECT_EQ(lg[i][0], 17);
1457  EXPECT_EQ(lg[i][1], 35);
1458  EXPECT_EQ(lg[i++][2], 18);
1459 
1460  EXPECT_EQ(lg[i][0], 20);
1461  EXPECT_EQ(lg[i][1], 15);
1462  EXPECT_EQ(lg[i++][2], 18);
1463 
1464  EXPECT_EQ(lg[i][0], 20);
1465  EXPECT_EQ(lg[i][1], 36);
1466  EXPECT_EQ(lg[i++][2], 21);
1467 
1468  EXPECT_EQ(lg[i][0], 21);
1469  EXPECT_EQ(lg[i][1], 37);
1470  EXPECT_EQ(lg[i++][2], 22);
1471 
1472  EXPECT_EQ(lg[i][0], 24);
1473  EXPECT_EQ(lg[i][1], 19);
1474  EXPECT_EQ(lg[i++][2], 22);
1475 
1476  EXPECT_EQ(lg[i][0], 24);
1477  EXPECT_EQ(lg[i][1], 38);
1478  EXPECT_EQ(lg[i++][2], 25);
1479 
1480  EXPECT_EQ(lg[i][0], 25);
1481  EXPECT_EQ(lg[i][1], 39);
1482  EXPECT_EQ(lg[i++][2], 26);
1483 
1484  EXPECT_EQ(lg[i][0], 27);
1485  EXPECT_EQ(lg[i][1], 23);
1486  EXPECT_EQ(lg[i++][2], 26);
1487 
1488  EXPECT_EQ(lg[i][0], 27);
1489  EXPECT_EQ(lg[i][1], 40);
1490  EXPECT_EQ(lg[i++][2], 28);
1491 
1492  EXPECT_EQ(lg[i][0], 28);
1493  EXPECT_EQ(lg[i][1], 41);
1494  EXPECT_EQ(lg[i++][2], 29);
1495 
1496  EXPECT_EQ(lg[i][0], 10);
1497  EXPECT_EQ(lg[i][1], 7);
1498  EXPECT_EQ(lg[i++][2], 29);
1499 
1500  EXPECT_EQ(lg[i][0], 10);
1501  EXPECT_EQ(lg[i][1], 31);
1502  EXPECT_EQ(lg[i++][2], 8);
1503 
1504  // edge channels
1505  EXPECT_EQ(lg[i][0], 30);
1506  EXPECT_EQ(lg[i][1], 43);
1507  EXPECT_EQ(lg[i++][2], 42);
1508 
1509  EXPECT_EQ(lg[i][0], 32);
1510  EXPECT_EQ(lg[i][1], 44);
1511  EXPECT_EQ(lg[i++][2], 43);
1512 
1513  EXPECT_EQ(lg[i][0], 33);
1514  EXPECT_EQ(lg[i][1], 46);
1515  EXPECT_EQ(lg[i++][2], 45);
1516 
1517  EXPECT_EQ(lg[i][0], 34);
1518  EXPECT_EQ(lg[i][1], 47);
1519  EXPECT_EQ(lg[i++][2], 46);
1520 
1521  EXPECT_EQ(lg[i][0], 35);
1522  EXPECT_EQ(lg[i][1], 49);
1523  EXPECT_EQ(lg[i++][2], 48);
1524 
1525  EXPECT_EQ(lg[i][0], 36);
1526  EXPECT_EQ(lg[i][1], 50);
1527  EXPECT_EQ(lg[i++][2], 49);
1528 
1529  EXPECT_EQ(lg[i][0], 37);
1530  EXPECT_EQ(lg[i][1], 52);
1531  EXPECT_EQ(lg[i++][2], 51);
1532 
1533  EXPECT_EQ(lg[i][0], 38);
1534  EXPECT_EQ(lg[i][1], 53);
1535  EXPECT_EQ(lg[i++][2], 52);
1536 
1537  EXPECT_EQ(lg[i][0], 39);
1538  EXPECT_EQ(lg[i][1], 55);
1539  EXPECT_EQ(lg[i++][2], 54);
1540 
1541  EXPECT_EQ(lg[i][0], 40);
1542  EXPECT_EQ(lg[i][1], 56);
1543  EXPECT_EQ(lg[i++][2], 55);
1544 
1545  EXPECT_EQ(lg[i][0], 41);
1546  EXPECT_EQ(lg[i][1], 58);
1547  EXPECT_EQ(lg[i++][2], 57);
1548 
1549  EXPECT_EQ(lg[i][0], 31);
1550  EXPECT_EQ(lg[i][1], 59);
1551  EXPECT_EQ(lg[i++][2], 58);
1552 
1553  // corner channels
1554  EXPECT_EQ(lg[i][0], 59);
1555  EXPECT_EQ(lg[i++][1], 42);
1556 
1557  EXPECT_EQ(lg[i][0], 44);
1558  EXPECT_EQ(lg[i++][1], 45);
1559 
1560  EXPECT_EQ(lg[i][0], 47);
1561  EXPECT_EQ(lg[i++][1], 48);
1562 
1563  EXPECT_EQ(lg[i][0], 50);
1564  EXPECT_EQ(lg[i++][1], 51);
1565 
1566  EXPECT_EQ(lg[i][0], 53);
1567  EXPECT_EQ(lg[i++][1], 54);
1568 
1569  EXPECT_EQ(lg[i][0], 56);
1570  EXPECT_EQ(lg[i++][1], 57);
1571 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void ErrorVector unsigned int

◆ TEST_F() [12/17]

TEST_F ( HexagonalLatticeTest  ,
closest_gap   
)

Definition at line 1573 of file HexagonalLatticeTest.C.

1574 {
1575  Real bp = 4.0, pp = 0.8, pd = 0.6, wd = 0.05, wp = 50.0;
1576  unsigned int nr = 3, a = 2;
1577  HexagonalLatticeUtils hl(bp, pp, pd, wd, wp, nr, a);
1578 
1579  Point pt1(0.23, 0.27, 0.0);
1580  EXPECT_EQ(hl.gapIndex(pt1), (unsigned int)0);
1581 
1582  Point pt2(-0.5, 0.29, 0.0);
1583  EXPECT_EQ(hl.gapIndex(pt2), (unsigned int)11);
1584 
1585  Point pt3(1.14, 0.275, 0.0);
1586  EXPECT_EQ(hl.gapIndex(pt3), (unsigned int)29);
1587 
1588  Point pt4(-0.77, 1.015, 0.0);
1589  EXPECT_EQ(hl.gapIndex(pt4), (unsigned int)13);
1590 
1591  Point pt5(-0.84, 0.445, 0.0);
1592  EXPECT_EQ(hl.gapIndex(pt5), (unsigned int)16);
1593 
1594  Point pt6(-0.47, 1.55, 0.0);
1595  EXPECT_EQ(hl.gapIndex(pt6), (unsigned int)32);
1596 
1597  Point pt7(-0.069, 1.94, 0.0);
1598  EXPECT_EQ(hl.gapIndex(pt7), (unsigned int)43);
1599 
1600  Point pt8(-1.22, 1.79, 0.0);
1601  EXPECT_EQ(hl.gapIndex(pt8), (unsigned int)45);
1602 
1603  Point pt10(-0.26, -1.61, 0.0);
1604  EXPECT_EQ(hl.gapIndex(pt10), (unsigned int)37);
1605 
1606  Point pt11(2.23, 0.03, 0.0);
1607  EXPECT_EQ(hl.gapIndex(pt11), (unsigned int)57);
1608 
1609  Point pt12(-1.77, -0.70, 0.0);
1610  EXPECT_EQ(hl.gapIndex(pt12), (unsigned int)49);
1611 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void ErrorVector unsigned int

◆ TEST_F() [13/17]

TEST_F ( HexagonalLatticeTest  ,
normals1   
)

Definition at line 1613 of file HexagonalLatticeTest.C.

1614 {
1615  Real bp = 4.0, pp = 0.8, pd = 0.6, wd = 0.05, wp = 50.0;
1616  unsigned int nr = 1, a = 2;
1617  HexagonalLatticeUtils hl(bp, pp, pd, wd, wp, nr, a);
1618  const auto & normals = hl.gapUnitNormals();
1619  Real sin60 = std::sqrt(3.0) / 2.0;
1620 
1621  for (const auto & n : normals)
1622  EXPECT_DOUBLE_EQ(n(2), 0.0);
1623 
1624  EXPECT_DOUBLE_EQ(normals[0](0), -1.0);
1625  EXPECT_DOUBLE_EQ(normals[0](1), 0.0);
1626 
1627  EXPECT_DOUBLE_EQ(normals[1](0), -0.5);
1628  EXPECT_DOUBLE_EQ(normals[1](1), -sin60);
1629 
1630  EXPECT_DOUBLE_EQ(normals[2](0), 0.5);
1631  EXPECT_DOUBLE_EQ(normals[2](1), -sin60);
1632 
1633  EXPECT_DOUBLE_EQ(normals[3](0), 1.0);
1634  EXPECT_DOUBLE_EQ(normals[3](1), 0.0);
1635 
1636  EXPECT_DOUBLE_EQ(normals[4](0), 0.5);
1637  EXPECT_DOUBLE_EQ(normals[4](1), sin60);
1638 
1639  EXPECT_DOUBLE_EQ(normals[5](0), -0.5);
1640  EXPECT_DOUBLE_EQ(normals[5](1), sin60);
1641 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [14/17]

TEST_F ( HexagonalLatticeTest  ,
normals2   
)

Definition at line 1643 of file HexagonalLatticeTest.C.

1644 {
1645  Real bp = 4.0, pp = 0.8, pd = 0.6, wd = 0.05, wp = 50.0;
1646  unsigned int nr = 2, a = 2;
1647  HexagonalLatticeUtils hl(bp, pp, pd, wd, wp, nr, a);
1648  const auto & normals = hl.gapUnitNormals();
1649  Real sin60 = std::sqrt(3.0) / 2.0;
1650 
1651  for (const auto & n : normals)
1652  EXPECT_DOUBLE_EQ(n(2), 0.0);
1653 
1654  EXPECT_DOUBLE_EQ(normals[0](0), -sin60);
1655  EXPECT_DOUBLE_EQ(normals[0](1), 0.5);
1656 
1657  EXPECT_DOUBLE_EQ(normals[1](0), -sin60);
1658  EXPECT_DOUBLE_EQ(normals[1](1), -0.5);
1659 
1660  EXPECT_DOUBLE_EQ(normals[2](0), 0.0);
1661  EXPECT_DOUBLE_EQ(normals[2](1), -1.0);
1662 
1663  EXPECT_DOUBLE_EQ(normals[3](0), sin60);
1664  EXPECT_DOUBLE_EQ(normals[3](1), -0.5);
1665 
1666  EXPECT_DOUBLE_EQ(normals[4](0), sin60);
1667  EXPECT_DOUBLE_EQ(normals[4](1), 0.5);
1668 
1669  EXPECT_DOUBLE_EQ(normals[5](0), 0.0);
1670  EXPECT_DOUBLE_EQ(normals[5](1), 1.0);
1671 
1672  EXPECT_DOUBLE_EQ(normals[6](0), 0.0);
1673  EXPECT_DOUBLE_EQ(normals[6](1), -1.0);
1674 
1675  EXPECT_DOUBLE_EQ(normals[7](0), -sin60);
1676  EXPECT_DOUBLE_EQ(normals[7](1), -0.5);
1677 
1678  EXPECT_DOUBLE_EQ(normals[8](0), sin60);
1679  EXPECT_DOUBLE_EQ(normals[8](1), -0.5);
1680 
1681  EXPECT_DOUBLE_EQ(normals[9](0), sin60);
1682  EXPECT_DOUBLE_EQ(normals[9](1), 0.5);
1683 
1684  EXPECT_DOUBLE_EQ(normals[10](0), 0.0);
1685  EXPECT_DOUBLE_EQ(normals[10](1), 1.0);
1686 
1687  EXPECT_DOUBLE_EQ(normals[11](0), -sin60);
1688  EXPECT_DOUBLE_EQ(normals[11](1), 0.5);
1689 
1690  EXPECT_DOUBLE_EQ(normals[12](0), -1.0);
1691  EXPECT_DOUBLE_EQ(normals[12](1), 0.0);
1692 
1693  EXPECT_DOUBLE_EQ(normals[13](0), -1.0);
1694  EXPECT_DOUBLE_EQ(normals[13](1), 0.0);
1695 
1696  EXPECT_DOUBLE_EQ(normals[14](0), -0.5);
1697  EXPECT_DOUBLE_EQ(normals[14](1), -sin60);
1698 
1699  EXPECT_DOUBLE_EQ(normals[15](0), -0.5);
1700  EXPECT_DOUBLE_EQ(normals[15](1), -sin60);
1701 
1702  EXPECT_DOUBLE_EQ(normals[16](0), 0.5);
1703  EXPECT_DOUBLE_EQ(normals[16](1), -sin60);
1704 
1705  EXPECT_DOUBLE_EQ(normals[17](0), 0.5);
1706  EXPECT_DOUBLE_EQ(normals[17](1), -sin60);
1707 
1708  EXPECT_DOUBLE_EQ(normals[18](0), 1.0);
1709  EXPECT_DOUBLE_EQ(normals[18](1), 0.0);
1710 
1711  EXPECT_DOUBLE_EQ(normals[19](0), 1.0);
1712  EXPECT_DOUBLE_EQ(normals[19](1), 0.0);
1713 
1714  EXPECT_DOUBLE_EQ(normals[20](0), 0.5);
1715  EXPECT_DOUBLE_EQ(normals[20](1), sin60);
1716 
1717  EXPECT_DOUBLE_EQ(normals[21](0), 0.5);
1718  EXPECT_DOUBLE_EQ(normals[21](1), sin60);
1719 
1720  EXPECT_DOUBLE_EQ(normals[22](0), -0.5);
1721  EXPECT_DOUBLE_EQ(normals[22](1), sin60);
1722 
1723  EXPECT_DOUBLE_EQ(normals[23](0), -0.5);
1724  EXPECT_DOUBLE_EQ(normals[23](1), sin60);
1725 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [15/17]

TEST_F ( HexagonalLatticeTest  ,
normals3   
)

Definition at line 1727 of file HexagonalLatticeTest.C.

1728 {
1729  Real bp = 4.0, pp = 0.8, pd = 0.6, wd = 0.05, wp = 50.0;
1730  unsigned int nr = 3, a = 2;
1731  HexagonalLatticeUtils hl(bp, pp, pd, wd, wp, nr, a);
1732  const auto & normals = hl.gapUnitNormals();
1733  Real sin60 = std::sqrt(3.0) / 2.0;
1734 
1735  for (const auto & n : normals)
1736  EXPECT_DOUBLE_EQ(n(2), 0.0);
1737 
1738  EXPECT_DOUBLE_EQ(normals[0](0), -sin60);
1739  EXPECT_DOUBLE_EQ(normals[0](1), 0.5);
1740 
1741  EXPECT_DOUBLE_EQ(normals[1](0), -sin60);
1742  EXPECT_DOUBLE_EQ(normals[1](1), -0.5);
1743 
1744  EXPECT_DOUBLE_EQ(normals[2](0), 0.0);
1745  EXPECT_DOUBLE_EQ(normals[2](1), -1.0);
1746 
1747  EXPECT_DOUBLE_EQ(normals[3](0), sin60);
1748  EXPECT_DOUBLE_EQ(normals[3](1), -0.5);
1749 
1750  EXPECT_DOUBLE_EQ(normals[4](0), sin60);
1751  EXPECT_DOUBLE_EQ(normals[4](1), 0.5);
1752 
1753  EXPECT_DOUBLE_EQ(normals[5](0), 0.0);
1754  EXPECT_DOUBLE_EQ(normals[5](1), 1.0);
1755 
1756  EXPECT_DOUBLE_EQ(normals[6](0), 0.0);
1757  EXPECT_DOUBLE_EQ(normals[6](1), -1.0);
1758 
1759  EXPECT_DOUBLE_EQ(normals[7](0), -sin60);
1760  EXPECT_DOUBLE_EQ(normals[7](1), -0.5);
1761 
1762  EXPECT_DOUBLE_EQ(normals[8](0), -sin60);
1763  EXPECT_DOUBLE_EQ(normals[8](1), 0.5);
1764 
1765  EXPECT_DOUBLE_EQ(normals[9](0), -sin60);
1766  EXPECT_DOUBLE_EQ(normals[9](1), -0.5);
1767 
1768  EXPECT_DOUBLE_EQ(normals[10](0), 0.0);
1769  EXPECT_DOUBLE_EQ(normals[10](1), 1.0);
1770 
1771  EXPECT_DOUBLE_EQ(normals[11](0), sin60);
1772  EXPECT_DOUBLE_EQ(normals[11](1), -0.5);
1773 
1774  EXPECT_DOUBLE_EQ(normals[12](0), -sin60);
1775  EXPECT_DOUBLE_EQ(normals[12](1), 0.5);
1776 
1777  EXPECT_DOUBLE_EQ(normals[13](0), -sin60);
1778  EXPECT_DOUBLE_EQ(normals[13](1), -0.5);
1779 
1780  EXPECT_DOUBLE_EQ(normals[14](0), 0.0);
1781  EXPECT_DOUBLE_EQ(normals[14](1), -1.0);
1782 
1783  EXPECT_DOUBLE_EQ(normals[15](0), sin60);
1784  EXPECT_DOUBLE_EQ(normals[15](1), 0.5);
1785 
1786  EXPECT_DOUBLE_EQ(normals[16](0), -sin60);
1787  EXPECT_DOUBLE_EQ(normals[16](1), -0.5);
1788 
1789  EXPECT_DOUBLE_EQ(normals[17](0), 0.0);
1790  EXPECT_DOUBLE_EQ(normals[17](1), -1.0);
1791 
1792  EXPECT_DOUBLE_EQ(normals[18](0), sin60);
1793  EXPECT_DOUBLE_EQ(normals[18](1), -0.5);
1794 
1795  EXPECT_DOUBLE_EQ(normals[19](0), 0.0);
1796  EXPECT_DOUBLE_EQ(normals[19](1), 1.0);
1797 
1798  EXPECT_DOUBLE_EQ(normals[20](0), 0.0);
1799  EXPECT_DOUBLE_EQ(normals[20](1), -1.0);
1800 
1801  EXPECT_DOUBLE_EQ(normals[21](0), sin60);
1802  EXPECT_DOUBLE_EQ(normals[21](1), -0.5);
1803 
1804  EXPECT_DOUBLE_EQ(normals[22](0), sin60);
1805  EXPECT_DOUBLE_EQ(normals[22](1), 0.5);
1806 
1807  EXPECT_DOUBLE_EQ(normals[23](0), -sin60);
1808  EXPECT_DOUBLE_EQ(normals[23](1), 0.5);
1809 
1810  EXPECT_DOUBLE_EQ(normals[24](0), sin60);
1811  EXPECT_DOUBLE_EQ(normals[24](1), -0.5);
1812 
1813  EXPECT_DOUBLE_EQ(normals[25](0), sin60);
1814  EXPECT_DOUBLE_EQ(normals[25](1), 0.5);
1815 
1816  EXPECT_DOUBLE_EQ(normals[26](0), 0.0);
1817  EXPECT_DOUBLE_EQ(normals[26](1), 1.0);
1818 
1819  EXPECT_DOUBLE_EQ(normals[27](0), sin60);
1820  EXPECT_DOUBLE_EQ(normals[27](1), 0.5);
1821 
1822  EXPECT_DOUBLE_EQ(normals[28](0), 0.0);
1823  EXPECT_DOUBLE_EQ(normals[28](1), 1.0);
1824 
1825  EXPECT_DOUBLE_EQ(normals[29](0), -sin60);
1826  EXPECT_DOUBLE_EQ(normals[29](1), 0.5);
1827 
1828  EXPECT_DOUBLE_EQ(normals[30](0), 0.0);
1829  EXPECT_DOUBLE_EQ(normals[30](1), -1.0);
1830 
1831  EXPECT_DOUBLE_EQ(normals[31](0), -sin60);
1832  EXPECT_DOUBLE_EQ(normals[31](1), -0.5);
1833 
1834  EXPECT_DOUBLE_EQ(normals[32](0), 0.0);
1835  EXPECT_DOUBLE_EQ(normals[32](1), -1.0);
1836 
1837  EXPECT_DOUBLE_EQ(normals[33](0), sin60);
1838  EXPECT_DOUBLE_EQ(normals[33](1), -0.5);
1839 
1840  EXPECT_DOUBLE_EQ(normals[34](0), sin60);
1841  EXPECT_DOUBLE_EQ(normals[34](1), -0.5);
1842 
1843  EXPECT_DOUBLE_EQ(normals[35](0), sin60);
1844  EXPECT_DOUBLE_EQ(normals[35](1), 0.5);
1845 
1846  EXPECT_DOUBLE_EQ(normals[36](0), sin60);
1847  EXPECT_DOUBLE_EQ(normals[36](1), 0.5);
1848 
1849  EXPECT_DOUBLE_EQ(normals[37](0), 0.0);
1850  EXPECT_DOUBLE_EQ(normals[37](1), 1.0);
1851 
1852  EXPECT_DOUBLE_EQ(normals[38](0), 0.0);
1853  EXPECT_DOUBLE_EQ(normals[38](1), 1.0);
1854 
1855  EXPECT_DOUBLE_EQ(normals[39](0), -sin60);
1856  EXPECT_DOUBLE_EQ(normals[39](1), 0.5);
1857 
1858  EXPECT_DOUBLE_EQ(normals[40](0), -sin60);
1859  EXPECT_DOUBLE_EQ(normals[40](1), 0.5);
1860 
1861  EXPECT_DOUBLE_EQ(normals[41](0), -sin60);
1862  EXPECT_DOUBLE_EQ(normals[41](1), -0.5);
1863 
1864  EXPECT_DOUBLE_EQ(normals[42](0), -1.0);
1865  EXPECT_DOUBLE_EQ(normals[42](1), 0.0);
1866 
1867  EXPECT_DOUBLE_EQ(normals[43](0), -1.0);
1868  EXPECT_DOUBLE_EQ(normals[43](1), 0.0);
1869 
1870  EXPECT_DOUBLE_EQ(normals[44](0), -1.0);
1871  EXPECT_DOUBLE_EQ(normals[44](1), 0.0);
1872 
1873  EXPECT_DOUBLE_EQ(normals[45](0), -0.5);
1874  EXPECT_DOUBLE_EQ(normals[45](1), -sin60);
1875 
1876  EXPECT_DOUBLE_EQ(normals[46](0), -0.5);
1877  EXPECT_DOUBLE_EQ(normals[46](1), -sin60);
1878 
1879  EXPECT_DOUBLE_EQ(normals[47](0), -0.5);
1880  EXPECT_DOUBLE_EQ(normals[47](1), -sin60);
1881 
1882  EXPECT_DOUBLE_EQ(normals[48](0), 0.5);
1883  EXPECT_DOUBLE_EQ(normals[48](1), -sin60);
1884 
1885  EXPECT_DOUBLE_EQ(normals[49](0), 0.5);
1886  EXPECT_DOUBLE_EQ(normals[49](1), -sin60);
1887 
1888  EXPECT_DOUBLE_EQ(normals[50](0), 0.5);
1889  EXPECT_DOUBLE_EQ(normals[50](1), -sin60);
1890 
1891  EXPECT_DOUBLE_EQ(normals[51](0), 1.0);
1892  EXPECT_DOUBLE_EQ(normals[51](1), 0.0);
1893 
1894  EXPECT_DOUBLE_EQ(normals[52](0), 1.0);
1895  EXPECT_DOUBLE_EQ(normals[52](1), 0.0);
1896 
1897  EXPECT_DOUBLE_EQ(normals[53](0), 1.0);
1898  EXPECT_DOUBLE_EQ(normals[53](1), 0.0);
1899 
1900  EXPECT_DOUBLE_EQ(normals[54](0), 0.5);
1901  EXPECT_DOUBLE_EQ(normals[54](1), sin60);
1902 
1903  EXPECT_DOUBLE_EQ(normals[55](0), 0.5);
1904  EXPECT_DOUBLE_EQ(normals[55](1), sin60);
1905 
1906  EXPECT_DOUBLE_EQ(normals[56](0), 0.5);
1907  EXPECT_DOUBLE_EQ(normals[56](1), sin60);
1908 
1909  EXPECT_DOUBLE_EQ(normals[57](0), -0.5);
1910  EXPECT_DOUBLE_EQ(normals[57](1), sin60);
1911 
1912  EXPECT_DOUBLE_EQ(normals[58](0), -0.5);
1913  EXPECT_DOUBLE_EQ(normals[58](1), sin60);
1914 
1915  EXPECT_DOUBLE_EQ(normals[59](0), -0.5);
1916  EXPECT_DOUBLE_EQ(normals[59](1), sin60);
1917 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST_F() [16/17]

TEST_F ( HexagonalLatticeTest  ,
pin_corners   
)

Definition at line 1919 of file HexagonalLatticeTest.C.

1920 {
1921  Real bp = 4.0, pp = 0.8, pd = 0.6, wd = 0.05, wp = 50.0;
1922  unsigned int nr = 2, a = 2;
1923  HexagonalLatticeUtils hl(bp, pp, pd, wd, wp, nr, a);
1924  const auto & pin_corners = hl.pinCenteredCornerCoordinates();
1925  Real sin60 = std::sqrt(3.0) / 2.0;
1926  Real cos60 = 0.5;
1927 
1928  // center pin
1929  double side = 0.46188021535170065;
1930  const auto & pin0 = pin_corners[0];
1931  EXPECT_DOUBLE_EQ(pin0[0](0), 0.0);
1932  EXPECT_DOUBLE_EQ(pin0[0](1), side);
1933 
1934  EXPECT_DOUBLE_EQ(pin0[1](0), -side * sin60);
1935  EXPECT_DOUBLE_EQ(pin0[1](1), side * cos60);
1936 
1937  EXPECT_DOUBLE_EQ(pin0[2](0), -side * sin60);
1938  EXPECT_DOUBLE_EQ(pin0[2](1), -side * cos60);
1939 
1940  EXPECT_DOUBLE_EQ(pin0[3](0), (unsigned int)0);
1941  EXPECT_DOUBLE_EQ(pin0[3](1), -side);
1942 
1943  EXPECT_DOUBLE_EQ(pin0[4](0), side * sin60);
1944  EXPECT_DOUBLE_EQ(pin0[4](1), -side * cos60);
1945 
1946  EXPECT_DOUBLE_EQ(pin0[5](0), side * sin60);
1947  EXPECT_DOUBLE_EQ(pin0[5](1), side * cos60);
1948 
1949  // second pin
1950  const auto & pin_centers = hl.pinCenters();
1951  const auto & pin1 = pin_corners[1];
1952  double x = pin_centers[1](0);
1953  double y = pin_centers[1](1);
1954 
1955  EXPECT_DOUBLE_EQ(pin1[0](0), x + 0.0);
1956  EXPECT_DOUBLE_EQ(pin1[0](1), y + side);
1957 
1958  ABS_DOUBLE_TEST(pin1[1](0), x + -side * sin60);
1959  EXPECT_DOUBLE_EQ(pin1[1](1), y + side * cos60);
1960 
1961  ABS_DOUBLE_TEST(pin1[2](0), x + -side * sin60);
1962  EXPECT_DOUBLE_EQ(pin1[2](1), y + -side * cos60);
1963 
1964  EXPECT_DOUBLE_EQ(pin1[3](0), x + 0);
1965  EXPECT_DOUBLE_EQ(pin1[3](1), y + -side);
1966 
1967  EXPECT_DOUBLE_EQ(pin1[4](0), x + side * sin60);
1968  EXPECT_DOUBLE_EQ(pin1[4](1), y + -side * cos60);
1969 
1970  EXPECT_DOUBLE_EQ(pin1[5](0), x + side * sin60);
1971  EXPECT_DOUBLE_EQ(pin1[5](1), y + side * cos60);
1972 
1973  // check for bin indexing
1974  Point p(0.07, 0.195, 0.0);
1975  EXPECT_EQ(hl.pinIndex(p), (unsigned int)0);
1976 
1977  p = {0.02, 0.42, 0.0};
1978  EXPECT_EQ(hl.pinIndex(p), (unsigned int)0);
1979 
1980  p = {0.74, 0.46, 0.0};
1981  EXPECT_EQ(hl.pinIndex(p), (unsigned int)1);
1982 
1983  p = {-0.206, 0.668, 0.0};
1984  EXPECT_EQ(hl.pinIndex(p), (unsigned int)2);
1985 
1986  p = {-0.99, 0.313, 0.0};
1987  EXPECT_EQ(hl.pinIndex(p), (unsigned int)3);
1988 
1989  p = {-0.257, -0.67, 0.0};
1990  EXPECT_EQ(hl.pinIndex(p), (unsigned int)4);
1991 
1992  p = {0.67, -0.79, 0.0};
1993  EXPECT_EQ(hl.pinIndex(p), (unsigned int)5);
1994 
1995  p = {0.43, 0.0206, 0.0};
1996  EXPECT_EQ(hl.pinIndex(p), (unsigned int)6);
1997 
1998  p = {0.85, 0.51, 0.0};
1999  EXPECT_EQ(hl.pinIndex(p), (unsigned int)7);
2000 }
const std::vector< double > y
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
const std::vector< double > x
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void ErrorVector unsigned int

◆ TEST_F() [17/17]

TEST_F ( HexagonalLatticeTest  ,
constructor   
)

Definition at line 2002 of file HexagonalLatticeTest.C.

2003 {
2004  Real bp = 4.0, pp = 0.8, pd = 0.6, wd = 0.05, wp = 50.0;
2005  unsigned int nr = 3, a = 2;
2006  HexagonalLatticeUtils hl(bp, pp, pd, wd, wp, nr, a);
2007  EXPECT_DOUBLE_EQ(hl.bundlePitch(), 4.0);
2008  EXPECT_DOUBLE_EQ(hl.pinPitch(), 0.8);
2009  EXPECT_DOUBLE_EQ(hl.pinDiameter(), 0.6);
2010  EXPECT_DOUBLE_EQ(hl.pinRadius(), 0.3);
2011  EXPECT_DOUBLE_EQ(hl.wireDiameter(), 0.05);
2012  EXPECT_DOUBLE_EQ(hl.wirePitch(), 50.0);
2013 }
Class providing various utility functions related to triangular lattices of pins enclosed in a hexago...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real