Debian Codegraph @

packages/panzer/adapters-stk/test/local_mesh/parallel_local_mesh_utilities.cpp

raw
1 // @HEADER
2 // *****************************************************************************
3 // Panzer: A partial differential equation assembly
4 // engine for strongly coupled complex multiphysics systems
5 //
6 // Copyright 2011 NTESS and the Panzer contributors.
7 // SPDX-License-Identifier: BSD-3-Clause
8 // *****************************************************************************
9 // @HEADER
10
11 #include <Teuchos_ConfigDefs.hpp>
12 #include <Teuchos_UnitTestHarness.hpp>
13 #include <Teuchos_RCP.hpp>
14 #include <Teuchos_TimeMonitor.hpp>
15 #include "Teuchos_ParameterList.hpp"
16
17 #include "Teuchos_DefaultComm.hpp"
18 #include "Teuchos_GlobalMPISession.hpp"
19 #include "Teuchos_DefaultComm.hpp"
20 #include "Tpetra_Core.hpp"
21
22 #include "Panzer_STK_Interface.hpp"
23 #include "Panzer_STK_LocalMeshUtilities.hpp"
24
25 #include "Panzer_LocalMeshInfo.hpp"
26 #include "Panzer_STK_ExodusReaderFactory.hpp"
27
28 #include "PanzerSTK_UnitTest_BuildMesh.hpp"
29
30 #include <string>
31
32 namespace panzer_stk {
33 namespace {
34
35 Teuchos::RCP<const panzer::LocalMeshInfo>
36 buildParallelLocalMeshInfo(const std::vector<int> & N, // Cells per dimension
37 const std::vector<int> & B, // Blocks per dimension
38 const std::vector<int> & P, // Processors per dimension
39 const std::vector<double> &L) // Domain length per block
40 {
41 std::vector<int> p;
42 // for(unsigned int i=0; i<N.size(); ++i)
43 // p.push_back(i);
44 Teuchos::RCP<panzer_stk::STK_Interface> mesh = buildParallelMesh(N,B,P,L,p);
45 return generateLocalMeshInfo(*mesh);
46 }
47
48 }
49
50 TEUCHOS_UNIT_TEST(parallelLocalMeshUtilities, no_mesh)
51 {
52 // Make sure if fails when you pass in a null mesh
53 panzer_stk::STK_Interface mesh;
54 TEST_THROW((generateLocalMeshInfo(mesh)),std::logic_error);
55 }
56
57 TEUCHOS_UNIT_TEST(parallelLocalMeshUtilities, 1D_mesh)
58 {
59
60 int myRank=0;
61 MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
62
63 auto mesh_info = buildParallelLocalMeshInfo({3},{2},{2},{2.});
64
65 // Make sure there are two blocks (eblock-0, and eblock-1)
66 TEST_EQUALITY(mesh_info->element_blocks.size(), 2);
67 TEST_EQUALITY(mesh_info->sidesets.size(), 2);
68
69 TEST_ASSERT(mesh_info->has_connectivity);
70
71 if(myRank == 0){
72
73 {
74 const auto & block = mesh_info->element_blocks.at("eblock-0");
75 auto global_cells_h = Kokkos::create_mirror_view(block.global_cells);
76 Kokkos::deep_copy(global_cells_h, block.global_cells);
77
78 out << "Element Block eblock-0" << std::endl;
79
80 // Block should have some basic stuff working
81 TEST_EQUALITY(block.num_owned_cells, 2);
82 TEST_EQUALITY(block.num_ghstd_cells, 1);
83 TEST_EQUALITY(block.num_virtual_cells, 1);
84 TEST_EQUALITY((int) global_cells_h(0), 0);
85 TEST_EQUALITY((int) global_cells_h(1), 1);
86 TEST_EQUALITY((int) global_cells_h(2), 2);
87 TEST_EQUALITY((int) global_cells_h(3), 6);
88 TEST_ASSERT(block.has_connectivity);
89 }
90
91 {
92 const auto & block = mesh_info->element_blocks.at("eblock-1");
93 auto global_cells_h = Kokkos::create_mirror_view(block.global_cells);
94 Kokkos::deep_copy(global_cells_h, block.global_cells);
95
96 out << "Element Block eblock-1" << std::endl;
97
98 // Block should be empty
99 TEST_EQUALITY(block.num_owned_cells, 2);
100 TEST_EQUALITY(block.num_ghstd_cells, 2);
101 TEST_EQUALITY(block.num_virtual_cells, 0);
102 TEST_EQUALITY((int) global_cells_h(0), 3);
103 TEST_EQUALITY((int) global_cells_h(1), 4);
104 TEST_EQUALITY((int) global_cells_h(2), 5);
105 TEST_EQUALITY((int) global_cells_h(3), 2);
106 TEST_ASSERT(block.has_connectivity);
107 }
108
109 {
110 const auto & block = mesh_info->sidesets.at("eblock-0").at("left");
111 auto global_cells_h = Kokkos::create_mirror_view(block.global_cells);
112 Kokkos::deep_copy(global_cells_h, block.global_cells);
113
114 out << "Sideset eblock-0 left" << std::endl;
115
116 // Block should have some basic stuff working
117 TEST_EQUALITY(block.num_owned_cells, 1);
118 TEST_EQUALITY(block.num_ghstd_cells, 0);
119 TEST_EQUALITY(block.num_virtual_cells, 1);
120 TEST_EQUALITY((int) global_cells_h(0), 0);
121 TEST_EQUALITY((int) global_cells_h(1), 6);
122 TEST_ASSERT(block.has_connectivity);
123 }
124
125 // TEUCHOS_ASSERT(mesh_info->sidesets.find("eblock-1") == mesh_info->sidesets.end());
126
127 } else {
128 {
129 const auto & block = mesh_info->element_blocks.at("eblock-0");
130 auto global_cells_h = Kokkos::create_mirror_view(block.global_cells);
131 Kokkos::deep_copy(global_cells_h, block.global_cells);
132
133 out << "Element Block eblock-0" << std::endl;
134
135 // Block should have some basic stuff working
136 TEST_EQUALITY(block.num_owned_cells, 1);
137 TEST_EQUALITY(block.num_ghstd_cells, 2);
138 TEST_EQUALITY(block.num_virtual_cells, 0);
139 TEST_EQUALITY((int) global_cells_h(0), 2);
140 TEST_EQUALITY((int) global_cells_h(1), 3);
141 TEST_EQUALITY((int) global_cells_h(2), 1);
142 TEST_ASSERT(block.has_connectivity);
143 }
144
145 {
146 const auto & block = mesh_info->element_blocks.at("eblock-1");
147 auto global_cells_h = Kokkos::create_mirror_view(block.global_cells);
148 Kokkos::deep_copy(global_cells_h, block.global_cells);
149
150 out << "Element Block eblock-1" << std::endl;
151
152 // Block should be empty
153 TEST_EQUALITY(block.num_owned_cells, 1);
154 TEST_EQUALITY(block.num_ghstd_cells, 1);
155 TEST_EQUALITY(block.num_virtual_cells, 1);
156 TEST_EQUALITY((int) global_cells_h(0), 5);
157 TEST_EQUALITY((int) global_cells_h(1), 4);
158 TEST_EQUALITY((int) global_cells_h(2), 7);
159 TEST_ASSERT(block.has_connectivity);
160 }
161
162 // TEUCHOS_ASSERT(mesh_info->sidesets.find("eblock-0") == mesh_info->sidesets.end());
163
164 {
165 const auto & block = mesh_info->sidesets.at("eblock-1").at("right");
166 auto global_cells_h = Kokkos::create_mirror_view(block.global_cells);
167 Kokkos::deep_copy(global_cells_h, block.global_cells);
168
169 out << "Sideset eblock-1 right" << std::endl;
170
171 // Block should have some basic stuff working
172 TEST_EQUALITY(block.num_owned_cells, 1);
173 TEST_EQUALITY(block.num_ghstd_cells, 0);
174 TEST_EQUALITY(block.num_virtual_cells, 1);
175 TEST_EQUALITY((int) global_cells_h(0), 5);
176 TEST_EQUALITY((int) global_cells_h(1), 7);
177 TEST_ASSERT(block.has_connectivity);
178 }
179 }
180
181 }
182
183 TEUCHOS_UNIT_TEST(parallelLocalMeshUtilities, 2D_mesh)
184 {
185
186 int myRank=0;
187 MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
188
189 auto mesh_info = buildParallelLocalMeshInfo({2,2},{2,1},{2,1},{2.,2.});
190
191 // Make sure there are two blocks (eblock-0, and eblock-1)
192 TEST_EQUALITY(mesh_info->element_blocks.size(), 2);
193 TEST_EQUALITY(mesh_info->sidesets.size(), 2);
194 TEST_ASSERT(mesh_info->has_connectivity);
195
196 if(myRank == 0){
197
198 {
199 const auto & block = mesh_info->element_blocks.at("eblock-0_0");
200
201 out << "Element Block eblock-0_0" << std::endl;
202
203 // Block should have some basic stuff working
204 TEST_EQUALITY(block.num_owned_cells, 2);
205 TEST_EQUALITY(block.num_ghstd_cells, 2);
206 TEST_EQUALITY(block.num_virtual_cells, 4);
207 TEST_ASSERT(block.has_connectivity);
208 }
209
210 {
211 const auto & block = mesh_info->element_blocks.at("eblock-1_0");
212
213 out << "Element Block eblock-1_0" << std::endl;
214
215 // Block should be empty
216 TEST_EQUALITY(block.num_owned_cells, 2);
217 TEST_EQUALITY(block.num_ghstd_cells, 4);
218 TEST_EQUALITY(block.num_virtual_cells, 2);
219 TEST_ASSERT(block.has_connectivity);
220 }
221
222 {
223 const auto & block = mesh_info->sidesets.at("eblock-0_0").at("left");
224
225 out << "Sideset eblock-0_0 left" << std::endl;
226
227 // Block should have some basic stuff working
228 TEST_EQUALITY(block.num_owned_cells, 2);
229 TEST_EQUALITY(block.num_ghstd_cells, 0);
230 TEST_EQUALITY(block.num_virtual_cells, 2);
231 TEST_ASSERT(block.has_connectivity);
232 }
233
234 {
235 const auto & block = mesh_info->sidesets.at("eblock-0_0").at("top");
236
237 out << "Sideset eblock-0_0 top" << std::endl;
238
239 // Block should have some basic stuff working
240 TEST_EQUALITY(block.num_owned_cells, 1);
241 TEST_EQUALITY(block.num_ghstd_cells, 0);
242 TEST_EQUALITY(block.num_virtual_cells, 1);
243 TEST_ASSERT(block.has_connectivity);
244 }
245
246 {
247 const auto & block = mesh_info->sidesets.at("eblock-0_0").at("bottom");
248
249 out << "Sideset eblock-0_0 bottom" << std::endl;
250
251 // Block should have some basic stuff working
252 TEST_EQUALITY(block.num_owned_cells, 1);
253 TEST_EQUALITY(block.num_ghstd_cells, 0);
254 TEST_EQUALITY(block.num_virtual_cells, 1);
255 TEST_ASSERT(block.has_connectivity);
256 }
257
258 // TEUCHOS_ASSERT(mesh_info->sidesets.at("eblock-0_0").find("right") == mesh_info->sidesets.at("eblock-0_0").end());
259
260 // TEUCHOS_ASSERT(mesh_info->sidesets.at("eblock-1_0").find("left") == mesh_info->sidesets.at("eblock-1_0").end());
261
262 // TEUCHOS_ASSERT(mesh_info->sidesets.at("eblock-1_0").find("right") == mesh_info->sidesets.at("eblock-1_0").end());
263
264 {
265 const auto & block = mesh_info->sidesets.at("eblock-1_0").at("top");
266
267 out << "Sideset eblock-1_0 top" << std::endl;
268
269 // Block should have some basic stuff working
270 TEST_EQUALITY(block.num_owned_cells, 1);
271 TEST_EQUALITY(block.num_ghstd_cells, 0);
272 TEST_EQUALITY(block.num_virtual_cells, 1);
273 TEST_ASSERT(block.has_connectivity);
274 }
275
276 {
277 const auto & block = mesh_info->sidesets.at("eblock-1_0").at("bottom");
278
279 out << "Sideset eblock-1_0 bottom" << std::endl;
280
281 // Block should have some basic stuff working
282 TEST_EQUALITY(block.num_owned_cells, 1);
283 TEST_EQUALITY(block.num_ghstd_cells, 0);
284 TEST_EQUALITY(block.num_virtual_cells, 1);
285 TEST_ASSERT(block.has_connectivity);
286 }
287
288 } else {
289
290 {
291 const auto & block = mesh_info->element_blocks.at("eblock-0_0");
292
293 out << "Element Block eblock-0_0" << std::endl;
294
295 // Block should have some basic stuff working
296 TEST_EQUALITY(block.num_owned_cells, 2);
297 TEST_EQUALITY(block.num_ghstd_cells, 4);
298 TEST_EQUALITY(block.num_virtual_cells, 2);
299 TEST_ASSERT(block.has_connectivity);
300 }
301
302 {
303 const auto & block = mesh_info->element_blocks.at("eblock-1_0");
304
305 out << "Element Block eblock-1_0" << std::endl;
306
307 // Block should be empty
308 TEST_EQUALITY(block.num_owned_cells, 2);
309 TEST_EQUALITY(block.num_ghstd_cells, 2);
310 TEST_EQUALITY(block.num_virtual_cells, 4);
311 TEST_ASSERT(block.has_connectivity);
312 }
313
314 // TEUCHOS_ASSERT(mesh_info->sidesets.at("eblock-0_0").find("left") == mesh_info->sidesets.at("eblock-0_0").end());
315
316 {
317 const auto & block = mesh_info->sidesets.at("eblock-0_0").at("top");
318
319 out << "Sideset eblock-0_0 top" << std::endl;
320
321 // Block should have some basic stuff working
322 TEST_EQUALITY(block.num_owned_cells, 1);
323 TEST_EQUALITY(block.num_ghstd_cells, 0);
324 TEST_EQUALITY(block.num_virtual_cells, 1);
325 TEST_ASSERT(block.has_connectivity);
326 }
327
328 {
329 const auto & block = mesh_info->sidesets.at("eblock-0_0").at("bottom");
330
331 out << "Sideset eblock-0_0 bottom" << std::endl;
332
333 // Block should have some basic stuff working
334 TEST_EQUALITY(block.num_owned_cells, 1);
335 TEST_EQUALITY(block.num_ghstd_cells, 0);
336 TEST_EQUALITY(block.num_virtual_cells, 1);
337 TEST_ASSERT(block.has_connectivity);
338 }
339
340 // TEUCHOS_ASSERT(mesh_info->sidesets.at("eblock-0_0").find("right") == mesh_info->sidesets.at("eblock-0_0").end());
341
342 // TEUCHOS_ASSERT(mesh_info->sidesets.at("eblock-1_0").find("left") == mesh_info->sidesets.at("eblock-1_0").end());
343
344 {
345 const auto & block = mesh_info->sidesets.at("eblock-1_0").at("right");
346
347 out << "Sideset eblock-1_0 right" << std::endl;
348
349 // Block should have some basic stuff working
350 TEST_EQUALITY(block.num_owned_cells, 2);
351 TEST_EQUALITY(block.num_ghstd_cells, 0);
352 TEST_EQUALITY(block.num_virtual_cells, 2);
353 TEST_ASSERT(block.has_connectivity);
354 }
355
356 {
357 const auto & block = mesh_info->sidesets.at("eblock-1_0").at("top");
358
359 out << "Sideset eblock-1_0 top" << std::endl;
360
361 // Block should have some basic stuff working
362 TEST_EQUALITY(block.num_owned_cells, 1);
363 TEST_EQUALITY(block.num_ghstd_cells, 0);
364 TEST_EQUALITY(block.num_virtual_cells, 1);
365 TEST_ASSERT(block.has_connectivity);
366 }
367
368 {
369 const auto & block = mesh_info->sidesets.at("eblock-1_0").at("bottom");
370
371 out << "Sideset eblock-1_0 bottom" << std::endl;
372
373 // Block should have some basic stuff working
374 TEST_EQUALITY(block.num_owned_cells, 1);
375 TEST_EQUALITY(block.num_ghstd_cells, 0);
376 TEST_EQUALITY(block.num_virtual_cells, 1);
377 TEST_ASSERT(block.has_connectivity);
378 }
379 }
380
381 }
382
383
384 TEUCHOS_UNIT_TEST(parallelLocalMeshUtilities, 3D_mesh)
385 {
386
387 int myRank=0;
388 MPI_Comm_rank(MPI_COMM_WORLD, &myRank);
389
390 auto mesh_info = buildParallelLocalMeshInfo({2,2,2},{2,1,1},{2,1,1},{2.,2.,2.});
391
392 // Make sure there are two blocks (eblock-0, and eblock-1)
393 TEST_EQUALITY(mesh_info->element_blocks.size(), 2);
394 TEST_EQUALITY(mesh_info->sidesets.size(), 2);
395 TEST_ASSERT(mesh_info->has_connectivity);
396
397 if(myRank == 0){
398
399 {
400 const auto & block = mesh_info->element_blocks.at("eblock-0_0_0");
401
402 out << "Element Block eblock-0_0_0" << std::endl;
403
404 // Block should have some basic stuff working
405 TEST_EQUALITY(block.num_owned_cells, 4);
406 TEST_EQUALITY(block.num_ghstd_cells, 4);
407 TEST_EQUALITY(block.num_virtual_cells, 12);
408 TEST_ASSERT(block.has_connectivity);
409 }
410
411 {
412 const auto & block = mesh_info->element_blocks.at("eblock-1_0_0");
413
414 out << "Element Block eblock-1_0_0" << std::endl;
415
416 // Block should have some basic stuff working
417 TEST_EQUALITY(block.num_owned_cells, 4);
418 TEST_EQUALITY(block.num_ghstd_cells, 8);
419 TEST_EQUALITY(block.num_virtual_cells, 8);
420 TEST_ASSERT(block.has_connectivity);
421 }
422
423 {
424 const auto & block = mesh_info->sidesets.at("eblock-0_0_0").at("left");
425
426 out << "Sideset eblock-0_0_0 left" << std::endl;
427
428 // Block should have some basic stuff working
429 TEST_EQUALITY(block.num_owned_cells, 4);
430 TEST_EQUALITY(block.num_ghstd_cells, 0);
431 TEST_EQUALITY(block.num_virtual_cells, 4);
432 TEST_ASSERT(block.has_connectivity);
433 }
434
435 {
436 const auto & block = mesh_info->sidesets.at("eblock-0_0_0").at("top");
437
438 out << "Sideset eblock-0_0_0 top" << std::endl;
439
440 // Block should have some basic stuff working
441 TEST_EQUALITY(block.num_owned_cells, 2);
442 TEST_EQUALITY(block.num_ghstd_cells, 0);
443 TEST_EQUALITY(block.num_virtual_cells, 2);
444 TEST_ASSERT(block.has_connectivity);
445 }
446
447 {
448 const auto & block = mesh_info->sidesets.at("eblock-0_0_0").at("bottom");
449
450 out << "Sideset eblock-0_0_0 bottom" << std::endl;
451
452 // Block should have some basic stuff working
453 TEST_EQUALITY(block.num_owned_cells, 2);
454 TEST_EQUALITY(block.num_ghstd_cells, 0);
455 TEST_EQUALITY(block.num_virtual_cells, 2);
456 TEST_ASSERT(block.has_connectivity);
457 }
458
459 {
460 const auto & block = mesh_info->sidesets.at("eblock-0_0_0").at("front");
461
462 out << "Sideset eblock-0_0_0 front" << std::endl;
463
464 // Block should have some basic stuff working
465 TEST_EQUALITY(block.num_owned_cells, 2);
466 TEST_EQUALITY(block.num_ghstd_cells, 0);
467 TEST_EQUALITY(block.num_virtual_cells, 2);
468 TEST_ASSERT(block.has_connectivity);
469 }
470
471 {
472 const auto & block = mesh_info->sidesets.at("eblock-0_0_0").at("back");
473
474 out << "Sideset eblock-0_0_0 back" << std::endl;
475
476 // Block should have some basic stuff working
477 TEST_EQUALITY(block.num_owned_cells, 2);
478 TEST_EQUALITY(block.num_ghstd_cells, 0);
479 TEST_EQUALITY(block.num_virtual_cells, 2);
480 TEST_ASSERT(block.has_connectivity);
481 }
482
483 // TEUCHOS_ASSERT(mesh_info->sidesets.at("eblock-0_0_0").find("right") == mesh_info->sidesets.at("eblock-0_0_0").end());
484
485 // TEUCHOS_ASSERT(mesh_info->sidesets.at("eblock-1_0_0").find("left") == mesh_info->sidesets.at("eblock-1_0_0").end());
486
487 // TEUCHOS_ASSERT(mesh_info->sidesets.at("eblock-1_0_0").find("right") == mesh_info->sidesets.at("eblock-1_0_0").end());
488
489 {
490 const auto & block = mesh_info->sidesets.at("eblock-1_0_0").at("top");
491
492 out << "Sideset eblock-1_0_0 top" << std::endl;
493
494 // Block should have some basic stuff working
495 TEST_EQUALITY(block.num_owned_cells, 2);
496 TEST_EQUALITY(block.num_ghstd_cells, 0);
497 TEST_EQUALITY(block.num_virtual_cells, 2);
498 TEST_ASSERT(block.has_connectivity);
499 }
500
501 {
502 const auto & block = mesh_info->sidesets.at("eblock-1_0_0").at("bottom");
503
504 out << "Sideset eblock-1_0_0 bottom" << std::endl;
505
506 // Block should have some basic stuff working
507 TEST_EQUALITY(block.num_owned_cells, 2);
508 TEST_EQUALITY(block.num_ghstd_cells, 0);
509 TEST_EQUALITY(block.num_virtual_cells, 2);
510 TEST_ASSERT(block.has_connectivity);
511 }
512
513 {
514 const auto & block = mesh_info->sidesets.at("eblock-1_0_0").at("front");
515
516 out << "Sideset eblock-1_0_0 front" << std::endl;
517
518 // Block should have some basic stuff working
519 TEST_EQUALITY(block.num_owned_cells, 2);
520 TEST_EQUALITY(block.num_ghstd_cells, 0);
521 TEST_EQUALITY(block.num_virtual_cells, 2);
522 TEST_ASSERT(block.has_connectivity);
523 }
524
525 {
526 const auto & block = mesh_info->sidesets.at("eblock-1_0_0").at("back");
527
528 out << "Sideset eblock-1_0_0 back" << std::endl;
529
530 // Block should have some basic stuff working
531 TEST_EQUALITY(block.num_owned_cells, 2);
532 TEST_EQUALITY(block.num_ghstd_cells, 0);
533 TEST_EQUALITY(block.num_virtual_cells, 2);
534 TEST_ASSERT(block.has_connectivity);
535 }
536
537 } else {
538
539 {
540 const auto & block = mesh_info->element_blocks.at("eblock-0_0_0");
541
542 out << "Element Block eblock-0_0_0" << std::endl;
543
544 // Block should have some basic stuff working
545 TEST_EQUALITY(block.num_owned_cells, 4);
546 TEST_EQUALITY(block.num_ghstd_cells, 8);
547 TEST_EQUALITY(block.num_virtual_cells, 8);
548 TEST_ASSERT(block.has_connectivity);
549 }
550
551 {
552 const auto & block = mesh_info->element_blocks.at("eblock-1_0_0");
553
554 out << "Element Block eblock-1_0_0" << std::endl;
555
556 // Block should be empty
557 TEST_EQUALITY(block.num_owned_cells, 4);
558 TEST_EQUALITY(block.num_ghstd_cells, 4);
559 TEST_EQUALITY(block.num_virtual_cells, 12);
560 TEST_ASSERT(block.has_connectivity);
561 }
562
563 // TEUCHOS_ASSERT(mesh_info->sidesets.at("eblock-0_0_0").find("left") == mesh_info->sidesets.at("eblock-0_0_0").end());
564
565 {
566 const auto & block = mesh_info->sidesets.at("eblock-0_0_0").at("top");
567
568 out << "Sideset eblock-0_0_0 top" << std::endl;
569
570 // Block should have some basic stuff working
571 TEST_EQUALITY(block.num_owned_cells, 2);
572 TEST_EQUALITY(block.num_ghstd_cells, 0);
573 TEST_EQUALITY(block.num_virtual_cells, 2);
574 TEST_ASSERT(block.has_connectivity);
575 }
576
577 {
578 const auto & block = mesh_info->sidesets.at("eblock-0_0_0").at("bottom");
579
580 out << "Sideset eblock-0_0_0 bottom" << std::endl;
581
582 // Block should have some basic stuff working
583 TEST_EQUALITY(block.num_owned_cells, 2);
584 TEST_EQUALITY(block.num_ghstd_cells, 0);
585 TEST_EQUALITY(block.num_virtual_cells, 2);
586 TEST_ASSERT(block.has_connectivity);
587 }
588
589 // TEUCHOS_ASSERT(mesh_info->sidesets.at("eblock-0_0_0").find("right") == mesh_info->sidesets.at("eblock-0_0_0").end());
590
591 {
592 const auto & block = mesh_info->sidesets.at("eblock-0_0_0").at("front");
593
594 out << "Sideset eblock-0_0_0 front" << std::endl;
595
596 // Block should have some basic stuff working
597 TEST_EQUALITY(block.num_owned_cells, 2);
598 TEST_EQUALITY(block.num_ghstd_cells, 0);
599 TEST_EQUALITY(block.num_virtual_cells, 2);
600 TEST_ASSERT(block.has_connectivity);
601 }
602
603 {
604 const auto & block = mesh_info->sidesets.at("eblock-0_0_0").at("back");
605
606 out << "Sideset eblock-0_0_0 back" << std::endl;
607
608 // Block should have some basic stuff working
609 TEST_EQUALITY(block.num_owned_cells, 2);
610 TEST_EQUALITY(block.num_ghstd_cells, 0);
611 TEST_EQUALITY(block.num_virtual_cells, 2);
612 TEST_ASSERT(block.has_connectivity);
613 }
614
615 // TEUCHOS_ASSERT(mesh_info->sidesets.at("eblock-1_0_0").find("left") == mesh_info->sidesets.at("eblock-1_0_0").end());
616
617 {
618 const auto & block = mesh_info->sidesets.at("eblock-1_0_0").at("right");
619
620 out << "Sideset eblock-1_0_0 right" << std::endl;
621
622 // Block should have some basic stuff working
623 TEST_EQUALITY(block.num_owned_cells, 4);
624 TEST_EQUALITY(block.num_ghstd_cells, 0);
625 TEST_EQUALITY(block.num_virtual_cells, 4);
626 TEST_ASSERT(block.has_connectivity);
627 }
628
629 {
630 const auto & block = mesh_info->sidesets.at("eblock-1_0_0").at("top");
631
632 out << "Sideset eblock-1_0_0 top" << std::endl;
633
634 // Block should have some basic stuff working
635 TEST_EQUALITY(block.num_owned_cells, 2);
636 TEST_EQUALITY(block.num_ghstd_cells, 0);
637 TEST_EQUALITY(block.num_virtual_cells, 2);
638 TEST_ASSERT(block.has_connectivity);
639 }
640
641 {
642 const auto & block = mesh_info->sidesets.at("eblock-1_0_0").at("bottom");
643
644 out << "Sideset eblock-1_0_0 bottom" << std::endl;
645
646 // Block should have some basic stuff working
647 TEST_EQUALITY(block.num_owned_cells, 2);
648 TEST_EQUALITY(block.num_ghstd_cells, 0);
649 TEST_EQUALITY(block.num_virtual_cells, 2);
650 TEST_ASSERT(block.has_connectivity);
651 }
652
653 {
654 const auto & block = mesh_info->sidesets.at("eblock-1_0_0").at("front");
655
656 out << "Sideset eblock-1_0_0 front" << std::endl;
657
658 // Block should have some basic stuff working
659 TEST_EQUALITY(block.num_owned_cells, 2);
660 TEST_EQUALITY(block.num_ghstd_cells, 0);
661 TEST_EQUALITY(block.num_virtual_cells, 2);
662 TEST_ASSERT(block.has_connectivity);
663 }
664
665 {
666 const auto & block = mesh_info->sidesets.at("eblock-1_0_0").at("back");
667
668 out << "Sideset eblock-1_0_0 back" << std::endl;
669
670 // Block should have some basic stuff working
671 TEST_EQUALITY(block.num_owned_cells, 2);
672 TEST_EQUALITY(block.num_ghstd_cells, 0);
673 TEST_EQUALITY(block.num_virtual_cells, 2);
674 TEST_ASSERT(block.has_connectivity);
675 }
676 }
677
678 }
679
680 }