Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
UnitTestCartesianMeshPatch.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* UnitTestCartesianMeshPatch.cc (C) 2000-2022 */
9/* */
10/* Service de test des vues cartésiennes sur les patchs. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/IMesh.h"
15
16#include "arcane/cea/ICartesianMesh.h"
17#include "arcane/cea/ICartesianMeshPatch.h"
18#include "arcane/cea/CellDirectionMng.h"
19#include "arcane/cea/FaceDirectionMng.h"
20#include "arcane/cea/NodeDirectionMng.h"
21#include "arcane/cea/CartesianConnectivity.h"
22
23#include "arcane/ItemPrinter.h"
24#include "arcane/SimpleSVGMeshExporter.h"
25#include "arcane/Directory.h"
26
27#include "arcane/tests/UnitTestCartesianMeshPatch_axl.h"
28
29#include <vector>
30
31#define CORRECT_UID
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36namespace ArcaneTest
37{
38
39using namespace Arcane;
40
41/*---------------------------------------------------------------------------*/
42/*---------------------------------------------------------------------------*/
43
44/*---------------------------------------------------------------------------*/
49/*---------------------------------------------------------------------------*/
50
52: public ArcaneUnitTestCartesianMeshPatchObject
53{
54 public:
57
58 const Arcane::String getImplName() const { return serviceInfo()->localName(); }
59
60 /*
61 * Operations a faire avant l'ensemble des tests du service
62 */
63
64 void setUpForClass();
65
66 /*
67 * Operations a faire apres l'ensemble des tests du service
68 */
69
70 void tearDownForClass();
71
72 /*
73 * Operations a faire avant chaque test du service
74 */
75
76 void setUp();
77
78 /*
79 * Operations a faire apres chaque test du service
80 */
81
82 void tearDown();
83
84 /*
85 * Test sur les mailles par niveau de raffinement et leurs parents
86 */
88
89 /*
90 * Test vue cartésienne sur les mailles
91 */
93
94 /*
95 * Test vue cartésienne sur les faces
96 */
98
99 /*
100 * Test vue cartésienne sur les noeuds
101 */
103
104 /*
105 * Test connectivité cartésienne maille -> noeud et noeud -> maille
106 */
108
109 private:
110
111 // Pointeur sur le maillage cartésien contenant les vues
112 Arcane::ICartesianMesh* m_cartesian_mesh = nullptr;
113
114 // Tableaux de mailles et parents par niveau
115 std::vector<std::vector<Arcane::Int64>> m_lvl_cell_uid;
116 std::vector<std::vector<Arcane::Int64>> m_lvl_cell_p_uid;
117 std::vector<std::vector<Arcane::Int64>> m_lvl_cell_tp_uid;
118
119 // Tableaux des vues cartésiennes sur les mailles par patch
120 std::vector<std::vector<Arcane::Int64>> m_patch_cell_uid;
121 std::vector<std::vector<std::vector<Arcane::Int64>>> m_patch_celldir_next_uid;
122 std::vector<std::vector<std::vector<Arcane::Int64>>> m_patch_celldir_prev_uid;
123 std::vector<std::vector<std::vector<Arcane::Int64>>> m_patch_cellfacedir_next_uid;
124 std::vector<std::vector<std::vector<Arcane::Int64>>> m_patch_cellfacedir_prev_uid;
125 std::vector<std::vector<Arcane::Int64>> m_patch_cellnode_upper_right_uid;
126 std::vector<std::vector<Arcane::Int64>> m_patch_cellnode_upper_left_uid;
127 std::vector<std::vector<Arcane::Int64>> m_patch_cellnode_lower_right_uid;
128 std::vector<std::vector<Arcane::Int64>> m_patch_cellnode_lower_left_uid;
129
130 // Tableaux des vues cartésiennes sur les faces par patch
131 std::vector<std::vector<std::vector<Arcane::Int64>>> m_patch_facedir_uid{};
132 std::vector<std::vector<std::vector<Arcane::Int64>>> m_patch_facedir_next_cell_uid{};
133 std::vector<std::vector<std::vector<Arcane::Int64>>> m_patch_facedir_prev_cell_uid{};
134
135 // Tableaux des vues cartésiennes sur les noeuds par patch
136 std::vector<std::vector<Arcane::Int64>> m_patch_node_uid;
137 std::vector<std::vector<std::vector<Arcane::Int64>>> m_patch_nodedir_next_uid;
138 std::vector<std::vector<std::vector<Arcane::Int64>>> m_patch_nodedir_prev_uid;
139
140 // Tableaux des connectivités noeuds -> mailles par patch
141 std::vector<std::vector<Arcane::Int64>> m_patch_nodecell_upper_right_uid;
142 std::vector<std::vector<Arcane::Int64>> m_patch_nodecell_upper_left_uid;
143 std::vector<std::vector<Arcane::Int64>> m_patch_nodecell_lower_right_uid;
144 std::vector<std::vector<Arcane::Int64>> m_patch_nodecell_lower_left_uid;
145};
146
147/*---------------------------------------------------------------------------*/
148/*---------------------------------------------------------------------------*/
149/*---------------------------------------------------------------------------*/
158/*---------------------------------------------------------------------------*/
159inline Cell lowerLeft(const Node& t_node, ICartesianMeshPatch* t_cm_patch, const Int32 t_lvl)
160{
162 for (const Cell& cell : t_node.cells()) {
163 if (cell.level() == t_lvl) {
164 const DirCellNode& dir_cell_nodey{cell_dmy.cellNode(cell)};
165 const Node& node_upper_right{dir_cell_nodey.nextRight()};
166 if (node_upper_right == t_node) {
167 return cell;
168 }
169 }
170 }
171 return Cell{};
172}
173
174/*---------------------------------------------------------------------------*/
183/*---------------------------------------------------------------------------*/
184inline Cell lowerRight(const Node& t_node, ICartesianMeshPatch* t_cm_patch, const Int32 t_lvl)
185{
187 for (const Cell& cell : t_node.cells()) {
188 if (cell.level() == t_lvl) {
189 const DirCellNode& dir_cell_nodey{cell_dmy.cellNode(cell)};
190 const Node& node_upper_left{dir_cell_nodey.nextLeft()};
191 if (node_upper_left == t_node) {
192 return cell;
193 }
194 }
195 }
196 return Cell{};
197}
198
199/*---------------------------------------------------------------------------*/
208/*---------------------------------------------------------------------------*/
209inline Cell upperLeft(const Node& t_node, ICartesianMeshPatch* t_cm_patch, const Int32 t_lvl)
210{
212 for (const Cell& cell : t_node.cells()) {
213 if (cell.level() == t_lvl) {
214 const DirCellNode& dir_cell_nodey{cell_dmy.cellNode(cell)};
215 const Node& node_lower_right{dir_cell_nodey.previousRight()};
216 if (node_lower_right == t_node) {
217 return cell;
218 }
219 }
220 }
221 return Cell{};
222}
223
224/*---------------------------------------------------------------------------*/
233/*---------------------------------------------------------------------------*/
234inline Cell upperRight(const Node& t_node, ICartesianMeshPatch* t_cm_patch, const Int32 t_lvl)
235{
237 for (const Cell& cell : t_node.cells()) {
238 if (cell.level() == t_lvl) {
239 const DirCellNode& dir_cell_nodey{cell_dmy.cellNode(cell)};
240 const Node& node_lower_left{dir_cell_nodey.previousLeft()};
241 if (node_lower_left == t_node) {
242 return cell;
243 }
244 }
245 }
246 return Cell{};
247}
248
249/*---------------------------------------------------------------------------*/
257/*---------------------------------------------------------------------------*/
258inline Cell prevCell(const DirFace& t_dir_face, const Int32 t_lvl)
259{
260 const Cell& cell_prev{t_dir_face.previousCell()};
261 if (cell_prev.level() == t_lvl) {
262 return cell_prev;
263 } else {
264 return Cell{};
265 }
266}
267
268/*---------------------------------------------------------------------------*/
276/*---------------------------------------------------------------------------*/
277inline Cell nextCell(const DirFace& t_dir_face, const Int32 t_lvl)
278{
279 const Cell& cell_next{t_dir_face.nextCell()};
280 if (cell_next.level() == t_lvl) {
281 return cell_next;
282 } else {
283 return Cell{};
284 }
285}
286
287/*---------------------------------------------------------------------------*/
295/*---------------------------------------------------------------------------*/
296inline Cell prev(const DirCell& t_dir_cell, const Int32 t_lvl)
297{
298 const Cell& cell_prev{t_dir_cell.previous()};
299 if (cell_prev.level() == t_lvl) {
300 return cell_prev;
301 } else {
302 return Cell{};
303 }
304}
305
306/*---------------------------------------------------------------------------*/
314/*---------------------------------------------------------------------------*/
315inline Cell next(const DirCell& t_dir_cell, const Int32 t_lvl)
316{
317 const Cell& cell_next{t_dir_cell.next()};
318 if (cell_next.level() == t_lvl) {
319 return cell_next;
320 } else {
321 return Cell{};
322 }
323}
324
325/*---------------------------------------------------------------------------*/
326/*---------------------------------------------------------------------------*/
327
328/*---------------------------------------------------------------------------*/
329/*---------------------------------------------------------------------------*/
330
331UnitTestCartesianMeshPatchService::
332UnitTestCartesianMeshPatchService(const ServiceBuildInfo& sbi)
333: ArcaneUnitTestCartesianMeshPatchObject(sbi)
334{
335}
336
337/*---------------------------------------------------------------------------*/
342/*---------------------------------------------------------------------------*/
345{
346 // Récupération du pointeur sur le maillage cartésien, raffinement par patch et création des vues
347 m_cartesian_mesh = ICartesianMesh::getReference(this->mesh());
348 m_cartesian_mesh->refinePatch2D(Real2(0.2, 0.2), Real2(0.4, 0.4));
349 m_cartesian_mesh->refinePatch2D(Real2(0.6, 0.6), Real2(0.2, 0.4));
350 m_cartesian_mesh->refinePatch2D(Real2(0.3, 0.4), Real2(0.1, 0.8));
351 m_cartesian_mesh->refinePatch2D(Real2(0.3, 0.6), Real2(0.05, 0.1));
352 m_cartesian_mesh->computeDirections();
353
354 // Sauvegarde chaque patch au format SVG pour les visualer
355 {
356 Integer nb_patch = m_cartesian_mesh->nbPatch();
357 Directory export_dir(subDomain()->exportDirectory());
358 for( Integer i=0; i<nb_patch; ++i ){
359 ICartesianMeshPatch* patch = m_cartesian_mesh->patch(i);
360 String filename = export_dir.file(String::format("Patch{0}.svg",i));
361 std::ofstream ofile(filename.localstr());
363 writer.write(patch->cells());
364 }
365 }
366
367 // Maillage :
368 //
369 // Patch 1 : +
370 // Patch 2 : o
371 // Patch 3 : x
372 // Patch 4 : =
373 //
374 // ------------------------------xxxxxxxxxxxxx-------------------ooooooooooooooooooooo--------------------
375 // | | | x | x | o | | | o | |
376 // | | | x 104 | 105 x | o 92 | 93 | 96 | 97 o | |
377 // | | | x | x | o | | | o | |
378 // | 40 | 41 | 42 x-----43----x 44 | 45 o----46---|----47---o 48 | 49 |
379 // | | | x | x | o | | | o | |
380 // | | | x 102 | 103 x | o 90 | 91 | 94 | 95 o | |
381 // | | | x | x | o | | | o | |
382 // ------------------------------x-----------x-------------------o----|---------|----o--------------------
383 // | | | x | x | o | | | o | |
384 // | | | x 100 | 101 x | o 84 | 85 | 88 | 89 o | |
385 // | | | x | x | o | | | o | |
386 // | 30 | 31 | 32 ======33----x 34 | 35 o----36---|----37---o 38 | 39 |
387 // | | | =28|29= x | o | | | o | |
388 // | | | =--98-= 99 x | o 82 | 83 | 86 | 87 o | |
389 // | | | =26|27= x | o | | | o | |
390 // --------------------++++++++++=======+++++x+++++++++++++++++++ooooooooooooooooooooo--------------------
391 // | | + | x16|17|20|21x | | | + | | | |
392 // | | + 68 | 69 x--72-|--73-x 76 | 77 | 80 | 81 + | | | |
393 // | | + | x14|15|18|19x | | | + | | | |
394 // | 20 | 21 +----22---x-----23----x----24---|----25---+ 26 | 27 | 28 | 29 |
395 // | | + | x08|09|12|13x | | | + | | | |
396 // | | + 66 | 67 x--70-|--71-x 74 | 75 | 78 | 79 + | | | |
397 // | | + | x06|07|10|11x | | | + | | | |
398 // --------------------+---------xxxxxxxxxxxxx-------------------+----------------------------------------
399 // | | + | | | | | | | + | | | |
400 // | | + 52 | 53 | 56 | 57 | 60 | 61 | 64 | 65 + | | | |
401 // | | + | | | | | | | + | | | |
402 // | 10 | 11 +----12---|-----13----|----14---|----15---+ 16 | 17 | 18 | 19 |
403 // | | + | | | | | | | + | | | |
404 // | | + 50 | 51 | 54 | 55 | 58 | 59 | 62 | 63 + | | | |
405 // | | + | | | | | | | + | | | |
406 // --------------------+++++++++++++++++++++++++++++++++++++++++++----------------------------------------
407 // | | | | | | | | | | |
408 // | | | | | | | | | | |
409 // | | | | | | | | | | |
410 // | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
411 // | | | | | | | | | | |
412 // | | | | | | | | | | |
413 // | | | | | | | | | | |
414 // -------------------------------------------------------------------------------------------------------
415
416 // clang-format off
417
418 // Tableaux de mailles et parents par niveau :
419 {
420 // Level 0
421 {
422 m_lvl_cell_uid.push_back(
423 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
424 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
425 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
426 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
427 40, 41, 42, 43, 44, 45, 46, 47, 48, 49});
428
429 m_lvl_cell_p_uid.push_back({});
430 m_lvl_cell_tp_uid.push_back({});
431 }
432
433 // Level 1
434 {
435 m_lvl_cell_uid.push_back(
436 { 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
437 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
438
439 82, 83, 84, 85, 86, 87, 88, 89,
440 90, 91, 92, 93, 94, 95, 96, 97,
441
442 98, 99, 100, 101,
443 102, 103, 104, 105,
444
445 122, 123, 124, 125});
446
447 const std::vector<Int64> cell_p_uid{
448 { 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15,
449 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25,
450
451 36, 36, 36, 36, 37, 37, 37, 37,
452 46, 46, 46, 46, 47, 47, 47, 47,
453
454 33, 33, 33, 33,
455 43, 43, 43, 43,
456
457 32, 32, 32, 32}};
458 m_lvl_cell_p_uid.push_back(cell_p_uid);
459 m_lvl_cell_tp_uid.push_back(cell_p_uid);
460 }
461
462 // Level 2
463 {
464 m_lvl_cell_uid.push_back(
465 {106, 107, 108, 109, 110, 111, 112, 113,
466 114, 115, 116, 117, 118, 119, 120, 121,
467
468 126, 127, 128, 129});
469
470 m_lvl_cell_p_uid.push_back(
471 { 70, 70, 70, 70, 71, 71, 71, 71,
472 72, 72, 72, 72, 73, 73, 73, 73,
473
474 98, 98, 98, 98});
475
476 m_lvl_cell_tp_uid.push_back(
477 { 23, 23, 23, 23, 23, 23, 23, 23,
478 23, 23, 23, 23, 23, 23, 23, 23,
479
480 33, 33, 33, 33});
481 }
482 }
483
484 // Tableaux des vues cartésiennes sur les mailles par patch
485 {
486 // Patch 0 :
487 {
488 // 55<--86->-56<--90->-57<--93->-58<--96->-59<--99->-60<-102->-61<-105->-62<-108->-63<-111->-64<-114->-65
489 // | | | | | | | | | | |
490 // 87 40 85 41 89 42 92 43 95 44 98 45 101 46 104 47 107 48 110 49 113
491 // | | | | | | | | | | |
492 // 44<--84->-45<--88->-46<--91->-47<--94->-48<--97->-49<-100->-50<-103->-51<-106->-52<-109->-53<-112->-54
493 // | | | | | | | | | | |
494 // 65 30 64 31 67 32 69 33 71 34 73 35 75 36 77 37 79 38 81 39 83
495 // | | | | | | | | | | |
496 // 33<--63->-34<--66->-35<--68->-36<--70->-37<--72->-38<--74->-39<--76->-40<--78->-41<--80->-42<--82->-43
497 // | | | | | | | | | | |
498 // 44 20 43 21 46 22 48 23 50 24 52 25 54 26 56 27 58 28 60 29 62
499 // | | | | | | | | | | |
500 // 22<--42->-23<--45->-24<--47->-25<--49->-26<--51->-27<--53->-28<--55->-29<--57->-30<--59->-31<--61->-32
501 // | | | | | | | | | | |
502 // 23 10 22 11 25 12 27 13 29 14 31 15 33 16 35 17 37 18 39 19 41
503 // | | | | | | | | | | |
504 // 11<--21->-12<--24->-13<--26->-14<--28->-15<--30->-16<--32->-17<--34->-18<--36->-19<--38->-20<--40->-21
505 // | | | | | | | | | | |
506 // 2 0 1 1 4 2 6 3 8 4 10 5 12 6 14 7 16 8 18 9 20
507 // | | | | | | | | | | |
508 // 0-<--0-->-1-<--3-->-2-<--5-->-3-<--7-->-4-<--9-->-5-<--11->-6-<--13->-7-<--15->-8-<--17->-9-<--19->-10
509
510 m_patch_cell_uid.push_back(
511 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
512 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
513 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
514 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
515 40, 41, 42, 43, 44, 45, 46, 47, 48, 49});
516
517 m_patch_celldir_next_uid.push_back(
518 { // X
519 { 1, 2, 3, 4, 5, 6, 7, 8, 9, -1,
520 11, 12, 13, 14, 15, 16, 17, 18, 19, -1,
521 21, 22, 23, 24, 25, 26, 27, 28, 29, -1,
522 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
523 41, 42, 43, 44, 45, 46, 47, 48, 49, -1},
524 // Y
525 { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
526 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
527 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
528 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
529 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}});
530
531 m_patch_celldir_prev_uid.push_back(
532 { // X
533 { -1, 0, 1, 2, 3, 4, 5, 6, 7, 8,
534 -1, 10, 11, 12, 13, 14, 15, 16, 17, 18,
535 -1, 20, 21, 22, 23, 24, 25, 26, 27, 28,
536 -1, 30, 31, 32, 33, 34, 35, 36, 37, 38,
537 -1, 40, 41, 42, 43, 44, 45, 46, 47, 48},
538 // Y
539 { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
540 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
541 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
542 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
543 30, 31, 32, 33, 34, 35, 36, 37, 38, 39}});
544
545 m_patch_cellfacedir_next_uid.push_back(
546 { // X
547 { 1, 4, 6, 8, 10, 12, 14, 16, 18, 20,
548 22, 25, 27, 29, 31, 33, 35, 37, 39, 41,
549 43, 46, 48, 50, 52, 54, 56, 58, 60, 62,
550 64, 67, 69, 71, 73, 75, 77, 79, 81, 83,
551 85, 89, 92, 95, 98, 101, 104, 107, 110, 113},
552 // Y
553 { 21, 24, 26, 28, 30, 32, 34, 36, 38, 40,
554 42, 45, 47, 49, 51, 53, 55, 57, 59, 61,
555 63, 66, 68, 70, 72, 74, 76, 78, 80, 82,
556 84, 88, 91, 94, 97, 100, 103, 106, 109, 112,
557 86, 90, 93, 96, 99, 102, 105, 108, 111, 114}});
558
559 m_patch_cellfacedir_prev_uid.push_back(
560 { // X
561 { 2, 1, 4, 6, 8, 10, 12, 14, 16, 18,
562 23, 22, 25, 27, 29, 31, 33, 35, 37, 39,
563 44, 43, 46, 48, 50, 52, 54, 56, 58, 60,
564 65, 64, 67, 69, 71, 73, 75, 77, 79, 81,
565 87, 85, 89, 92, 95, 98, 101, 104, 107, 110},
566 // Y
567 { 0, 3, 5, 7, 9, 11, 13, 15, 17, 19,
568 21, 24, 26, 28, 30, 32, 34, 36, 38, 40,
569 42, 45, 47, 49, 51, 53, 55, 57, 59, 61,
570 63, 66, 68, 70, 72, 74, 76, 78, 80, 82,
571 84, 88, 91, 94, 97, 100, 103, 106, 109, 112}});
572
573 m_patch_cellnode_upper_right_uid.push_back(
574 { 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
575 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
576 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
577 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
578 56, 57, 58, 59, 60, 61, 62, 63, 64, 65});
579
580 m_patch_cellnode_upper_left_uid.push_back(
581 { 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
582 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
583 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
584 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
585 55, 56, 57, 58, 59, 60, 61, 62, 63, 64});
586
587 m_patch_cellnode_lower_right_uid.push_back(
588 { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
589 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
590 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
591 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
592 45, 46, 47, 48, 49, 50, 51, 52, 53, 54});
593
594 m_patch_cellnode_lower_left_uid.push_back(
595 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
596 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
597 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
598 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
599 44, 45, 46, 47, 48, 49, 50, 51, 52, 53});
600 }
601
602 // Patch 1 :
603 {
604 // 35<-211->106<-217->-36<-229->112<-233->-37<-245->118<-249->-38<-261->124<-265->-39
605 // | | | | | | | | |
606 // 213 68 209 69 215 72 227 73 231 76 243 77 247 80 259 81 263
607 // | | | | | | | | |
608 // 102<-201->100<-207->104<-221->108<-225->110<-237->114<-241->116<-253->120<-257->122
609 // | | | | | | | | |
610 // 203 66 199 67 205 70 219 71 223 74 235 75 239 78 251 79 255
611 // | | | | | | | | |
612 // 24<-131->-74<-137->-25<-153->-82<-157->-26<-173->-90<-177->-27<-193->-98<-197->-28
613 // | | | | | | | | |
614 // 133 52 129 53 135 56 151 57 155 60 171 61 175 64 191 65 195
615 // | | | | | | | | |
616 // 70<-119->-68<-127->-72<-143->-78<-149->-80<-163->-86<-169->-88<-183->-94<-189->-96
617 // | | | | | | | | |
618 // 121 50 117 51 125 54 141 55 147 58 161 59 167 62 181 63 187
619 // | | | | | | | | |
620 // 13<-115->-66<-123->-14<-139->-76<-145->-15<-159->-84<-165->-16<-179->-92<-185->-17
621
622 m_patch_cell_uid.push_back(
623 { 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
624 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81});
625
626 m_patch_celldir_next_uid.push_back(
627 { // X
628 { 51, 54, 53, 56, 55, 58, 57, 60, 59, 62, 61, 64, 63, -1, 65, -1,
629 67, 70, 69, 72, 71, 74, 73, 76, 75, 78, 77, 80, 79, -1, 81, -1},
630 // Y
631 { 52, 53, 66, 67, 56, 57, 70, 71, 60, 61, 74, 75, 64, 65, 78, 79,
632 68, 69, -1, -1, 72, 73, -1, -1, 76, 77, -1, -1, 80, 81, -1, -1}});
633
634 m_patch_celldir_prev_uid.push_back(
635 { // X
636 { -1, 50, -1, 52, 51, 54, 53, 56, 55, 58, 57, 60, 59, 62, 61, 64,
637 -1, 66, -1, 68, 67, 70, 69, 72, 71, 74, 73, 76, 75, 78, 77, 80},
638 // Y
639 { -1, -1, 50, 51, -1, -1, 54, 55, -1, -1, 58, 59, -1, -1, 62, 63,
640 52, 53, 66, 67, 56, 57, 70, 71, 60, 61, 74, 75, 64, 65, 78, 79}});
641
642 m_patch_cellfacedir_next_uid.push_back(
643 { // X
644 {117, 125, 129, 135, 141, 147, 151, 155, 161, 167, 171, 175, 181, 187, 191, 195,
645 199, 205, 209, 215, 219, 223, 227, 231, 235, 239, 243, 247, 251, 255, 259, 263},
646 // Y
647 {119, 127, 131, 137, 143, 149, 153, 157, 163, 169, 173, 177, 183, 189, 193, 197,
648 201, 207, 211, 217, 221, 225, 229, 233, 237, 241, 245, 249, 253, 257, 261, 265}});
649
650 m_patch_cellfacedir_prev_uid.push_back(
651 { // X
652 {121, 117, 133, 129, 125, 141, 135, 151, 147, 161, 155, 171, 167, 181, 175, 191,
653 203, 199, 213, 209, 205, 219, 215, 227, 223, 235, 231, 243, 239, 251, 247, 259},
654 // Y
655 {115, 123, 119, 127, 139, 145, 143, 149, 159, 165, 163, 169, 179, 185, 183, 189,
656 131, 137, 201, 207, 153, 157, 221, 225, 173, 177, 237, 241, 193, 197, 253, 257}});
657
658 m_patch_cellnode_upper_right_uid.push_back(
659 { 68, 72, 74, 25, 78, 80, 82, 26, 86, 88, 90, 27, 94, 96, 98, 28,
660 100, 104, 106, 36, 108, 110, 112, 37, 114, 116, 118, 38, 120, 122, 124, 39});
661
662 m_patch_cellnode_upper_left_uid.push_back(
663 { 70, 68, 24, 74, 72, 78, 25, 82, 80, 86, 26, 90, 88, 94, 27, 98,
664 102, 100, 35, 106, 104, 108, 36, 112, 110, 114, 37, 118, 116, 120, 38, 124});
665
666 m_patch_cellnode_lower_right_uid.push_back(
667 { 66, 14, 68, 72, 76, 15, 78, 80, 84, 16, 86, 88, 92, 17, 94, 96,
668 74, 25, 100, 104, 82, 26, 108, 110, 90, 27, 114, 116, 98, 28, 120, 122});
669
670 m_patch_cellnode_lower_left_uid.push_back(
671 { 13, 66, 70, 68, 14, 76, 72, 78, 15, 84, 80, 86, 16, 92, 88, 94,
672 24, 74, 102, 100, 25, 82, 104, 108, 26, 90, 110, 114, 27, 98, 116, 120});
673 }
674
675 // Patch 2 :
676 {
677 // 61<-322->149<-328->-62<-340->155<-344->-63
678 // | | | | |
679 // 324 92 320 93 326 96 338 97 342
680 // | | | | |
681 // 145<-312->143<-318->147<-332->151<-336->153
682 // | | | | |
683 // 314 90 310 91 316 94 330 95 334
684 // | | | | |
685 // 50<-282->133<-288->-51<-304->141<-308->-52
686 // | | | | |
687 // 284 84 280 85 286 88 302 89 306
688 // | | | | |
689 // 129<-270->127<-278->131<-294->137<-300->139
690 // | | | | |
691 // 272 82 268 83 276 86 292 87 298
692 // | | | | |
693 // 39<-266->125<-274->-40<-290->135<-296->-41
694
695 m_patch_cell_uid.push_back(
696 { 82, 83, 84, 85, 86, 87, 88, 89,
697 90, 91, 92, 93, 94, 95, 96, 97});
698
699 m_patch_celldir_next_uid.push_back(
700 { // X
701 { 83, 86, 85, 88, 87, -1, 89, -1,
702 91, 94, 93, 96, 95, -1, 97, -1},
703 // Y
704 { 84, 85, 90, 91, 88, 89, 94, 95,
705 92, 93, -1, -1, 96, 97, -1, -1}});
706
707 m_patch_celldir_prev_uid.push_back(
708 { // X
709 { -1, 82, -1, 84, 83, 86, 85, 88,
710 -1, 90, -1, 92, 91, 94, 93, 96},
711 // Y
712 { -1, -1, 82, 83, -1, -1, 86, 87,
713 84, 85, 90, 91, 88, 89, 94, 95}});
714
715 m_patch_cellfacedir_next_uid.push_back(
716 { // X
717 {268, 276, 280, 286, 292, 298, 302, 306,
718 310, 316, 320, 326, 330, 334, 338, 342},
719 // Y
720 {270, 278, 282, 288, 294, 300, 304, 308,
721 312, 318, 322, 328, 332, 336, 340, 344}});
722
723 m_patch_cellfacedir_prev_uid.push_back(
724 { // X
725 {272, 268, 284, 280, 276, 292, 286, 302,
726 314, 310, 324, 320, 316, 330, 326, 338},
727 // Y
728 {266, 274, 270, 278, 290, 296, 294, 300,
729 282, 288, 312, 318, 304, 308, 332, 336}});
730
731 m_patch_cellnode_upper_right_uid.push_back(
732 {127, 131, 133, 51, 137, 139, 141, 52,
733 143, 147, 149, 62, 151, 153, 155, 63});
734
735 m_patch_cellnode_upper_left_uid.push_back(
736 {129, 127, 50, 133, 131, 137, 51, 141,
737 145, 143, 61, 149, 147, 151, 62, 155});
738
739 m_patch_cellnode_lower_right_uid.push_back(
740 {125, 40, 127, 131, 135, 41, 137, 139,
741 133, 51, 143, 147, 141, 52, 151, 153});
742
743 m_patch_cellnode_lower_left_uid.push_back(
744 { 39, 125, 129, 127, 40, 135, 131, 137,
745 50, 133, 145, 143, 51, 141, 147, 151});
746 }
747
748 // Patch 3 :
749 {
750 // 58<------377------>170<------383------>-59
751 // | | |
752 // | | |
753 // | | |
754 // 379 104 375 105 381
755 // | | |
756 // | | |
757 // | | |
758 // 166<------367------>164<------373------>168
759 // | | |
760 // | | |
761 // | | |
762 // 369 102 365 103 371
763 // | | |
764 // | | |
765 // | | |
766 // 47<------357------>162<------363------>-48
767 // | | |
768 // | | |
769 // | | |
770 // 359 100 355 101 361
771 // | | |
772 // | | |
773 // | | |
774 // 158<------347------>156<------353------>160
775 // | | |
776 // | | |
777 // | | |
778 // 349 98 345 99 351
779 // | | |
780 // | | |
781 // | | |
782 // 36<------229------>112<------233------>-37
783 // 36<-441->196<-447->112<-459->202<-463->-37
784 // | | | | |
785 // 443 116 439 117 445 120 457 121 461
786 // | | | | |
787 // 192<-431->190<-437->194<-451->198<-455->200
788 // | | | | |
789 // 433 114 429 115 435 118 449 119 453
790 // | | | | |
791 // 104<-401->180<-407->108<-423->188<-427->110
792 // | | | | |
793 // 403 108 399 109 405 112 421 113 425
794 // | | | | |
795 // 176<-389->174<-397->178<-413->184<-419->186
796 // | | | | |
797 // 391 106 387 107 395 110 411 111 417
798 // | | | | |
799 // 25<-385->172<-393->-82<-409->182<-415->-26
800
801 m_patch_cell_uid.push_back(
802 { 98, 99, 100, 101,
803 102, 103, 104, 105,
804 106, 107, 108, 109, 110, 111, 112, 113,
805 114, 115, 116, 117, 118, 119, 120, 121});
806
807 m_patch_celldir_next_uid.push_back(
808 { // X
809 { 99, -1, 101, -1,
810 103, -1, 105, -1,
811 107, 110, 109, 112, 111, -1, 113, -1,
812 115, 118, 117, 120, 119, -1, 121, -1},
813 // Y
814 {100, 101, 102, 103,
815 104, 105, -1, -1,
816 108, 109, 114, 115, 112, 113, 118, 119,
817 #ifdef CORRECT_UID
818 116, 117, -1, -1, 120, 121, -1, -1}});
819 #else
820 116, 117, -1, -1, 120, 121, 99, 99}}); // error 99 -> -1 or -1 -> 98
821 #endif
822
823 m_patch_celldir_prev_uid.push_back(
824 { // X
825 { -1, 98, -1, 100,
826 -1, 102, -1, 104,
827 -1, 106, -1, 108, 107, 110, 109, 112,
828 -1, 114, -1, 116, 115, 118, 117, 120},
829 // Y
830 { -1, -1, 98, 99,
831 100, 101, 102, 103,
832 -1, -1, 106, 107, -1, -1, 110, 111,
833 108, 109, 114, 115, 112, 113, 118, 119}});
834
835 m_patch_cellfacedir_next_uid.push_back(
836 { // X
837 {345, 351, 355, 361,
838 365, 371, 375, 381,
839 387, 395, 399, 405, 411, 417, 421, 425,
840 429, 435, 439, 445, 449, 453, 457, 461},
841 // Y
842 {347, 353, 357, 363,
843 367, 373, 377, 383,
844 389, 397, 401, 407, 413, 419, 423, 427,
845 431, 437, 441, 447, 451, 455, 459, 463}});
846
847 m_patch_cellfacedir_prev_uid.push_back(
848 { // X
849 {349, 345, 359, 355,
850 369, 365, 379, 375,
851 391, 387, 403, 399, 395, 411, 405, 421,
852 433, 429, 443, 439, 435, 449, 445, 457},
853 // Y
854 {229, 233, 347, 353,
855 357, 363, 367, 373,
856 385, 393, 389, 397, 409, 415, 413, 419,
857 401, 407, 431, 437, 423, 427, 451, 455}});
858
859 m_patch_cellnode_upper_right_uid.push_back(
860 {156, 160, 162, 48,
861 164, 168, 170, 59,
862 174, 178, 180, 108, 184, 186, 188, 110,
863 190, 194, 196, 112, 198, 200, 202, 37});
864
865 m_patch_cellnode_upper_left_uid.push_back(
866 {158, 156, 47, 162,
867 166, 164, 58, 170,
868 176, 174, 104, 180, 178, 184, 108, 188,
869 192, 190, 36, 196, 194, 198, 112, 202});
870
871 m_patch_cellnode_lower_right_uid.push_back(
872 {112, 37, 156, 160,
873 162, 48, 164, 168,
874 172, 82, 174, 178, 182, 26, 184, 186,
875 180, 108, 190, 194, 188, 110, 198, 200});
876
877 m_patch_cellnode_lower_left_uid.push_back(
878 { 36, 112, 158, 156,
879 47, 162, 166, 164,
880 25, 172, 176, 174, 82, 182, 178, 184,
881 104, 180, 192, 190, 108, 188, 194, 198});
882 }
883
884 // Patch 4 :
885 {
886 // 158<------492------>215<------498------>156
887 // | | |
888 // | | |
889 // | | |
890 // 494 128 490 129 496
891 // | | |
892 // | | |
893 // | | |
894 // 211<------482------>209<------488------>213
895 // | | |
896 // | | |
897 // | | |
898 // 484 126 480 127 486
899 // | | |
900 // | | |
901 // | | |
902 // 36<------441------>196<------447------>112
903
904 m_patch_cell_uid.push_back(
905 {126, 127, 128, 129});
906
907 m_patch_celldir_next_uid.push_back(
908 { // X
909 {127, -1, 129, -1},
910 // Y
911 {128, 129, -1, -1}});
912
913 m_patch_celldir_prev_uid.push_back(
914 { // X
915 { -1, 126, -1, 128},
916 // Y
917 { -1, -1, 126, 127}});
918
919 m_patch_cellfacedir_next_uid.push_back(
920 { // X
921 {480, 486, 490, 496},
922 // Y
923 {482, 488, 492, 498}});
924
925 m_patch_cellfacedir_prev_uid.push_back(
926 { // X
927 {484, 480, 494, 490},
928 // Y
929 {441, 447, 482, 488}});
930
931 m_patch_cellnode_upper_right_uid.push_back(
932 {209, 213, 215, 156});
933
934 m_patch_cellnode_upper_left_uid.push_back(
935 {211, 209, 158, 215});
936
937 m_patch_cellnode_lower_right_uid.push_back(
938 {196, 112, 209, 213});
939
940 m_patch_cellnode_lower_left_uid.push_back(
941 { 36, 196, 211, 209});
942 }
943 }
944
945 // Tableaux des vues cartésiennes sur les faces par patch
946 {
947 // Patch 0
948 {
949 // -----86--------90--------93--------96--------99-------102-------105-------108-------111-------113----
950 // | | | | | | | | | | |
951 // 85 40 87 41 89 42 92 43 95 44 98 45 101 46 104 47 107 48 110 49 114
952 // | | | | | | | | | | |
953 // -----84--------88--------91--------94--------97-------100-------103-------106-------109-------112----
954 // | | | | | | | | | | |
955 // 64 30 65 31 67 32 69 33 71 34 73 35 75 36 77 37 79 38 81 39 83
956 // | | | | | | | | | | |
957 // -----63--------66--------68--------70--------72--------74--------76--------78--------80--------82----
958 // | | | | | | | | | | |
959 // 43 20 44 21 46 22 48 23 50 24 52 25 54 26 56 27 58 28 60 29 62
960 // | | | | | | | | | | |
961 // -----42--------45--------47--------49--------51--------53--------55--------57--------59--------61----
962 // | | | | | | | | | | |
963 // 22 10 23 11 25 12 27 13 29 14 31 15 33 16 35 17 37 18 39 19 41
964 // | | | | | | | | | | |
965 // -----21--------24--------26--------28--------30--------32--------34--------36--------38--------40----
966 // | | | | | | | | | | |
967 // 1 0 2 1 4 2 6 3 8 4 10 5 12 6 14 7 16 8 18 9 20
968 // | | | | | | | | | | |
969 // -----0---------3---------5---------7---------9---------11--------13--------15--------17--------19----
970
971 m_patch_facedir_uid.push_back(
972 { // X
973 { 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20,
974 22, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41,
975 43, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62,
976 64, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83,
977 85, 87, 89, 92, 95, 98, 101, 104, 107, 110, 113},
978 // Y
979 { 0, 3, 5, 7, 9, 11, 13, 15, 17, 19,
980 21, 24, 26, 28, 30, 32, 34, 36, 38, 40,
981 42, 45, 47, 49, 51, 53, 55, 57, 59, 61,
982 63, 66, 68, 70, 72, 74, 76, 78, 80, 82,
983 84, 86, 88, 90, 91, 93, 94, 96, 97, 99,
984 100, 102, 103, 105, 106, 108, 109, 111, 112, 114}});
985
986 m_patch_facedir_next_cell_uid.push_back(
987 { // X
988 { 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, -1,
989 11, 10, 12, 13, 14, 15, 16, 17, 18, 19, -1,
990 21, 20, 22, 23, 24, 25, 26, 27, 28, 29, -1,
991 31, 30, 32, 33, 34, 35, 36, 37, 38, 39, -1,
992 41, 40, 42, 43, 44, 45, 46, 47, 48, 49, -1},
993 // Y
994 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
995 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
996 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
997 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
998 40, -1, 41, -1, 42, -1, 43, -1, 44, -1,
999 45, -1, 46, -1, 47, -1, 48, -1, 49, -1}});
1000
1001 m_patch_facedir_prev_cell_uid.push_back(
1002 { // X
1003 { 0, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1004 10, -1, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1005 20, -1, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1006 30, -1, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1007 40, -1, 41, 42, 43, 44, 45, 46, 47, 48, 49},
1008 // Y
1009 { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1010 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1011 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1012 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1013 30, 40, 31, 41, 32, 42, 33, 43, 34, 44,
1014 35, 45, 36, 46, 37, 47, 38, 48, 39, 49}});
1015 }
1016
1017 // Patch 1
1018 {
1019 // ----211-------217-------229-------233-------245-------249-------261-------265----
1020 // | | | | | | | | |
1021 // 213 68 209 69 215 72 227 73 231 76 243 77 247 80 259 81 263
1022 // | | | | | | | | |
1023 // ----201-------207-------221-------225-------237-------241-------253-------257----
1024 // | | | | | | | | |
1025 // 203 66 199 67 205 70 219 71 223 74 235 75 239 78 251 79 255
1026 // | | | | | | | | |
1027 // ----131-------137-------153-------157-------173-------177-------193-------197----
1028 // | | | | | | | | |
1029 // 133 52 129 53 135 56 151 57 155 60 171 61 175 64 191 65 195
1030 // | | | | | | | | |
1031 // ----119-------127-------143-------149-------163-------169-------183-------189----
1032 // | | | | | | | | |
1033 // 121 50 117 51 125 54 141 55 147 58 161 59 167 62 181 63 187
1034 // | | | | | | | | |
1035 // ----115-------123-------139-------145-------159-------165-------179-------185----
1036
1037 m_patch_facedir_uid.push_back(
1038 { // X
1039 {117, 121, 125, 129, 133, 135, 141, 147, 151, 155, 161, 167, 171, 175, 181, 187, 191, 195,
1040 199, 203, 205, 209, 213, 215, 219, 223, 227, 231, 235, 239, 243, 247, 251, 255, 259, 263},
1041 // Y
1042 {115, 119, 123, 127, 131, 137,
1043 139, 143, 145, 149, 153, 157,
1044 159, 163, 165, 169, 173, 177,
1045 179, 183, 185, 189, 193, 197,
1046 201, 207, 211, 217,
1047 221, 225, 229, 233,
1048 237, 241, 245, 249,
1049 253, 257, 261, 265}});
1050
1051 m_patch_facedir_next_cell_uid.push_back(
1052 { // X
1053 #ifdef CORRECT_UID
1054 { 51, 50, 54, 53, 52, 56, 55, 58, 57, 60, 59, 62, 61, 64, 63, -1, 65, -1,
1055 67, 66, 70, 69, 68, 72, 71, 74, 73, 76, 75, 78, 77, 80, 79, -1, 81, -1},
1056 #else
1057 { 51, 50, 54, 53, 52, 56, 55, 58, 57, 60, 59, 62, 61, 64, 63, 16, 65, -1, // error 16 -> -1
1058 67, 66, 70, 69, 68, 72, 71, 74, 73, 76, 75, 78, 77, 80, 79, 26, 81, -1}, // error 26 -> -1
1059 #endif
1060 // Y
1061 { 50, 52, 51, 53, 66, 67,
1062 54, 56, 55, 57, 70, 71,
1063 58, 60, 59, 61, 74, 75,
1064 62, 64, 63, 65, 78, 79,
1065 #ifdef CORRECT_UID
1066 68, 69, -1, -1,
1067 72, 73, -1, -1,
1068 76, 77, -1, -1,
1069 80, 81, -1, -1}});
1070 #else
1071 68, 69, 122, 123, // error 122, 123 -> -1
1072 72, 73, 98, 99, // error 98, 99 -> -1
1073 76, 77, 34, 34, // error 34, 34 -> -1
1074 80, 81, 35, 35}}); // error 35, 35 -> -1
1075 #endif
1076
1077 m_patch_facedir_prev_cell_uid.push_back(
1078 { // X
1079 #ifdef CORRECT_UID
1080 { 50, -1, 51, 52, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
1081 66, -1, 67, 68, -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81},
1082 #else
1083 { 50, 11, 51, 52, -1, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, // error 11 -> -1
1084 66, 21, 67, 68, -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81}, // error 21 -> -1
1085 #endif
1086 // Y
1087 #ifdef CORRECT_UID
1088 { -1, 50, -1, 51, 52, 53,
1089 -1, 54, -1, 55, 56, 57,
1090 -1, 58, -1, 59, 60, 61,
1091 -1, 62, -1, 63, 64, 65,
1092 #else
1093 { 2, 50, 2, 51, 52, 53, // error 2, 2 -> -1
1094 3, 54, 3, 55, 56, 57, // error 3, 3 -> -1
1095 4, 58, 4, 59, 60, 61, // error 4, 4 -> -1
1096 5, 62, 5, 63, 64, 65, // error 5, 5 -> -1
1097 #endif
1098 66, 67, 68, 69,
1099 70, 71, 72, 73,
1100 74, 75, 76, 77,
1101 78, 79, 80, 81}});
1102 }
1103
1104 // Patch 2 :
1105 {
1106 // ----322-------328-------340-------344----
1107 // | | | | |
1108 // 324 92 320 93 326 96 338 97 342
1109 // | | | | |
1110 // ----312-------318-------332-------336----
1111 // | | | | |
1112 // 314 90 310 91 316 94 330 95 334
1113 // | | | | |
1114 // ----282-------288-------304-------308----
1115 // | | | | |
1116 // 284 84 280 85 286 88 302 89 306
1117 // | | | | |
1118 // ----270-------278-------294-------300----
1119 // | | | | |
1120 // 272 82 268 83 276 86 292 87 298
1121 // | | | | |
1122 // ----266-------274-------290-------296----
1123
1124 m_patch_facedir_uid.push_back(
1125 { // X
1126 {268, 272, 276, 280, 284, 286, 292, 298, 302, 306,
1127 310, 314, 316, 320, 324, 326, 330, 334, 338, 342},
1128 // Y
1129 {266, 270, 274, 278, 282, 288, 290, 294, 296, 300, 304, 308,
1130 312, 318, 322, 328, 332, 336, 340, 344}});
1131
1132 m_patch_facedir_next_cell_uid.push_back(
1133 { // X
1134 #ifdef CORRECT_UID
1135 { 83, 82, 86, 85, 84, 88, 87, -1, 89, -1, // error 38 -> -1
1136 91, 90, 94, 93, 92, 96, 95, -1, 97, -1}, // error 48 -> -1
1137 #else
1138 { 83, 82, 86, 85, 84, 88, 87, 38, 89, -1, // error 38 -> -1
1139 91, 90, 94, 93, 92, 96, 95, 48, 97, -1}, // error 48 -> -1
1140 #endif
1141 // Y
1142 { 82, 84, 83, 85, 90, 91, 86, 88, 87, 89, 94, 95,
1143 92, 93, -1, -1, 96, 97, -1, -1}});
1144
1145 m_patch_facedir_prev_cell_uid.push_back(
1146 { // X
1147 #ifdef CORRECT_UID
1148 { 82, -1, 83, 84, -1, 85, 86, 87, 88, 89, // error 35 -> -1
1149 90, -1, 91, 92, -1, 93, 94, 95, 96, 97}, // error 45 -> -1
1150 #else
1151 { 82, 35, 83, 84, -1, 85, 86, 87, 88, 89, // error 35 -> -1
1152 90, 45, 91, 92, -1, 93, 94, 95, 96, 97}, // error 45 -> -1
1153 #endif
1154 // Y
1155 #ifdef CORRECT_UID
1156 { -1, 82, -1, 83, 84, 85, -1, 86, -1, 87, 88, 89, // error 26, 27 -> -1
1157 #else
1158 { 26, 82, 26, 83, 84, 85, 27, 86, 27, 87, 88, 89, // error 26, 27 -> -1
1159 #endif
1160 90, 91, 92, 93, 94, 95, 96, 97}});
1161 }
1162
1163 // Patch 3 :
1164 {
1165 // ---------377-----------------383---------
1166 // | | |
1167 // | | |
1168 // | | |
1169 // 379 104 375 105 381
1170 // | | |
1171 // | | |
1172 // | | |
1173 // ---------367-----------------373---------
1174 // | | |
1175 // | | |
1176 // | | |
1177 // 369 102 365 103 371
1178 // | | |
1179 // | | |
1180 // | | |
1181 // ---------357-----------------363---------
1182 // | | |
1183 // | | |
1184 // | | |
1185 // 359 100 355 101 361
1186 // | | |
1187 // | | |
1188 // | | |
1189 // ---------347-----------------353---------
1190 // | | |
1191 // | | |
1192 // | | |
1193 // 349 98 345 99 351
1194 // | | |
1195 // | | |
1196 // | | |
1197 // ---------229-----------------233---------
1198 // ----441-------447-------459-------463----
1199 // | | | | |
1200 // 443 116 439 117 445 120 457 121 461
1201 // | | | | |
1202 // ----431-------437-------451-------455----
1203 // | | | | |
1204 // 433 114 429 115 435 118 449 119 453
1205 // | | | | |
1206 // ----401-------407-------423-------427----
1207 // | | | | |
1208 // 403 108 399 109 405 112 421 113 425
1209 // | | | | |
1210 // ----389-------397-------413-------419----
1211 // | | | | |
1212 // 391 106 387 107 395 110 411 111 417
1213 // | | | | |
1214 // ----385-------393-------409-------415----
1215
1216 m_patch_facedir_uid.push_back(
1217 { // X
1218 {345, 349, 351, 355, 359, 361,
1219 365, 369, 371, 375, 379, 381,
1220 387, 391, 395, 399, 403, 405, 411, 417, 421, 425,
1221 429, 433, 435, 439, 443, 445, 449, 453, 457, 461},
1222 // Y
1223 {229, 233, 347, 353, 357, 363,
1224 367, 373, 377, 383,
1225 385, 389, 393, 397, 401, 407, 409, 413, 415, 419, 423, 427,
1226 431, 437, 441, 447, 451, 455, 459, 463}});
1227
1228 m_patch_facedir_next_cell_uid.push_back(
1229 { // X
1230 #ifdef CORRECT_UID
1231 { 99, 98, -1, 101, 100, -1,
1232 103, 102, -1, 105, 104, -1,
1233 107, 106, 110, 109, 108, 112, 111, -1, 113, -1,
1234 115, 114, 118, 117, 116, 120, 119, -1, 121, -1},
1235 #else
1236 { 99, 98, 34, 101, 100, -1, // error 34 -> -1
1237 103, 102, 44, 105, 104, -1, // error 44 -> -1
1238 107, 106, 110, 109, 108, 112, 111, 74, 113, -1, // error 74 -> -1
1239 115, 114, 118, 117, 116, 120, 119, 76, 121, -1}, // error 76 -> -1
1240 #endif
1241 // Y
1242 { 98, 99, 100, 101, 102, 103,
1243 104, 105, -1, -1,
1244 106, 108, 107, 109, 114, 115, 110, 112, 111, 113, 118, 119,
1245 #ifdef CORRECT_UID
1246 116, 117, -1, -1, 120, 121, -1, -1}});
1247 #else
1248 116, 117, 126, 127, 120, 121, 99, 99}}); // error 126, 127 -> 98 or -1 et 99 -> -1
1249 #endif
1250
1251 m_patch_facedir_prev_cell_uid.push_back(
1252 { // X
1253 #ifdef CORRECT_UID
1254 { 98, -1, 99, 100, -1, 101,
1255 102, -1, 103, 104, -1, 105,
1256 106, -1, 107, 108, -1, 109, 110, 111, 112, 113,
1257 114, -1, 115, 116, -1, 117, 118, 119, 120, 121},
1258 #else
1259 { 98, 123, 99, 100, 125, 101, // error 123, 125 -> -1
1260 102, 42, 103, 104, -1, 105, // error 42 -> -1
1261 106, 67, 107, 108, -1, 109, 110, 111, 112, 113, // error 67 -> -1
1262 114, 69, 115, 116, -1, 117, 118, 119, 120, 121}, // error 69 -> -1
1263 #endif
1264 // Y
1265 #ifdef CORRECT_UID
1266 { -1, -1, 98, 99, 100, 101,
1267 102, 103, 104, 105,
1268 -1, 106, -1, 107, 108, 109, -1, 110, -1, 111, 112, 113,
1269 114, 115, 116, 117, 118, 119, 120, 121}});
1270 #else
1271 { 72, 73, 98, 99, 100, 101, // error 72, 73 -> -1
1272 102, 103, 104, 105,
1273 56, 106, 56, 107, 108, 109, 57, 110, 57, 111, 112, 113, // error 56, 57 -> -1
1274 114, 115, 116, 117, 118, 119, 120, 121}});
1275 #endif
1276 }
1277
1278 // Patch 4 :
1279 {
1280 // ---------492-----------------498---------
1281 // | | |
1282 // | | |
1283 // | | |
1284 // 494 128 490 129 496
1285 // | | |
1286 // | | |
1287 // | | |
1288 // ---------482-----------------488---------
1289 // | | |
1290 // | | |
1291 // | | |
1292 // 484 126 480 127 486
1293 // | | |
1294 // | | |
1295 // | | |
1296 // ---------441-----------------447---------
1297
1298 m_patch_facedir_uid.push_back(
1299 { // X
1300 {480, 484, 486, 490, 494, 496},
1301 // Y
1302 {441, 447, 482, 488, 492, 498}});
1303
1304 m_patch_facedir_next_cell_uid.push_back(
1305 { // X
1306 #ifdef CORRECT_UID
1307 {127, 126, -1, 129, 128, -1},
1308 #else
1309 {127, 126, 99, 129, 128, -1}, // error 99 -> -1
1310 #endif
1311 // Y
1312 #ifdef CORRECT_UID
1313 {126, 127, 128, 129, -1, -1}});
1314 #else
1315 {126, 127, 128, 129, 100, 100}}); // error 100 -> -1
1316 #endif
1317
1318 m_patch_facedir_prev_cell_uid.push_back(
1319 { // X
1320 #ifdef CORRECT_UID
1321 {126, -1, 127, 128, -1, 129},
1322 #else
1323 {126, 123, 127, 128, -1, 129}, // error 123 -> -1
1324 #endif
1325 // Y
1326 #ifdef CORRECT_UID
1327 { -1, -1, 126, 127, 128, 129}});
1328 #else
1329 {116, 117, 126, 127, 128, 129}}); // error 116, 117 -> -1
1330 #endif
1331 }
1332 }
1333
1334 // Tableaux des vues cartésiennes sur les noeuds par patch
1335 {
1336 // Patch 0
1337 {
1338
1339 // 55--------56--------57--------58--------59--------60--------61--------62--------63--------64--------65
1340 // | | | | | | | | | | |
1341 // | | | | | | | | | | |
1342 // | | | | | | | | | | |
1343 // 44--------45--------46--------47--------48--------49--------50--------51--------52--------53--------54
1344 // | | | | | | | | | | |
1345 // | | | | | | | | | | |
1346 // | | | | | | | | | | |
1347 // 33--------34--------35--------36--------37--------38--------39--------40--------41--------42--------43
1348 // | | | | | | | | | | |
1349 // | | | | | | | | | | |
1350 // | | | | | | | | | | |
1351 // 22--------23--------24--------25--------26--------27--------28--------29--------30--------31--------32
1352 // | | | | | | | | | | |
1353 // | | | | | | | | | | |
1354 // | | | | | | | | | | |
1355 // 11--------12--------13--------14--------15--------16--------17--------18--------19--------20--------21
1356 // | | | | | | | | | | |
1357 // | | | | | | | | | | |
1358 // | | | | | | | | | | |
1359 // 0---------1---------2---------3---------4---------5---------6---------7---------8---------9---------10
1360
1361 m_patch_node_uid.push_back(
1362 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
1363 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1364 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1365 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
1366 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1367 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65});
1368
1369 m_patch_nodedir_next_uid.push_back(
1370 { // X
1371 { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -1,
1372 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, -1,
1373 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, -1,
1374 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, -1,
1375 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, -1,
1376 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, -1},
1377 // Y
1378 { 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1379 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1380 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
1381 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1382 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
1383 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}});
1384
1385 m_patch_nodedir_prev_uid.push_back(
1386 { // X
1387 { -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1388 -1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1389 -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
1390 -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
1391 -1, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1392 -1, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64},
1393 // Y
1394 { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1395 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
1396 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1397 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1398 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
1399 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54}});
1400 }
1401
1402 // Patch 1
1403 {
1404 // 35-------106--------36-------112--------37-------118--------38-------124--------39
1405 // | | | | | | | | |
1406 // | | | | | | | | |
1407 // | | | | | | | | |
1408 // 102-------100-------104-------108-------110-------114-------116-------120-------122
1409 // | | | | | | | | |
1410 // | | | | | | | | |
1411 // | | | | | | | | |
1412 // 24--------74--------25--------82--------26--------90--------27--------98--------28
1413 // | | | | | | | | |
1414 // | | | | | | | | |
1415 // | | | | | | | | |
1416 // 70--------68--------72--------78--------80--------86--------88--------94--------96
1417 // | | | | | | | | |
1418 // | | | | | | | | |
1419 // | | | | | | | | |
1420 // 13--------66--------14--------76--------15--------84--------16--------92--------17
1421
1422 m_patch_node_uid.push_back(
1423 { 13, 14, 15, 16, 17,
1424 24, 25, 26, 27, 28,
1425 35, 36, 37, 38, 39,
1426 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98,
1427 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124});
1428
1429 m_patch_nodedir_next_uid.push_back(
1430 { // X
1431 { 66, 76, 84, 92, -1,
1432 74, 82, 90, 98, -1,
1433 106, 112, 118, 124, -1,
1434 14, 72, 68, 78, 25, 15, 80, 86, 26, 16, 88, 94, 27, 17, 96, -1, 28,
1435 104, 100, 108, 36, 110, 114, 37, 116, 120, 38, 122, -1, 39},
1436 // Y
1437 { 70, 72, 80, 88, 96,
1438 102, 104, 110, 116, 122,
1439 -1, -1, -1, -1, -1,
1440 68, 74, 24, 25, 100, 78, 82, 26, 108, 86, 90, 27, 114, 94, 98, 28, 120,
1441 106, 35, 36, -1, 112, 37, -1, 118, 38, -1, 124, 39, -1}});
1442
1443 m_patch_nodedir_prev_uid.push_back(
1444 { // X
1445 { -1, 66, 76, 84, 92,
1446 -1, 74, 82, 90, 98,
1447 -1, 106, 112, 118, 124,
1448 13, 70, -1, 68, 24, 14, 72, 78, 25, 15, 80, 86, 26, 16, 88, 94, 27,
1449 102, -1, 100, 35, 104, 108, 36, 110, 114, 37, 116, 120, 38},
1450 // Y
1451 { -1, -1, -1, -1, -1,
1452 70, 72, 80, 88, 96,
1453 102, 104, 110, 116, 122,
1454 -1, 66, 13, 14, 68, -1, 76, 15, 78, -1, 84, 16, 86, -1, 92, 17, 94,
1455 74, 24, 25, 100, 82, 26, 108, 90, 27, 114, 98, 28, 120}});
1456 }
1457
1458 // Patch 2 :
1459 {
1460 // 61-------149--------62-------155--------63
1461 // | | | | |
1462 // | | | | |
1463 // | | | | |
1464 // 145-------143-------147-------151-------153
1465 // | | | | |
1466 // | | | | |
1467 // | | | | |
1468 // 50-------133--------51-------141--------52
1469 // | | | | |
1470 // | | | | |
1471 // | | | | |
1472 // 129-------127-------131-------137-------139
1473 // | | | | |
1474 // | | | | |
1475 // | | | | |
1476 // 39-------125--------40-------135--------41
1477
1478 m_patch_node_uid.push_back(
1479 { 39, 40, 41,
1480 50, 51, 52,
1481 61, 62, 63,
1482 125, 127, 129, 131, 133, 135, 137, 139, 141,
1483 143, 145, 147, 149, 151, 153, 155});
1484
1485 m_patch_nodedir_next_uid.push_back(
1486 { // X
1487 {125, 135, -1,
1488 133, 141, -1,
1489 149, 155, -1,
1490 40, 131, 127, 137, 51, 41, 139, -1, 52,
1491 147, 143, 151, 62, 153, -1, 63},
1492 // Y
1493 {129, 131, 139,
1494 145, 147, 153,
1495 -1, -1, -1,
1496 127, 133, 50, 51, 143, 137, 141, 52, 151,
1497 149, 61, 62, -1, 155, 63, -1}});
1498
1499 m_patch_nodedir_prev_uid.push_back(
1500 { // X
1501 { -1, 125, 135,
1502 -1, 133, 141,
1503 -1, 149, 155,
1504 39, 129, -1, 127, 50, 40, 131, 137, 51,
1505 145, -1, 143, 61, 147, 151, 62},
1506 // Y
1507 { -1, -1, -1,
1508 129, 131, 139,
1509 145, 147, 153,
1510 -1, 125, 39, 40, 127, -1, 135, 41, 137,
1511 133, 50, 51, 143, 141, 52, 151}});
1512 }
1513
1514 // Patch 3 :
1515 {
1516 // 58-----------------170------------------59
1517 // | | |
1518 // | | |
1519 // | | |
1520 // | | |
1521 // | | |
1522 // | | |
1523 // | | |
1524 // 166-----------------164-----------------168
1525 // | | |
1526 // | | |
1527 // | | |
1528 // | | |
1529 // | | |
1530 // | | |
1531 // | | |
1532 // 47-----------------162------------------48
1533 // | | |
1534 // | | |
1535 // | | |
1536 // | | |
1537 // | | |
1538 // | | |
1539 // | | |
1540 // 158-----------------156-----------------160
1541 // | | |
1542 // | | |
1543 // | | |
1544 // | | |
1545 // | | |
1546 // | | |
1547 // | | |
1548 // 36-----------------112------------------37
1549 // 36-------196-------112-------202--------37
1550 // | | | | |
1551 // | | | | |
1552 // | | | | |
1553 // 192-------190-------194-------198-------200
1554 // | | | | |
1555 // | | | | |
1556 // | | | | |
1557 // 104-------180-------108-------188-------110
1558 // | | | | |
1559 // | | | | |
1560 // | | | | |
1561 // 176-------174-------178-------184-------186
1562 // | | | | |
1563 // | | | | |
1564 // | | | | |
1565 // 25-------172--------82-------182--------26
1566
1567 m_patch_node_uid.push_back(
1568 { 25, 26, 36, 37, 47, 48, 58, 59,
1569 82, 104, 108, 110, 112,
1570 156, 158, 160, 162, 164, 166, 168, 170,
1571 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202});
1572
1573 m_patch_nodedir_next_uid.push_back(
1574 { // X
1575 {172, -1, 196, -1, 162, -1, 170, -1,
1576 182, 180, 188, -1, 202,
1577 160, 156, -1, 48, 168, 164, -1, 59,
1578 82, 178, 174, 184, 108, 26, 186, -1, 110, 194, 190, 198, 112, 200, -1, 37},
1579 // Y
1580 {176, 186, 158, 160, 166, 168, -1, -1,
1581 178, 192, 194, 200, 156,
1582 162, 47, 48, 164, 170, 58, 59, -1,
1583 174, 180, 104, 108, 190, 184, 188, 110, 198, 196, 36, 112, -1, 202, 37, -1}});
1584
1585 m_patch_nodedir_prev_uid.push_back(
1586 { // X
1587 { -1, 182, -1, 202, -1, 162, -1, 170,
1588 172, -1, 180, 188, 196,
1589 158, -1, 156, 47, 166, -1, 164, 58,
1590 25, 176, -1, 174, 104, 82, 178, 184, 108, 192, -1, 190, 36, 194, 198, 112},
1591 // Y
1592 { -1, -1, 192, 200, 158, 160, 166, 168,
1593 -1, 176, 178, 186, 194,
1594 112, 36, 37, 156, 162, 47, 48, 164,
1595 -1, 172, 25, 82, 174, -1, 182, 26, 184, 180, 104, 108, 190, 188, 110, 198}});
1596 }
1597
1598 // Patch 4 :
1599 {
1600 // 158-----------------215-----------------156
1601 // | | |
1602 // | | |
1603 // | | |
1604 // | | |
1605 // | | |
1606 // | | |
1607 // | | |
1608 // 211-----------------209-----------------213
1609 // | | |
1610 // | | |
1611 // | | |
1612 // | | |
1613 // | | |
1614 // | | |
1615 // | | |
1616 // 36-----------------196-----------------112
1617
1618 m_patch_node_uid.push_back(
1619 { 36, 112, 156, 158, 196, 209, 211, 213, 215});
1620
1621 m_patch_nodedir_next_uid.push_back(
1622 { // X
1623 {196, -1, -1, 215, 112, 213, 209, -1, 156},
1624 // Y
1625 {211, 213, -1, -1, 209, 215, 158, 156, -1}});
1626
1627 m_patch_nodedir_prev_uid.push_back(
1628 { // X
1629 { -1, 196, 215, -1, 36, 211, -1, 209, 158},
1630 // Y
1631 { -1, -1, 213, 211, -1, 196, 36, 112, 209}});
1632 }
1633 }
1634
1635 // Tableaux des connectivités noeuds -> mailles par patch
1636 {
1637 // Patch -1
1638 {
1639 // 55--------56--------57--------58xxxxxxxxxx59--------60--------61oooooooo62oooooooo63--------64--------65
1640 // | | | x | x | o | | | o | |
1641 // | | | x 104 | 105 x | o 92 | 93 | 96 | 97 o | |
1642 // | | | x | x | o | | | o | |
1643 // | 40 | 41 | 42 x-----43----x 44 | 45 o----46---|----47---o 48 | 49 |
1644 // | | | x | x | o | | | o | |
1645 // | | | x 102 | 103 x | o 90 | 91 | 94 | 95 o | |
1646 // | | | x | x | o | | | o | |
1647 // 44--------45--------46--------47----------48--------49--------50---|----51---|----52--------53--------54
1648 // | | | x | x | o | | | o | |
1649 // | | | x 100 | 101 x | o 84 | 85 | 88 | 89 o | |
1650 // | | | x | x | o | | | o | |
1651 // | 30 | 31 | 32 ======33----x 34 | 35 o----36---|----37---o 38 | 39 |
1652 // | | | =28|29= x | o | | | o | |
1653 // | | | =--98-= 99 x | o 82 | 83 | 86 | 87 o | |
1654 // | | | =26|27= x | o | | | o | |
1655 // 33--------34--------35++++++++36=====+++++37++++++++38++++++++39oooooooo40oooooooo41--------42--------43
1656 // | | + | x16|17|20|21x | | | + | | | |
1657 // | | + 68 | 69 x--72-|--73-x 76 | 77 | 80 | 81 + | | | |
1658 // | | + | x14|15|18|19x | | | + | | | |
1659 // | 20 | 21 +----22---x-----23----x----24---|----25---+ 26 | 27 | 28 | 29 |
1660 // | | + | x08|09|12|13x | | | + | | | |
1661 // | | + 66 | 67 x--70-|--71-x 74 | 75 | 78 | 79 + | | | |
1662 // | | + | x06|07|10|11x | | | + | | | |
1663 // 22--------23--------24--------25xxxxxxxxxx26--------27--------28--------29--------30--------31--------32
1664 // | | + | | | | | | | + | | | |
1665 // | | + 52 | 53 | 56 | 57 | 60 | 61 | 64 | 65 + | | | |
1666 // | | + | | | | | | | + | | | |
1667 // | 10 | 11 +----12---|-----13----|----14---|----15---+ 16 | 17 | 18 | 19 |
1668 // | | + | | | | | | | + | | | |
1669 // | | + 50 | 51 | 54 | 55 | 58 | 59 | 62 | 63 + | | | |
1670 // | | + | | | | | | | + | | | |
1671 // 11--------12--------13++++++++14++++++++++15++++++++16++++++++17--------18--------19--------20--------21
1672 // | | | | | | | | | | |
1673 // | | | | | | | | | | |
1674 // | | | | | | | | | | |
1675 // | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
1676 // | | | | | | | | | | |
1677 // | | | | | | | | | | |
1678 // | | | | | | | | | | |
1679 // 0---------1---------2---------3-----------4---------5---------6---------7---------8---------9---------10
1680
1681 m_patch_nodecell_upper_right_uid.push_back(
1682 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1,
1683 10, 11, 50, 54, 58, 62, 16, 17, 18, 19, -1,
1684 20, 21, 66, 106, 74, 78, 26, 27, 28, 29, -1,
1685 30, 31, 122, 126, 34, 35, 82, 86, 38, 39, -1,
1686 40, 41, 42, 102, 44, 45, 90, 94, 48, 49, -1,
1687 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1});
1688
1689 m_patch_nodecell_upper_left_uid.push_back(
1690 { -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1691 -1, 10, 11, 51, 55, 59, 63, 16, 17, 18, 19,
1692 -1, 20, 21, 67, 111, 75, 79, 26, 27, 28, 29,
1693 -1, 30, 31, 123, 99, 34, 35, 83, 87, 38, 39,
1694 -1, 40, 41, 42, 103, 44, 45, 91, 95, 48, 49,
1695 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1});
1696
1697 m_patch_nodecell_lower_right_uid.push_back(
1698 { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1699 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1,
1700 10, 11, 52, 56, 60, 64, 16, 17, 18, 19, -1,
1701 20, 21, 68, 116, 76, 80, 26, 27, 28, 29, -1,
1702 30, 31, 124, 100, 34, 35, 84, 88, 38, 39, -1,
1703 40, 41, 42, 104, 44, 45, 92, 96, 48, 49, -1});
1704
1705 m_patch_nodecell_lower_left_uid.push_back(
1706 { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1707 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1708 -1, 10, 11, 53, 57, 61, 65, 16, 17, 18, 19,
1709 -1, 20, 21, 69, 121, 77, 81, 26, 27, 28, 29,
1710 -1, 30, 31, 125, 101, 34, 35, 85, 89, 38, 39,
1711 -1, 40, 41, 42, 105, 44, 45, 93, 97, 48, 49});
1712 }
1713
1714 // Patch 0
1715 {
1716 // 55--------56--------57--------58--------59--------60--------61--------62--------63--------64--------65
1717 // | | | | | | | | | | |
1718 // | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 |
1719 // | | | | | | | | | | |
1720 // 44--------45--------46--------47--------48--------49--------50--------51--------52--------53--------54
1721 // | | | | | | | | | | |
1722 // | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 |
1723 // | | | | | | | | | | |
1724 // 33--------34--------35--------36--------37--------38--------39--------40--------41--------42--------43
1725 // | | | | | | | | | | |
1726 // | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
1727 // | | | | | | | | | | |
1728 // 22--------23--------24--------25--------26--------27--------28--------29--------30--------31--------32
1729 // | | | | | | | | | | |
1730 // | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
1731 // | | | | | | | | | | |
1732 // 11--------12--------13--------14--------15--------16--------17--------18--------19--------20--------21
1733 // | | | | | | | | | | |
1734 // | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
1735 // | | | | | | | | | | |
1736 // 0---------1---------2---------3---------4---------5---------6---------7---------8---------9---------10
1737
1738 m_patch_nodecell_upper_right_uid.push_back(
1739 { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1,
1740 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, -1,
1741 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1,
1742 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
1743 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, -1,
1744 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1});
1745
1746 m_patch_nodecell_upper_left_uid.push_back(
1747 { -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1748 -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1749 -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1750 -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1751 -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
1752 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1});
1753
1754 m_patch_nodecell_lower_right_uid.push_back(
1755 { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1756 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1,
1757 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, -1,
1758 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, -1,
1759 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
1760 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, -1});
1761
1762 m_patch_nodecell_lower_left_uid.push_back(
1763 { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1764 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1765 -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1766 -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1767 -1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1768 -1, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49});
1769 }
1770
1771 // Patch 1
1772 {
1773 // 35-------106--------36-------112--------37-------118--------38-------124--------39
1774 // | | | | | | | | |
1775 // | 68 | 69 | 72 | 73 | 76 | 77 | 80 | 81 |
1776 // | | | | | | | | |
1777 // 102-------100-------104-------108-------110-------114-------116-------120-------122
1778 // | | | | | | | | |
1779 // | 66 | 67 | 70 | 71 | 74 | 75 | 78 | 79 |
1780 // | | | | | | | | |
1781 // 24--------74--------25--------82--------26--------90--------27--------98--------28
1782 // | | | | | | | | |
1783 // | 52 | 53 | 56 | 57 | 60 | 61 | 64 | 65 |
1784 // | | | | | | | | |
1785 // 70--------68--------72--------78--------80--------86--------88--------94--------96
1786 // | | | | | | | | |
1787 // | 50 | 51 | 54 | 55 | 58 | 59 | 62 | 63 |
1788 // | | | | | | | | |
1789 // 13--------66--------14--------76--------15--------84--------16--------92--------17
1790
1791 m_patch_nodecell_upper_right_uid.push_back(
1792 { 50, 54, 58, 62, -1,
1793 66, 70, 74, 78, -1,
1794 #ifdef CORRECT_UID
1795 -1, -1, -1, -1, -1,
1796 #else
1797 122, 98, -1, -1, 82, // error 122, 98, 82 -> -1
1798 #endif
1799 51, 53, 52, 56, 67, 55, 57, 60, 71, 59, 61, 64, 75, 63, 65, -1, 79,
1800 #ifdef CORRECT_UID
1801 69, 68, 72, -1, 73, 76, -1, 77, 80, -1, 81, -1, -1});
1802 #else
1803 69, 68, 72, 123, 73, 76, 99, 77, 80, -1, 81, -1, -1}); // error 123, 99 -> -1
1804 #endif
1805
1806 m_patch_nodecell_upper_left_uid.push_back(
1807 { -1, 51, 55, 59, 63,
1808 -1, 67, 71, 75, 79,
1809 #ifdef CORRECT_UID
1810 -1, -1, -1, -1, -1,
1811 #else
1812 -1, 123, 99, -1, -1, // error 123, 99 -> -1
1813 #endif
1814 50, 52, -1, 53, 66, 54, 56, 57, 70, 58, 60, 61, 74, 62, 64, 65, 78,
1815 #ifdef CORRECT_UID
1816 68, -1, 69, -1, 72, 73, -1, 76, 77, -1, 80, 81, -1});
1817 #else
1818 68, -1, 69, 122, 72, 73, 98, 76, 77, -1, 80, 81, -1}); // error 122, 98 -> -1
1819 #endif
1820
1821 m_patch_nodecell_lower_right_uid.push_back(
1822 { -1, -1, -1, -1, -1,
1823 52, 56, 60, 64, -1,
1824 68, 72, 76, 80, -1,
1825 -1, 51, 50, 54, 53, -1, 55, 58, 57, -1, 59, 62, 61, -1, 63, -1, 65,
1826 67, 66, 70, 69, 71, 74, 73, 75, 78, 77, 79, -1, 81});
1827
1828 m_patch_nodecell_lower_left_uid.push_back(
1829 { -1, -1, -1, -1, -1,
1830 -1, 53, 57, 61, 65,
1831 -1, 69, 73, 77, 81,
1832 -1, 50, -1, 51, 52, -1, 54, 55, 56, -1, 58, 59, 60, -1, 62, 63, 64,
1833 66, -1, 67, 68, 70, 71, 72, 74, 75, 76, 78, 79, 80});
1834 }
1835
1836 // Patch 2 :
1837 {
1838 // 61-------149--------62-------155--------63
1839 // | | | | |
1840 // | 92 | 93 | 96 | 97 |
1841 // | | | | |
1842 // 145-------143-------147-------151-------153
1843 // | | | | |
1844 // | 90 | 91 | 94 | 95 |
1845 // | | | | |
1846 // 50-------133--------51-------141--------52
1847 // | | | | |
1848 // | 84 | 85 | 88 | 89 |
1849 // | | | | |
1850 // 129-------127-------131-------137-------139
1851 // | | | | |
1852 // | 82 | 83 | 86 | 87 |
1853 // | | | | |
1854 // 39-------125--------40-------135--------41
1855
1856 m_patch_nodecell_upper_right_uid.push_back(
1857 { 82, 86, -1,
1858 90, 94, -1,
1859 -1, -1, -1,
1860 83, 85, 84, 88, 91, 87, 89, -1, 95,
1861 93, 92, 96, -1, 97, -1, -1});
1862
1863 m_patch_nodecell_upper_left_uid.push_back(
1864 { -1, 83, 87,
1865 -1, 91, 95,
1866 -1, -1, -1,
1867 82, 84, -1, 85, 90, 86, 88, 89, 94,
1868 92, -1, 93, -1, 96, 97, -1});
1869
1870 m_patch_nodecell_lower_right_uid.push_back(
1871 { -1, -1, -1,
1872 84, 88, -1,
1873 92, 96, -1,
1874 -1, 83, 82, 86, 85, -1, 87, -1, 89,
1875 91, 90, 94, 93, 95, -1, 97});
1876
1877 m_patch_nodecell_lower_left_uid.push_back(
1878 #ifdef CORRECT_UID
1879 { -1, -1, -1,
1880 #else
1881 { 81, -1, -1, // error 81 -> -1
1882 #endif
1883 -1, 85, 89,
1884 -1, 93, 97,
1885 -1, 82, -1, 83, 84, -1, 86, 87, 88,
1886 90, -1, 91, 92, 94, 95, 96});
1887 }
1888
1889 // Patch 3 :
1890 {
1891 // 58-----------------170------------------59
1892 // | | |
1893 // | | |
1894 // | | |
1895 // | 104 | 105 |
1896 // | | |
1897 // | | |
1898 // | | |
1899 // 166-----------------164-----------------168
1900 // | | |
1901 // | | |
1902 // | | |
1903 // | 102 | 103 |
1904 // | | |
1905 // | | |
1906 // | | |
1907 // 47-----------------162------------------48
1908 // | | |
1909 // | | |
1910 // | | |
1911 // | 100 | 101 |
1912 // | | |
1913 // | | |
1914 // | | |
1915 // 158<------347------>156<------353------>160
1916 // | | |
1917 // | | |
1918 // | | |
1919 // | 98 | 99 |
1920 // | | |
1921 // | | |
1922 // | | |
1923 // 36-----------------112------------------37
1924 // 36-------196-------112-------202--------37
1925 // | | | | |
1926 // | 116 | 117 | 120 | 121 |
1927 // | | | | |
1928 // 192-------190-------194-------198-------200
1929 // | | | | |
1930 // | 114 | 115 | 118 | 119 |
1931 // | | | | |
1932 // 104-------180-------108-------188-------110
1933 // | | | | |
1934 // | 108 | 109 | 112 | 113 |
1935 // | | | | |
1936 // 176-------174-------178-------184-------186
1937 // | | | | |
1938 // | 106 | 107 | 110 | 111 |
1939 // | | | | |
1940 // 25-------172--------82-------182--------26
1941
1942 m_patch_nodecell_upper_right_uid.push_back(
1943 #ifdef CORRECT_UID
1944 {106, -1, 98, -1, 102, -1, -1, -1,
1945 110, 114, 118, -1, 99,
1946 101, 100, -1, 103, 105, 104, -1, -1,
1947 107, 109, 108, 112, 115, 111, 113, -1, 119, 117, 116, 120, -1, 121, -1, -1});
1948 #else
1949 {106, -1, 126, -1, -1, -1, -1, -1, // error 126 -> 98, -1 -> 102
1950 110, 114, 118, -1, -1, // error -1 -> 99
1951 -1, -1, -1, -1, -1, -1, -1, -1, // error -1 -> 101, 100, 103, 105, 104
1952 107, 109, 108, 112, 115, 111, 113, -1, 119, 117, 116, 120, 127, 121, -1, -1}); // error 127 -> -1
1953 #endif
1954
1955 m_patch_nodecell_upper_left_uid.push_back(
1956 #ifdef CORRECT_UID
1957 { -1, 111, -1, 99, -1, 103, -1, -1,
1958 107, -1, 115, 119, 98,
1959 100, -1, 101, 102, 104, -1, 105, -1,
1960 106, 108, -1, 109, 114, 110, 112, 113, 118, 116, -1, 117, -1, 120, 121, -1});
1961 #else
1962 { -1, 111, -1, -1, -1, -1, -1, -1, // error -1 -> 99, 103
1963 107, -1, 115, 119, 127, // error 127 -> 98
1964 -1, -1, -1, -1, -1, -1, -1, -1, // error -1 -> 100, 101, 102, 104, 105
1965 106, 108, -1, 109, 114, 110, 112, 113, 118, 116, -1, 117, 126, 120, 121, -1}); // error 126 -> -1
1966 #endif
1967
1968 m_patch_nodecell_lower_right_uid.push_back(
1969 #ifdef CORRECT_UID
1970 { -1, -1, 116, -1, 100, -1, 104, -1,
1971 -1, 108, 112, -1, 120,
1972 99, 98, -1, 101, 103, 102, -1, 105,
1973 -1, 107, 106, 110, 109, -1, 111, -1, 113, 115, 114, 118, 117, 119, -1, 121});
1974 #else
1975 { -1, -1, 116, -1, -1, -1, -1, -1, // error -1 -> 100, 104
1976 -1, 108, 112, -1, 120,
1977 -1, 128, -1, -1, -1, -1, -1, -1, // error 128 -> 98, -1 -> 99, 101, 103, 102, 105
1978 -1, 107, 106, 110, 109, -1, 111, -1, 113, 115, 114, 118, 117, 119, -1, 121});
1979 #endif
1980
1981 m_patch_nodecell_lower_left_uid.push_back(
1982 #ifdef CORRECT_UID
1983 { -1, -1, -1, 121, -1, 101, -1, 105,
1984 -1, -1, 109, 113, 117,
1985 98, -1, 99, 100, 102, -1, 103, 104,
1986 -1, 106, -1, 107, 108, -1, 110, 111, 112, 114, -1, 115, 116, 118, 119, 120});
1987 #else
1988 { -1, -1, -1, 121, -1, -1, -1, -1, // error -1 -> 101, 105
1989 -1, -1, 109, 113, 117,
1990 129, -1, -1, -1, -1, -1, -1, -1, // error 129 -> 98, -1 -> 99, 100, 102, 103, 104
1991 -1, 106, -1, 107, 108, -1, 110, 111, 112, 114, -1, 115, 116, 118, 119, 120});
1992 #endif
1993 }
1994
1995 // Patch 4 :
1996 {
1997 // 158-----------------215-----------------156
1998 // | | |
1999 // | | |
2000 // | | |
2001 // | 128 | 129 |
2002 // | | |
2003 // | | |
2004 // | | |
2005 // 211-----------------209-----------------213
2006 // | | |
2007 // | | |
2008 // | | |
2009 // | 126 | 127 |
2010 // | | |
2011 // | | |
2012 // | | |
2013 // 36-----------------196-----------------112
2014
2015 m_patch_node_uid.push_back(
2016 { 36, 112, 156, 158, 196, 209, 211, 213, 215});
2017
2018 m_patch_nodecell_upper_right_uid.push_back(
2019 {126, -1, -1, -1, 127, 129, 128, -1, -1});
2020
2021 m_patch_nodecell_upper_left_uid.push_back(
2022 { -1, 127, -1, -1, 126, 128, -1, 129, -1});
2023
2024 m_patch_nodecell_lower_right_uid.push_back(
2025 #ifdef CORRECT_UID
2026 { -1, -1, -1, 128, -1, 127, 126, -1, 129});
2027 #else
2028 {116, 120, -1, 128, 117, 127, 126, -1, 129}); // error 116, 120, 117 -> -1
2029 #endif
2030
2031 m_patch_nodecell_lower_left_uid.push_back(
2032 #ifdef CORRECT_UID
2033 { -1, -1, 129, -1, -1, 126, -1, 127, 128});
2034 #else
2035 { -1, 117, 129, -1, 116, 126, -1, 127, 128}); // error 117, 116 -> -1
2036 #endif
2037 }
2038 }
2039// clang-format on
2040}
2041
2042/*---------------------------------------------------------------------------*/
2047/*---------------------------------------------------------------------------*/
2048void
2049UnitTestCartesianMeshPatchService::setUp()
2050{
2051}
2052
2053/*---------------------------------------------------------------------------*/
2058/*---------------------------------------------------------------------------*/
2059void
2060UnitTestCartesianMeshPatchService::tearDown()
2061{
2062}
2063
2064/*---------------------------------------------------------------------------*/
2069/*---------------------------------------------------------------------------*/
2070void
2071UnitTestCartesianMeshPatchService::tearDownForClass()
2072{
2073}
2074
2075/*---------------------------------------------------------------------------*/
2080/*---------------------------------------------------------------------------*/
2081void
2082UnitTestCartesianMeshPatchService::testCartesianMeshPatchCellsAndParents()
2083{
2084 for (Int32 lvl{0}; lvl < 3; ++lvl) {
2085 const std::vector<Int64>& cell_uid{m_lvl_cell_uid[lvl]};
2086 const std::vector<Int64>& cell_p_uid{m_lvl_cell_p_uid[lvl]};
2087 const std::vector<Int64>& cell_tp_uid{m_lvl_cell_tp_uid[lvl]};
2088
2089 const CellGroup& allLevelCells{this->mesh()->allLevelCells(lvl)};
2090 ASSERT_EQUAL(static_cast<Integer>(cell_uid.size()), allLevelCells.size());
2091
2092 ENUMERATE_CELL (cell_i, allLevelCells) {
2093 const Int64 i{cell_i.index()};
2094
2095 ASSERT_EQUAL(cell_uid[i], cell_i->uniqueId().asInt64());
2096 if (lvl > 0) {
2097 ASSERT_EQUAL(cell_p_uid[i], cell_i->hParent().uniqueId().asInt64());
2098 ASSERT_EQUAL(cell_tp_uid[i], cell_i->topHParent().uniqueId().asInt64());
2099 }
2100 }
2101 }
2102}
2103
2104/*---------------------------------------------------------------------------*/
2109/*---------------------------------------------------------------------------*/
2110void
2111UnitTestCartesianMeshPatchService::testCartesianMeshPatchCellDirectionMng()
2112{
2113 ASSERT_EQUAL(m_cartesian_mesh->nbPatch(), 5);
2114
2115 for (Int32 patch_i{-1}; patch_i < 5; ++patch_i) {
2116 ICartesianMeshPatch* cm_patch{(patch_i == -1) ? nullptr : m_cartesian_mesh->patch(patch_i)};
2117
2118 const Int32 ipatch{(patch_i == -1) ? 0 : patch_i};
2119 const std::vector<Int64>& cell_uid{m_patch_cell_uid[ipatch]};
2120 const std::vector<std::vector<Int64>>& celldir_next_uid{m_patch_celldir_next_uid[ipatch]};
2121 const std::vector<std::vector<Int64>>& celldir_prev_uid{m_patch_celldir_prev_uid[ipatch]};
2122 const std::vector<std::vector<Int64>>& cellfacedir_next_uid{m_patch_cellfacedir_next_uid[ipatch]};
2123 const std::vector<std::vector<Int64>>& cellfacedir_prev_uid{m_patch_cellfacedir_prev_uid[ipatch]};
2124 const std::vector<Int64>& cellnode_upper_right_uid{m_patch_cellnode_upper_right_uid[ipatch]};
2125 const std::vector<Int64>& cellnode_upper_left_uid{m_patch_cellnode_upper_left_uid[ipatch]};
2126 const std::vector<Int64>& cellnode_lower_right_uid{m_patch_cellnode_lower_right_uid[ipatch]};
2127 const std::vector<Int64>& cellnode_lower_left_uid{m_patch_cellnode_lower_left_uid[ipatch]};
2128
2129 for (Int32 dir{0}; dir < 2; ++dir) {
2130 CellDirectionMng cell_dm{(patch_i == -1) ? m_cartesian_mesh->cellDirection(dir) : cm_patch->cellDirection(dir)};
2131
2132 info() << "Patch = " << patch_i << " dir=" << dir;
2133 const std::vector<Int64>& cell_next_uid{celldir_next_uid[dir]};
2134 const std::vector<Int64>& cell_prev_uid{celldir_prev_uid[dir]};
2135 const std::vector<Int64>& cellface_next_uid{cellfacedir_next_uid[dir]};
2136 const std::vector<Int64>& cellface_prev_uid{cellfacedir_prev_uid[dir]};
2137
2138 const CellGroup& allCellDMCells{cell_dm.allCells()};
2139 ASSERT_EQUAL(static_cast<Integer>(cell_uid.size()), allCellDMCells.size());
2140
2142 const Int64 i{cell_i.index()};
2143 const Cell& cell{*cell_i};
2144
2145 ASSERT_EQUAL(cell_uid[i], cell_i->uniqueId().asInt64());
2146
2147 {
2149 info() << "Cell = " << cell_i->uniqueId() << " expected_next=" << cell_next_uid[i] << " expected_prev=" << cell_prev_uid[i];
2150 ASSERT_EQUAL(cell_next_uid[i], dir_cell.next().uniqueId().asInt64());
2151 ASSERT_EQUAL(cell_prev_uid[i], dir_cell.previous().uniqueId().asInt64());
2152 }
2153
2154 {
2155 const DirCellFace& dir_cellface{cell_dm.cellFace(cell)};
2156 ASSERT_EQUAL(cellface_next_uid[i], dir_cellface.next().uniqueId().asInt64());
2157 ASSERT_EQUAL(cellface_prev_uid[i], dir_cellface.previous().uniqueId().asInt64());
2158 }
2159
2160 {
2161 const DirCellNode& dir_cellnode{cell_dm.cellNode(cell)};
2162 {
2163 const Node& node_upper_right{(dir == 1) ? dir_cellnode.nextRight() : dir_cellnode.nextLeft()};
2164 ASSERT_EQUAL(cellnode_upper_right_uid[i], node_upper_right.uniqueId().asInt64());
2165 }
2166 {
2167 const Node& node_upper_left{(dir == 1) ? dir_cellnode.nextLeft() : dir_cellnode.previousLeft()};
2168 ASSERT_EQUAL(cellnode_upper_left_uid[i], node_upper_left.uniqueId().asInt64());
2169 }
2170 {
2171 const Node& node_lower_right{(dir == 1) ? dir_cellnode.previousRight() : dir_cellnode.nextRight()};
2172 ASSERT_EQUAL(cellnode_lower_right_uid[i], node_lower_right.uniqueId().asInt64());
2173 }
2174 {
2175 const Node& node_lower_left{(dir == 1) ? dir_cellnode.previousLeft() : dir_cellnode.previousRight()};
2176 ASSERT_EQUAL(cellnode_lower_left_uid[i], node_lower_left.uniqueId().asInt64());
2177 }
2178 }
2179 }
2180 }
2181 }
2182}
2183
2184/*---------------------------------------------------------------------------*/
2189/*---------------------------------------------------------------------------*/
2190void
2191UnitTestCartesianMeshPatchService::testCartesianMeshPatchFaceDirectionMng()
2192{
2193 for (Int32 patch_i{-1}; patch_i < 5; ++patch_i) {
2194 ICartesianMeshPatch* cm_patch{(patch_i == -1) ? nullptr : m_cartesian_mesh->patch(patch_i)};
2195
2196 const Int32 ipatch{(patch_i == -1) ? 0 : patch_i};
2197 const std::vector<std::vector<Int64>>& facedir_uid{m_patch_facedir_uid[ipatch]};
2198 const std::vector<std::vector<Int64>>& facedir_next_cell_uid{m_patch_facedir_next_cell_uid[ipatch]};
2199 const std::vector<std::vector<Int64>>& facedir_prev_cell_uid{m_patch_facedir_prev_cell_uid[ipatch]};
2200
2201 for (Int32 dir{0}; dir < 2; ++dir) {
2202 FaceDirectionMng face_dm{(patch_i == -1) ? m_cartesian_mesh->faceDirection(dir) : cm_patch->faceDirection(dir)};
2203
2204 info() << "Patch = " << patch_i << " dir=" << dir;
2205
2206 const std::vector<Int64>& face_uid{facedir_uid[dir]};
2207 const std::vector<Int64>& face_next_cell_uid{facedir_next_cell_uid[dir]};
2208 const std::vector<Int64>& face_prev_cell_uid{facedir_prev_cell_uid[dir]};
2209
2210 const FaceGroup& allFaceDMFaces{face_dm.allFaces()};
2211 ASSERT_EQUAL(static_cast<Integer>(face_uid.size()), allFaceDMFaces.size());
2212
2214 const Int64 i{face_i.index()};
2215
2217 Cell next_cell = dir_face.nextCell();
2218 Cell prev_cell = dir_face.previousCell();
2219 ASSERT_EQUAL(face_prev_cell_uid[i], dir_face.previousCell().uniqueId().asInt64());
2220 info() << "Face = " << ItemPrinter(*face_i) << " next_cell=" << ItemPrinter(next_cell)
2221 << " prev_cell=" << ItemPrinter(prev_cell);
2222 info() << "Face = " << face_i->uniqueId() << " expected_next=" << face_next_cell_uid[i]
2223 << " expected_prev=" << face_prev_cell_uid[i];
2224 ASSERT_EQUAL(face_uid[i], face_i->uniqueId().asInt64());
2225
2226 ASSERT_EQUAL(face_next_cell_uid[i], dir_face.nextCell().uniqueId().asInt64());
2227 ASSERT_EQUAL(face_prev_cell_uid[i], dir_face.previousCell().uniqueId().asInt64());
2228 }
2229 }
2230 }
2231}
2232
2233/*---------------------------------------------------------------------------*/
2238/*---------------------------------------------------------------------------*/
2239void
2240UnitTestCartesianMeshPatchService::testCartesianMeshPatchNodeDirectionMng()
2241{
2242 for (Int32 patch_i{-1}; patch_i < 5; ++patch_i) {
2243 ICartesianMeshPatch* cm_patch{(patch_i == -1) ? nullptr : m_cartesian_mesh->patch(patch_i)};
2244
2245 const Int32 ipatch{(patch_i == -1) ? 0 : patch_i};
2246 const std::vector<Int64>& node_uid{m_patch_node_uid[ipatch]};
2247 const std::vector<std::vector<Int64>>& nodedir_next_uid{m_patch_nodedir_next_uid[ipatch]};
2248 const std::vector<std::vector<Int64>>& nodedir_prev_uid{m_patch_nodedir_prev_uid[ipatch]};
2249
2250 for (Int32 dir{0}; dir < 2; ++dir) {
2251 NodeDirectionMng node_dm{(patch_i == -1) ? m_cartesian_mesh->nodeDirection(dir) : cm_patch->nodeDirection(dir)};
2252
2253 const std::vector<Int64>& node_next_uid{nodedir_next_uid[dir]};
2254 const std::vector<Int64>& node_prev_uid{nodedir_prev_uid[dir]};
2255
2256 const NodeGroup& allNodeDMNodes{node_dm.allNodes()};
2257 ASSERT_EQUAL(static_cast<Integer>(node_uid.size()), allNodeDMNodes.size());
2258
2260 const Int64 i{node_i.index()};
2261
2262 ASSERT_EQUAL(node_uid[i], node_i->uniqueId().asInt64());
2263
2264 const DirNode& dir_node{node_dm[node_i]};
2265 ASSERT_EQUAL(node_next_uid[i], dir_node.next().uniqueId().asInt64());
2266 ASSERT_EQUAL(node_prev_uid[i], dir_node.previous().uniqueId().asInt64());
2267 }
2268 }
2269 }
2270}
2271
2272/*---------------------------------------------------------------------------*/
2277/*---------------------------------------------------------------------------*/
2278void
2279UnitTestCartesianMeshPatchService::testCartesianMeshPatchCartesianConnectivity()
2280{
2281 // Ne fait pas pour l'instant car il ne fonctionne pas.
2282 warning() << A_FUNCINFO << " This test is not activated because it does not (yet) work.";
2283 return;
2284
2285 const CartesianConnectivity& cc{m_cartesian_mesh->connectivity()};
2286
2287 for (Int32 patch_i{-1}; patch_i < 5; ++patch_i) {
2288 ICartesianMeshPatch* cm_patch{(patch_i == -1) ? nullptr : m_cartesian_mesh->patch(patch_i)};
2289
2290 {
2291 const Int32 ipatch{(patch_i == -1) ? 0 : patch_i};
2292
2293 const std::vector<Int64>& cellnode_upper_right_uid{m_patch_cellnode_upper_right_uid[ipatch]};
2294 const std::vector<Int64>& cellnode_upper_left_uid{m_patch_cellnode_upper_left_uid[ipatch]};
2295 const std::vector<Int64>& cellnode_lower_right_uid{m_patch_cellnode_lower_right_uid[ipatch]};
2296 const std::vector<Int64>& cellnode_lower_left_uid{m_patch_cellnode_lower_left_uid[ipatch]};
2297
2298 CellDirectionMng cell_dm{(patch_i == -1) ? m_cartesian_mesh->cellDirection(MD_DirX)
2299 : cm_patch->cellDirection(MD_DirX)};
2300 const CellGroup& allCellDMCells{cell_dm.allCells()};
2302 const Int64 i{cell_i.index()};
2303 const Cell& cell{*cell_i};
2304
2305 {
2306 const Node& node_upper_right{cc.upperRight(cell)};
2307 ASSERT_EQUAL(cellnode_upper_right_uid[i], node_upper_right.uniqueId().asInt64());
2308 }
2309 {
2310 const Node& node_upper_left{cc.upperLeft(cell)};
2311 ASSERT_EQUAL(cellnode_upper_left_uid[i], node_upper_left.uniqueId().asInt64());
2312 }
2313 {
2314 const Node& node_lower_right{cc.lowerRight(cell)};
2315 ASSERT_EQUAL(cellnode_lower_right_uid[i], node_lower_right.uniqueId().asInt64());
2316 }
2317 {
2318 const Node& node_lower_left{cc.lowerLeft(cell)};
2319 ASSERT_EQUAL(cellnode_lower_left_uid[i], node_lower_left.uniqueId().asInt64());
2320 }
2321 }
2322 }
2323
2324 {
2325 const Int32 ipatch{patch_i + 1};
2326 const Int32 lvl{(patch_i < 1) ? 0 : (patch_i < 3) ? 1 : 2};
2327
2328 const std::vector<Int64>& nodecell_upper_right_uid{m_patch_nodecell_upper_right_uid[ipatch]};
2329 const std::vector<Int64>& nodecell_upper_left_uid{m_patch_nodecell_upper_left_uid[ipatch]};
2330 const std::vector<Int64>& nodecell_lower_right_uid{m_patch_nodecell_lower_right_uid[ipatch]};
2331 const std::vector<Int64>& nodecell_lower_left_uid{m_patch_nodecell_lower_left_uid[ipatch]};
2332
2333 NodeDirectionMng node_dm{(patch_i == -1) ? m_cartesian_mesh->nodeDirection(MD_DirX)
2334 : cm_patch->nodeDirection(MD_DirX)};
2335 const NodeGroup& allNodeDMNodes{node_dm.allNodes()};
2337 const Int64 i{node_i.index()};
2338 const Node node{*node_i};
2339 info() << " Node: " << ItemPrinter(node) << " patch=" << patch_i;
2340 {
2341 Cell cell_upper_right{(patch_i == -1) ? cc.upperRight(node) : upperRight(node, cm_patch, lvl)};
2342 info() << " CellUpperRight: " << ItemPrinter(cell_upper_right) << " expected=" << nodecell_upper_right_uid[i];
2343 ASSERT_EQUAL(nodecell_upper_right_uid[i], cell_upper_right.uniqueId().asInt64());
2344 }
2345 {
2346 const Cell& cell_upper_left{(patch_i == -1) ? cc.upperLeft(node) : upperLeft(node, cm_patch, lvl)};
2347 ASSERT_EQUAL(nodecell_upper_left_uid[i], cell_upper_left.uniqueId().asInt64());
2348 }
2349 {
2350 const Cell& cell_lower_right{(patch_i == -1) ? cc.lowerRight(node) : lowerRight(node, cm_patch, lvl)};
2351 ASSERT_EQUAL(nodecell_lower_right_uid[i], cell_lower_right.uniqueId().asInt64());
2352 }
2353 {
2354 const Cell& cell_lower_left{(patch_i == -1) ? cc.lowerLeft(node) : lowerLeft(node, cm_patch, lvl)};
2355 ASSERT_EQUAL(nodecell_lower_left_uid[i], cell_lower_left.uniqueId().asInt64());
2356 }
2357 }
2358 }
2359 }
2360}
2361
2362/*---------------------------------------------------------------------------*/
2363/*---------------------------------------------------------------------------*/
2364
2365ARCANE_REGISTER_SERVICE_UNITTESTCARTESIANMESHPATCH(UnitTestCartesianMeshPatch, UnitTestCartesianMeshPatchService);
2366
2367/*---------------------------------------------------------------------------*/
2368/*---------------------------------------------------------------------------*/
2369} // namespace ArcaneTest
#define ASSERT_EQUAL(expected, actual)
Vérifie que expected et actual sont égaux. La comparaison se fait via l'opérator==() du type.
Definition Assertion.h:151
#define ENUMERATE_FACE(name, group)
Enumérateur générique d'un groupe de faces.
#define ENUMERATE_CELL(name, group)
Enumérateur générique d'un groupe de mailles.
#define ENUMERATE_NODE(name, group)
Enumérateur générique d'un groupe de noeuds.
Classe de tests unitaires pour les vues cartésiennes sur les patchs.
void testCartesianMeshPatchCellsAndParents()
Test sur les mailles par niveau de raffinement et leurs parents.
void tearDown()
Actions a effectuer apres chaque test.
void setUp()
Actions a effectuer avant chaque test.
void setUpForClass()
Actions a effectuer pour tous les tests.
void testCartesianMeshPatchFaceDirectionMng()
Test vue cartésienne sur les faces.
void testCartesianMeshPatchNodeDirectionMng()
Test vue cartésienne sur les noeuds.
void tearDownForClass()
Actions a effectuer apres tous les tests.
void testCartesianMeshPatchCartesianConnectivity()
Test connectivité cartésienne maille -> noeud et noeud -> maille.
void testCartesianMeshPatchCellDirectionMng()
Test vue cartésienne sur les mailles.
Informations de connectivité d'un maillage cartésien.
Infos sur les mailles d'une direction spécifique X,Y ou Z d'un maillage structuré.
Maille d'un maillage.
Definition Item.h:1178
Maille avec info directionnelle des faces.
Maille avec info directionnelle des noeuds.
Maille avant et après une maille suivant une direction.
Infos sur maille avant et après une face suivant une direction.
Noeud avant et après un noeud suivant une direction.
Classe gérant un répertoire.
Definition Directory.h:33
Infos sur les face d'une direction spécifique X,Y ou Z d'un maillage structuré.
Interface d'un patch AMR d'un maillage cartésien.
virtual CellGroup cells()=0
Groupe de mailles du patch.
Interface d'un maillage cartésien.
static ICartesianMesh * getReference(const MeshHandleOrMesh &mesh, bool create=true)
Récupère ou créé la référence associée à mesh.
virtual ICartesianMeshPatch * patch(Int32 index) const =0
Retourne le index-ième patch du maillage.
virtual void refinePatch2D(Real2 position, Real2 length)=0
Raffine en 2D un bloc du maillage cartésien.
virtual void computeDirections()=0
Calcule les infos pour les accès par direction.
virtual Int32 nbPatch() const =0
Nombre de patchs du maillage.
Classe utilitaire pour imprimer les infos sur une entité.
Definition ItemPrinter.h:35
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Infos sur les noeuds d'une direction spécifique X,Y ou Z d'un maillage structuré.
Noeud d'un maillage.
Definition Dom.h:204
Classe gérant un vecteur de réel de dimension 2.
Definition Real2.h:121
Structure contenant les informations pour créer un service.
Exportation d'un maillage au format SVG.
Chaîne de caractères unicode.
const char * localstr() const
Retourne la conversion de l'instance dans l'encodage UTF-8.
Definition String.cc:227
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
@ MD_DirY
Direction Y.
@ MD_DirX
Direction X.