-
Notifications
You must be signed in to change notification settings - Fork 978
Expand file tree
/
Copy pathCMultiGridGeometry.cpp
More file actions
1300 lines (1040 loc) · 54.5 KB
/
CMultiGridGeometry.cpp
File metadata and controls
1300 lines (1040 loc) · 54.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*!
* \file CMultiGridGeometry.cpp
* \brief Implementation of the multigrid geometry class.
* \author F. Palacios, T. Economon
* \version 8.4.0 "Harrier"
*
* SU2 Project Website: https://su2code.github.io
*
* The SU2 Project is maintained by the SU2 Foundation
* (http://su2foundation.org)
*
* Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
*
* SU2 is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* SU2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with SU2. If not, see <http://www.gnu.org/licenses/>.
*/
#include "../../include/geometry/CMultiGridGeometry.hpp"
#include "../../include/geometry/CMultiGridQueue.hpp"
#include "../../include/toolboxes/printing_toolbox.hpp"
#include "../../../Common/include/toolboxes/geometry_toolbox.hpp"
CMultiGridGeometry::CMultiGridGeometry(CGeometry* fine_grid, CConfig* config, unsigned short iMesh) : CGeometry() {
nDim = fine_grid->GetnDim(); // Write the number of dimensions of the coarse grid.
/*--- Maximum agglomeration size in 2D is 4 nodes, in 3D is 8 nodes. ---*/
const short int maxAgglomSize = (nDim == 2) ? 4 : 8;
/*--- Inherit boundary properties from fine grid ---*/
boundIsStraight = fine_grid->boundIsStraight;
/*--- Agglomeration Scheme II (Nishikawa, Diskin, Thomas)
Create a queue system to do the agglomeration
1st) More than two markers ---> Vertices (never agglomerate)
2nd) Two markers ---> Edges (agglomerate if same BC, never agglomerate if different BC)
3rd) One marker ---> Surface (always agglomerate)
4th) No marker ---> Internal Volume (always agglomerate) ---*/
// Note that for MPI, we introduce interfaces and we can choose to have agglomeration over
// the interface or not. Nishikawa chooses not to agglomerate over interfaces.
/*--- Set a marker to indicate indirect agglomeration, for quads and hexs,
i.e. consider up to neighbors of neighbors.
For other levels this information is propagated down during their construction. ---*/
if (iMesh == MESH_1) {
for (auto iPoint = 0ul; iPoint < fine_grid->GetnPoint(); iPoint++)
fine_grid->nodes->SetAgglomerate_Indirect(iPoint, false);
for (auto iElem = 0ul; iElem < fine_grid->GetnElem(); iElem++) {
if ((fine_grid->elem[iElem]->GetVTK_Type() == HEXAHEDRON) ||
(fine_grid->elem[iElem]->GetVTK_Type() == QUADRILATERAL)) {
for (auto iNode = 0u; iNode < fine_grid->elem[iElem]->GetnNodes(); iNode++) {
const auto iPoint = fine_grid->elem[iElem]->GetNode(iNode);
fine_grid->nodes->SetAgglomerate_Indirect(iPoint, true);
}
}
}
}
/*--- Create the coarse grid structure using as baseline the fine grid ---*/
CMultiGridQueue MGQueue_InnerCV(fine_grid->GetnPoint());
vector<unsigned long> Suitable_Indirect_Neighbors;
nodes = new CPoint(fine_grid->GetnPoint(), nDim, iMesh, config);
unsigned long Index_CoarseCV = 0;
/*--- Statistics for Euler wall agglomeration ---*/
map<unsigned short, unsigned long> euler_wall_agglomerated, euler_wall_rejected_curvature,
euler_wall_rejected_straight;
for (unsigned short iMarker = 0; iMarker < fine_grid->GetnMarker(); iMarker++) {
if (config->GetMarker_All_KindBC(iMarker) == EULER_WALL) {
euler_wall_agglomerated[iMarker] = 0;
euler_wall_rejected_curvature[iMarker] = 0;
euler_wall_rejected_straight[iMarker] = 0;
}
}
/*--- STEP 1: The first step is the boundary agglomeration. ---*/
for (auto iMarker = 0u; iMarker < fine_grid->GetnMarker(); iMarker++) {
for (auto iVertex = 0ul; iVertex < fine_grid->GetnVertex(iMarker); iVertex++) {
const auto iPoint = fine_grid->vertex[iMarker][iVertex]->GetNode();
/*--- If the element has not been previously agglomerated and it
belongs to this physical domain, and it meets the geometrical
criteria, the agglomeration is studied. ---*/
vector<short> marker_seed;
if ((!fine_grid->nodes->GetAgglomerate(iPoint)) && (fine_grid->nodes->GetDomain(iPoint)) &&
(GeometricalCheck(iPoint, fine_grid, config))) {
unsigned short nChildren = 1;
/*--- We set an index for the parent control volume, this
also marks it as agglomerated. ---*/
fine_grid->nodes->SetParent_CV(iPoint, Index_CoarseCV);
/*--- We add the seed point (child) to the parent control volume ---*/
nodes->SetChildren_CV(Index_CoarseCV, 0, iPoint);
bool agglomerate_seed = false;
auto counter = 0;
unsigned short copy_marker[3] = {};
marker_seed.push_back(iMarker);
/*--- For a particular point in the fine grid we save all the markers
that are in that point ---*/
for (auto jMarker = 0u; jMarker < fine_grid->GetnMarker(); jMarker++) {
const string Marker_Tag = config->GetMarker_All_TagBound(iMarker);
if (fine_grid->nodes->GetVertex(iPoint, jMarker) != -1) {
copy_marker[counter] = jMarker;
counter++;
if (jMarker != iMarker) {
marker_seed.push_back(jMarker);
}
}
}
/*--- To agglomerate a vertex it must have only one physical bc.
This can be improved. If there is only one marker, it is a good
candidate for agglomeration ---*/
/*--- 1 BC, so either an edge in 2D or the interior of a plane in 3D ---*/
/*--- Valley -> Valley : conditionally allowed when both points are on the same marker. ---*/
/*--- ! Note that in the case of MPI SEND_RECEIVE markers, we might need other conditions ---*/
if (counter == 1) {
// The seed/parent is one valley, so we set this part to true
// if the child is on the same valley, we set it to true as well.
agglomerate_seed = true;
/*--- Euler walls: check curvature-based agglomeration criterion ---*/
if (config->GetMarker_All_KindBC(marker_seed[0]) == EULER_WALL) {
/*--- Allow agglomeration if marker is straight OR local curvature is small ---*/
if (!boundIsStraight[marker_seed[0]]) {
/*--- Compute local curvature at this point ---*/
su2double local_curvature = ComputeLocalCurvature(fine_grid, iPoint, marker_seed[0]);
// limit to 45 degrees
if (local_curvature >= 45.0) {
agglomerate_seed = false; // High curvature: do not agglomerate
euler_wall_rejected_curvature[marker_seed[0]]++;
} else {
euler_wall_agglomerated[marker_seed[0]]++;
}
} else {
/*--- Straight wall: agglomerate ---*/
euler_wall_agglomerated[marker_seed[0]]++;
}
}
/*--- Note that if the (single) marker is a SEND_RECEIVE, then the node is actually an interior point.
In that case it can only be agglomerated with another interior point. ---*/
if (config->GetMarker_All_KindBC(marker_seed[0]) == SEND_RECEIVE) {
agglomerate_seed = true;
}
}
/*--- Note that in 2D, this is a corner and we do not agglomerate unless one of them is SEND_RECEIVE. ---*/
/*--- In 3D, we agglomerate if the 2 markers are the same. ---*/
if (counter == 2) {
if (nDim == 2) {
agglomerate_seed = ((config->GetMarker_All_KindBC(copy_marker[0]) == SEND_RECEIVE) ||
(config->GetMarker_All_KindBC(copy_marker[1]) == SEND_RECEIVE));
}
/*--- agglomerate if both markers are the same. ---*/
if (nDim == 3) agglomerate_seed = (copy_marker[0] == copy_marker[1]);
/*--- Euler walls: check curvature-based agglomeration criterion for both markers ---*/
// only in 3d because in 2d it's a corner
bool euler_wall_rejected_here = false;
for (unsigned short i = 0; i < 2; i++) {
if ((nDim == 3) && (config->GetMarker_All_KindBC(copy_marker[i]) == EULER_WALL)) {
if (!boundIsStraight[copy_marker[i]]) {
/*--- Compute local curvature at this point ---*/
su2double local_curvature = ComputeLocalCurvature(fine_grid, iPoint, copy_marker[i]);
// limit to 45 degrees
if (local_curvature >= 45.0) {
agglomerate_seed = false; // High curvature: do not agglomerate
euler_wall_rejected_curvature[copy_marker[i]]++;
euler_wall_rejected_here = true;
}
}
/*--- Track agglomeration if not rejected ---*/
if (agglomerate_seed && !euler_wall_rejected_here) {
euler_wall_agglomerated[copy_marker[i]]++;
}
}
}
}
/*--- If there are more than 2 markers, the aglomeration will be discarded ---*/
if (counter > 2) agglomerate_seed = false;
/*--- If the seed (parent) can be agglomerated, we try to agglomerate connected childs to the parent ---*/
/*--- Note that in 2D we allow a maximum of 4 nodes to be agglomerated ---*/
if (agglomerate_seed) {
/*--- Now we do a sweep over all the nodes that surround the seed point ---*/
for (auto CVPoint : fine_grid->nodes->GetPoints(iPoint)) {
/*--- The new point can be agglomerated ---*/
if (SetBoundAgglomeration(CVPoint, marker_seed, fine_grid, config)) {
/*--- We set the value of the parent ---*/
fine_grid->nodes->SetParent_CV(CVPoint, Index_CoarseCV);
/*--- We set the value of the child ---*/
nodes->SetChildren_CV(Index_CoarseCV, nChildren, CVPoint);
nChildren++;
/*--- In 2D, we agglomerate exactly 2 nodes if the nodes are on the line edge. ---*/
if ((nDim == 2) && (counter == 1)) break;
/*--- In 3D, we agglomerate exactly 2 nodes if the nodes are on the surface edge. ---*/
if ((nDim == 3) && (counter == 2)) break;
/*--- Apply maxAgglomSize limit for 3D internal boundary face nodes (counter==1 in 3D). ---*/
if (nChildren == maxAgglomSize) break;
}
}
/*--- Only take into account indirect neighbors for 3D faces, not 2D. ---*/
if (nDim == 3) {
Suitable_Indirect_Neighbors.clear();
if (fine_grid->nodes->GetAgglomerate_Indirect(iPoint))
SetSuitableNeighbors(Suitable_Indirect_Neighbors, iPoint, Index_CoarseCV, fine_grid);
/*--- Now we do a sweep over all the indirect nodes that can be added ---*/
for (auto CVPoint : Suitable_Indirect_Neighbors) {
/*--- The new point can be agglomerated ---*/
if (SetBoundAgglomeration(CVPoint, marker_seed, fine_grid, config)) {
/*--- We set the value of the parent ---*/
fine_grid->nodes->SetParent_CV(CVPoint, Index_CoarseCV);
/*--- We set the indirect agglomeration information of the corse point
based on its children in the fine grid. ---*/
if (fine_grid->nodes->GetAgglomerate_Indirect(CVPoint))
nodes->SetAgglomerate_Indirect(Index_CoarseCV, true);
/*--- We set the value of the child ---*/
nodes->SetChildren_CV(Index_CoarseCV, nChildren, CVPoint);
nChildren++;
/*--- Apply maxAgglomSize limit for 3D internal boundary face nodes. ---*/
if (nChildren == maxAgglomSize) break;
}
}
}
}
/*--- Update the number of children of the coarse control volume. ---*/
nodes->SetnChildren_CV(Index_CoarseCV, nChildren);
Index_CoarseCV++;
}
}
}
/*--- Do not agglomerate any leftover node with more than one physical boundary condition,
i.e. make one coarse CV with a single child. ---*/
for (auto iMarker = 0u; iMarker < fine_grid->GetnMarker(); iMarker++) {
for (auto iVertex = 0ul; iVertex < fine_grid->GetnVertex(iMarker); iVertex++) {
const auto iPoint = fine_grid->vertex[iMarker][iVertex]->GetNode();
if ((!fine_grid->nodes->GetAgglomerate(iPoint)) && (fine_grid->nodes->GetDomain(iPoint))) {
fine_grid->nodes->SetParent_CV(iPoint, Index_CoarseCV);
nodes->SetChildren_CV(Index_CoarseCV, 0, iPoint);
nodes->SetnChildren_CV(Index_CoarseCV, 1);
Index_CoarseCV++;
}
}
}
/*--- Update the queue with the results from the boundary agglomeration ---*/
for (auto iPoint = 0ul; iPoint < fine_grid->GetnPoint(); iPoint++) {
if (fine_grid->nodes->GetAgglomerate(iPoint)) {
MGQueue_InnerCV.RemoveCV(iPoint);
} else {
/*--- Count the number of agglomerated neighbors, and modify the queue,
Points with more agglomerated neighbors are processed first. ---*/
short priority = 0;
for (auto jPoint : fine_grid->nodes->GetPoints(iPoint)) {
priority += fine_grid->nodes->GetAgglomerate(jPoint);
}
MGQueue_InnerCV.MoveCV(iPoint, priority);
}
}
/*--- STEP 2: Agglomerate the domain points. ---*/
auto iteration = 0ul;
while (!MGQueue_InnerCV.EmptyQueue() && (iteration < fine_grid->GetnPoint())) {
const auto iPoint = MGQueue_InnerCV.NextCV();
iteration++;
/*--- If the element has not been previously agglomerated, belongs to the physical domain,
and satisfies several geometrical criteria then the seed CV is accepted for agglomeration. ---*/
if ((!fine_grid->nodes->GetAgglomerate(iPoint)) && (fine_grid->nodes->GetDomain(iPoint)) &&
(GeometricalCheck(iPoint, fine_grid, config))) {
unsigned short nChildren = 1;
/*--- We set an index for the parent control volume ---*/
fine_grid->nodes->SetParent_CV(iPoint, Index_CoarseCV);
/*--- We add the seed point (child) to the parent control volume ---*/
nodes->SetChildren_CV(Index_CoarseCV, 0, iPoint);
/*--- Update the queue with the seed point (remove the seed and
increase the priority of its neighbors) ---*/
MGQueue_InnerCV.Update(iPoint, fine_grid);
/*--- Now we do a sweep over all the nodes that surround the seed point ---*/
for (auto CVPoint : fine_grid->nodes->GetPoints(iPoint)) {
/*--- Determine if the CVPoint can be agglomerated ---*/
if ((!fine_grid->nodes->GetAgglomerate(CVPoint)) && (fine_grid->nodes->GetDomain(CVPoint)) &&
(GeometricalCheck(CVPoint, fine_grid, config))) {
/*--- We set the value of the parent ---*/
fine_grid->nodes->SetParent_CV(CVPoint, Index_CoarseCV);
/*--- We set the value of the child ---*/
nodes->SetChildren_CV(Index_CoarseCV, nChildren, CVPoint);
nChildren++;
/*--- Update the queue with the new control volume (remove the CV and
increase the priority of its neighbors) ---*/
MGQueue_InnerCV.Update(CVPoint, fine_grid);
}
if (nChildren == maxAgglomSize) break;
}
/*--- Identify the indirect neighbors ---*/
Suitable_Indirect_Neighbors.clear();
if (fine_grid->nodes->GetAgglomerate_Indirect(iPoint))
SetSuitableNeighbors(Suitable_Indirect_Neighbors, iPoint, Index_CoarseCV, fine_grid);
/*--- Now we do a sweep over all the indirect nodes that can be added ---*/
for (auto CVPoint : Suitable_Indirect_Neighbors) {
// if we have reached the maximum, get out.
if (nChildren == maxAgglomSize) break;
/*--- The new point can be agglomerated ---*/
if ((!fine_grid->nodes->GetAgglomerate(CVPoint)) && (fine_grid->nodes->GetDomain(CVPoint))) {
/*--- We set the value of the parent ---*/
fine_grid->nodes->SetParent_CV(CVPoint, Index_CoarseCV);
/*--- We set the indirect agglomeration information ---*/
if (fine_grid->nodes->GetAgglomerate_Indirect(CVPoint)) nodes->SetAgglomerate_Indirect(Index_CoarseCV, true);
/*--- We set the value of the child ---*/
nodes->SetChildren_CV(Index_CoarseCV, nChildren, CVPoint);
nChildren++;
/*--- Update the queue with the new control volume (remove the CV and
increase the priority of the neighbors) ---*/
MGQueue_InnerCV.Update(CVPoint, fine_grid);
}
}
/*--- Update the number of control of childrens ---*/
nodes->SetnChildren_CV(Index_CoarseCV, nChildren);
Index_CoarseCV++;
} else {
/*--- The seed point can not be agglomerated because of size, domain, streching, etc.
move the point to the lowest priority ---*/
MGQueue_InnerCV.MoveCV(iPoint, -1);
}
}
/*--- Convert any point that was not agglomerated into a coarse point. ---*/
for (auto iPoint = 0ul; iPoint < fine_grid->GetnPoint(); iPoint++) {
if ((!fine_grid->nodes->GetAgglomerate(iPoint)) && (fine_grid->nodes->GetDomain(iPoint))) {
fine_grid->nodes->SetParent_CV(iPoint, Index_CoarseCV);
if (fine_grid->nodes->GetAgglomerate_Indirect(iPoint)) nodes->SetAgglomerate_Indirect(Index_CoarseCV, true);
nodes->SetChildren_CV(Index_CoarseCV, 0, iPoint);
nodes->SetnChildren_CV(Index_CoarseCV, 1);
Index_CoarseCV++;
}
}
nPointDomain = Index_CoarseCV;
nPoint = nPointDomain;
/*--- Check that there are no hanging nodes. Detect isolated points
(only 1 neighbor), and merge their children CV's with the neighbor. ---*/
SetPoint_Connectivity(fine_grid);
for (auto iCoarsePoint = 0ul; iCoarsePoint < nPointDomain; iCoarsePoint++) {
if (nodes->GetnPoint(iCoarsePoint) == 1) {
/*--- Find the neighbor of the isolated point. This neighbor is the right control volume ---*/
const auto iCoarsePoint_Complete = nodes->GetPoint(iCoarsePoint, 0);
/*--- Check if merging would exceed the maximum agglomeration size ---*/
auto nChildren_Target = nodes->GetnChildren_CV(iCoarsePoint_Complete);
auto nChildren_Isolated = nodes->GetnChildren_CV(iCoarsePoint);
auto nChildren_Total = nChildren_Target + nChildren_Isolated;
/*--- If the total would exceed maxAgglomSize, try to redistribute children to neighbors ---*/
if (nChildren_Total > maxAgglomSize) {
/*--- Find neighbors of the target coarse point that have room ---*/
unsigned short nChildrenToRedistribute = nChildren_Total - maxAgglomSize;
for (auto jCoarsePoint : nodes->GetPoints(iCoarsePoint_Complete)) {
if (nChildrenToRedistribute == 0) break;
auto nChildren_Neighbor = nodes->GetnChildren_CV(jCoarsePoint);
if (nChildren_Neighbor < maxAgglomSize) {
unsigned short nCanTransfer =
min(nChildrenToRedistribute, static_cast<unsigned short>(maxAgglomSize - nChildren_Neighbor));
/*--- Transfer children from target to neighbor ---*/
for (unsigned short iTransfer = 0; iTransfer < nCanTransfer; iTransfer++) {
/*--- Take from the end of the target's children list ---*/
auto nChildren_Current = nodes->GetnChildren_CV(iCoarsePoint_Complete);
if (nChildren_Current > 0) {
auto iFinePoint = nodes->GetChildren_CV(iCoarsePoint_Complete, nChildren_Current - 1);
/*--- Add to neighbor ---*/
auto nChildren_Neighbor_Current = nodes->GetnChildren_CV(jCoarsePoint);
nodes->SetChildren_CV(jCoarsePoint, nChildren_Neighbor_Current, iFinePoint);
nodes->SetnChildren_CV(jCoarsePoint, nChildren_Neighbor_Current + 1);
/*--- Update parent ---*/
fine_grid->nodes->SetParent_CV(iFinePoint, jCoarsePoint);
/*--- Remove from target (by reducing count) ---*/
nodes->SetnChildren_CV(iCoarsePoint_Complete, nChildren_Current - 1);
nChildrenToRedistribute--;
}
}
}
}
/*--- Update the target's child count after redistribution ---*/
nChildren_Target = nodes->GetnChildren_CV(iCoarsePoint_Complete);
}
/*--- Add the isolated point's children to the target control volume ---*/
auto nChildren = nChildren_Target;
for (auto iChildren = 0u; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren++) {
const auto iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren);
nodes->SetChildren_CV(iCoarsePoint_Complete, nChildren, iFinePoint);
nChildren++;
fine_grid->nodes->SetParent_CV(iFinePoint, iCoarsePoint_Complete);
}
/*--- Update the number of children control volumes ---*/
nodes->SetnChildren_CV(iCoarsePoint_Complete, nChildren);
nodes->SetnChildren_CV(iCoarsePoint, 0);
}
}
/*--- Reset the neighbor information. ---*/
nodes->ResetPoints();
#ifdef HAVE_MPI
/*--- Reset halo point parents before MPI agglomeration.
When creating level N from level N-1, the fine grid (level N-1)
already has Parent_CV set from when it was created from level N-2.
Those parent indices point to level N, but when creating level N+1, they would be
incorrectly interpreted as level N+1 indices. ---*/
for (auto iPoint = fine_grid->GetnPointDomain(); iPoint < fine_grid->GetnPoint(); iPoint++) {
fine_grid->nodes->SetParent_CV(iPoint, std::numeric_limits<unsigned long>::max());
}
/*--- Dealing with MPI parallelization, the objective is that the received nodes must be agglomerated
in the same way as the donor (send) nodes. Send the node agglomeration information of the donor
(parent and children). The agglomerated halos of this rank are set according to the rank where
they are domain points. ---*/
for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++) {
if ((config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) && (config->GetMarker_All_SendRecv(iMarker) > 0)) {
const auto MarkerS = iMarker; // sending marker
const auto MarkerR = iMarker + 1; // receiving marker
const auto send_to = config->GetMarker_All_SendRecv(MarkerS) - 1;
const auto receive_from = abs(config->GetMarker_All_SendRecv(MarkerR)) - 1;
const auto nVertexS = fine_grid->nVertex[MarkerS];
const auto nVertexR = fine_grid->nVertex[MarkerR];
/*--- Allocate Receive and Send buffers ---*/
vector<unsigned long> Buffer_Receive_Children(nVertexR);
vector<unsigned long> Buffer_Send_Children(nVertexS);
vector<unsigned long> Buffer_Receive_Parent(nVertexR);
vector<unsigned long> Buffer_Send_Parent(nVertexS);
/*--- Copy the information that should be sent, child and parent indices. ---*/
for (auto iVertex = 0ul; iVertex < nVertexS; iVertex++) {
const auto iPoint = fine_grid->vertex[MarkerS][iVertex]->GetNode();
Buffer_Send_Children[iVertex] = iPoint;
Buffer_Send_Parent[iVertex] = fine_grid->nodes->GetParent_CV(iPoint);
}
/*--- Send/Receive information. ---*/
SU2_MPI::Sendrecv(Buffer_Send_Children.data(), nVertexS, MPI_UNSIGNED_LONG, send_to, 0,
Buffer_Receive_Children.data(), nVertexR, MPI_UNSIGNED_LONG, receive_from, 0,
SU2_MPI::GetComm(), MPI_STATUS_IGNORE);
SU2_MPI::Sendrecv(Buffer_Send_Parent.data(), nVertexS, MPI_UNSIGNED_LONG, send_to, 1,
Buffer_Receive_Parent.data(), nVertexR, MPI_UNSIGNED_LONG, receive_from, 1, SU2_MPI::GetComm(),
MPI_STATUS_IGNORE);
/*--- Create a list of the parent nodes without duplicates. ---*/
auto Aux_Parent = Buffer_Receive_Parent;
sort(Aux_Parent.begin(), Aux_Parent.end());
auto it1 = unique(Aux_Parent.begin(), Aux_Parent.end());
Aux_Parent.resize(it1 - Aux_Parent.begin());
/*--- Create the local and remote vector for the parents and children CVs. ---*/
const auto& Parent_Remote = Buffer_Receive_Parent;
vector<unsigned long> Parent_Local(nVertexR);
vector<unsigned long> Children_Local(nVertexR);
/*--- First pass: Determine which parents will actually be used (have non-skipped children).
This prevents creating orphaned halo CVs that have coordinates (0,0,0). ---*/
vector<bool> parent_used(Aux_Parent.size(), false);
vector<unsigned long> parent_local_index(Aux_Parent.size(), std::numeric_limits<unsigned long>::max());
for (auto iVertex = 0ul; iVertex < nVertexR; iVertex++) {
const auto iPoint_Fine = fine_grid->vertex[MarkerR][iVertex]->GetNode();
auto existing_parent = fine_grid->nodes->GetParent_CV(iPoint_Fine);
/*--- Skip if already agglomerated (first-wins policy) ---*/
if (existing_parent != std::numeric_limits<unsigned long>::max()) continue;
/*--- Skip if received parent is invalid (sending rank didn't agglomerate this point) ---*/
if (Parent_Remote[iVertex] == std::numeric_limits<unsigned long>::max()) continue;
/*--- Find which parent this vertex maps to ---*/
for (auto jVertex = 0ul; jVertex < Aux_Parent.size(); jVertex++) {
if (Parent_Remote[iVertex] == Aux_Parent[jVertex]) {
parent_used[jVertex] = true;
break;
}
}
}
/*--- Assign local indices only to used parents ---*/
unsigned long nUsedParents = 0;
for (auto jVertex = 0ul; jVertex < Aux_Parent.size(); jVertex++) {
if (parent_used[jVertex]) {
parent_local_index[jVertex] = Index_CoarseCV + nUsedParents;
nUsedParents++;
}
}
/*--- Now map each received vertex to its local parent ---*/
for (auto iVertex = 0ul; iVertex < nVertexR; iVertex++) {
Parent_Local[iVertex] = std::numeric_limits<unsigned long>::max();
for (auto jVertex = 0ul; jVertex < Aux_Parent.size(); jVertex++) {
if (Parent_Remote[iVertex] == Aux_Parent[jVertex]) {
Parent_Local[iVertex] = parent_local_index[jVertex];
break;
}
}
Children_Local[iVertex] = fine_grid->vertex[MarkerR][iVertex]->GetNode();
}
/*--- Only increment by the number of parents that will actually be used ---*/
Index_CoarseCV += nUsedParents;
/*--- Debug counters ---*/
unsigned long nSkipped = 0, nSuccess = 0;
/*--- Create the final structure ---*/
for (auto iVertex = 0ul; iVertex < nVertexR; iVertex++) {
const auto iPoint_Fine = Children_Local[iVertex];
/*--- Skip if this halo point was already agglomerated (first-wins policy) ---*/
auto existing_parent = fine_grid->nodes->GetParent_CV(iPoint_Fine);
if (existing_parent != std::numeric_limits<unsigned long>::max()) {
nSkipped++;
continue; // First-wins: keep existing assignment
}
/*--- Skip if parent mapping is invalid (sender didn't agglomerate) ---*/
const auto iPoint_Coarse = Parent_Local[iVertex];
if (iPoint_Coarse == std::numeric_limits<unsigned long>::max()) {
nSkipped++;
continue;
}
/*--- Append to existing children, don't overwrite ---*/
auto existing_children_count = nodes->GetnChildren_CV(iPoint_Coarse);
fine_grid->nodes->SetParent_CV(iPoint_Fine, iPoint_Coarse);
nodes->SetChildren_CV(iPoint_Coarse, existing_children_count, iPoint_Fine);
nodes->SetnChildren_CV(iPoint_Coarse, existing_children_count + 1);
nodes->SetDomain(iPoint_Coarse, false);
nSuccess++;
}
}
}
#endif // HAVE_MPI
/*--- Update the number of points after the MPI agglomeration ---*/
nPoint = Index_CoarseCV;
/*--- Console output with the summary of the agglomeration ---*/
unsigned long nPointFine = fine_grid->GetnPointDomain();
unsigned long Global_nPointCoarse, Global_nPointFine;
SU2_MPI::Allreduce(&nPointDomain, &Global_nPointCoarse, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm());
SU2_MPI::Allreduce(&nPointFine, &Global_nPointFine, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm());
SetGlobal_nPointDomain(Global_nPointCoarse);
if (iMesh != MESH_0) {
/*--- Note: CFL at the coarse levels have a large impact on convergence,
this should be rewritten to use adaptive CFL. ---*/
const su2double Coeff = 1.5;
const su2double CFL = config->GetCFL(iMesh - 1) / Coeff;
config->SetCFL(iMesh, CFL);
}
const su2double ratio = su2double(Global_nPointFine) / su2double(Global_nPointCoarse);
cout << "********** ratio = " << ratio << endl;
// lower value leads to more levels being accepted.
if (((nDim == 2) && (ratio < 1.5)) || ((nDim == 3) && (ratio < 1.5))) {
config->SetMGLevels(iMesh - 1);
} else if (rank == MASTER_NODE) {
PrintingToolbox::CTablePrinter MGTable(&std::cout);
MGTable.AddColumn("MG Level", 10);
MGTable.AddColumn("CVs", 10);
MGTable.AddColumn("Aggl. Rate", 10);
MGTable.AddColumn("CFL", 10);
MGTable.SetAlign(PrintingToolbox::CTablePrinter::RIGHT);
if (iMesh == MESH_1) {
MGTable.PrintHeader();
MGTable << iMesh - 1 << Global_nPointFine << "1/1.00" << config->GetCFL(iMesh - 1);
}
stringstream ss;
ss << "1/" << std::setprecision(3) << ratio;
MGTable << iMesh << Global_nPointCoarse << ss.str() << config->GetCFL(iMesh);
if (iMesh == config->GetnMGLevels()) {
MGTable.PrintFooter();
}
}
/*--- Output Euler wall agglomeration statistics ---*/
if (rank == MASTER_NODE) {
/*--- Gather global statistics for Euler walls ---*/
bool has_euler_walls = false;
for (unsigned short iMarker = 0; iMarker < fine_grid->GetnMarker(); iMarker++) {
if (config->GetMarker_All_KindBC(iMarker) == EULER_WALL) {
has_euler_walls = true;
break;
}
}
if (has_euler_walls) {
cout << endl;
cout << "Euler Wall Agglomeration Statistics (45° curvature threshold):" << endl;
cout << "----------------------------------------------------------------" << endl;
for (unsigned short iMarker = 0; iMarker < fine_grid->GetnMarker(); iMarker++) {
if (config->GetMarker_All_KindBC(iMarker) == EULER_WALL) {
string marker_name = config->GetMarker_All_TagBound(iMarker);
unsigned long agglomerated = euler_wall_agglomerated[iMarker];
unsigned long rejected = euler_wall_rejected_curvature[iMarker];
unsigned long total = agglomerated + rejected;
if (total > 0) {
su2double accept_rate = 100.0 * su2double(agglomerated) / su2double(total);
cout << " Marker: " << marker_name << endl;
cout << " Seeds agglomerated: " << agglomerated << " (" << std::setprecision(1) << std::fixed
<< accept_rate << "%)" << endl;
cout << " Seeds rejected (>45° curv): " << rejected << " (" << std::setprecision(1) << std::fixed
<< (100.0 - accept_rate) << "%)" << endl;
}
}
}
cout << "----------------------------------------------------------------" << endl;
}
}
edgeColorGroupSize = config->GetEdgeColoringGroupSize();
}
bool CMultiGridGeometry::GeometricalCheck(unsigned long iPoint, const CGeometry* fine_grid,
const CConfig* config) const {
su2double max_dimension = 1.2;
/*--- Evaluate the total size of the element ---*/
bool Volume = true;
su2double ratio = pow(fine_grid->nodes->GetVolume(iPoint), 1.0 / su2double(nDim)) * max_dimension;
su2double limit = pow(config->GetDomainVolume(), 1.0 / su2double(nDim));
if (ratio > limit) {
Volume = false;
cout << "Volume limit reached!" << endl;
}
return (Volume);
}
bool CMultiGridGeometry::SetBoundAgglomeration(unsigned long CVPoint, vector<short> marker_seed,
const CGeometry* fine_grid, const CConfig* config) const {
bool agglomerate_CV = false;
/*--- Basic condition, the point has not been previously agglomerated, it belongs to the domain,
and has passed some basic geometrical checks. ---*/
if ((!fine_grid->nodes->GetAgglomerate(CVPoint)) && (fine_grid->nodes->GetDomain(CVPoint)) &&
(GeometricalCheck(CVPoint, fine_grid, config))) {
/*--- If the point belongs to a boundary, its type must be compatible with the seed marker. ---*/
int counter = 0;
unsigned short copy_marker[3] = {};
if (fine_grid->nodes->GetBoundary(CVPoint)) {
/*--- Identify the markers of the vertex that we want to agglomerate ---*/
// count number of markers on the agglomeration candidate
for (auto jMarker = 0u; jMarker < fine_grid->GetnMarker() && counter < 3; jMarker++) {
if (fine_grid->nodes->GetVertex(CVPoint, jMarker) != -1) {
copy_marker[counter] = jMarker;
counter++;
}
}
/*--- The basic condition is that the agglomerated vertex must have the same physical marker,
but eventually a send-receive condition ---*/
/*--- Only one marker in the vertex that is going to be agglomerated ---*/
/*--- Valley -> Valley: only if of the same type---*/
if (counter == 1) {
/*--- We agglomerate if there is only one marker and it is the same marker as the seed marker ---*/
// So this is the case when in 2D we are on an edge, and in 3D we are in the interior of a surface.
// note that this should be the same marker id, not just the same marker type.
if ((marker_seed.size() == 1) && (copy_marker[0] == marker_seed[0])) agglomerate_CV = true;
// we also allow agglomeration if the seed has 2 markers, one of them is the same as the candidate, and the
// other is a send-receive marker.
if ((marker_seed.size() == 2) && ((copy_marker[0] == marker_seed[0]) || (copy_marker[0] == marker_seed[1]))) {
// check that the other marker is a send-receive marker
unsigned short other_marker = (copy_marker[0] == marker_seed[0]) ? marker_seed[1] : marker_seed[0];
if (config->GetMarker_All_KindBC(other_marker) == SEND_RECEIVE) {
agglomerate_CV = true;
}
}
}
/*--- If there are two markers in the vertex that is going to be aglomerated ---*/
if (counter == 2) {
/*--- In 2D this is a corner and we do not agglomerate ---*/
if (nDim == 2) {
agglomerate_CV = false;
}
/*--- Both markers have to be the same. ---*/
if (marker_seed.size() == 2) {
if (((copy_marker[0] == marker_seed[0]) && (copy_marker[1] == marker_seed[1])) ||
((copy_marker[0] == marker_seed[1]) && (copy_marker[1] == marker_seed[0]))) {
agglomerate_CV = true;
}
}
}
}
/*--- If the element belongs to the domain, it is never agglomerated with a boundary node. ---*/
else {
agglomerate_CV = false;
}
}
return agglomerate_CV;
}
/*--- ---*/
void CMultiGridGeometry::SetSuitableNeighbors(vector<unsigned long>& Suitable_Indirect_Neighbors, unsigned long iPoint,
unsigned long Index_CoarseCV, const CGeometry* fine_grid) const {
/*--- Create a list with the first neighbors, including the seed. ---*/
vector<unsigned long> First_Neighbor_Points;
First_Neighbor_Points.push_back(iPoint);
for (auto jPoint : fine_grid->nodes->GetPoints(iPoint)) First_Neighbor_Points.push_back(jPoint);
/*--- Create a list with the second neighbors, without first, and seed neighbors. ---*/
vector<unsigned long> Second_Neighbor_Points, Second_Origin_Points, Suitable_Second_Neighbors;
for (auto jPoint : fine_grid->nodes->GetPoints(iPoint)) {
for (auto kPoint : fine_grid->nodes->GetPoints(jPoint)) {
/*--- Check that the second neighbor does not belong to the first neighbors or the seed. ---*/
auto end = First_Neighbor_Points.end();
if (find(First_Neighbor_Points.begin(), end, kPoint) == end) {
Second_Neighbor_Points.push_back(kPoint); // neighbor of a neighbor, not connected to original ipoint
Second_Origin_Points.push_back(jPoint); // the neighbor that is connected to ipoint
}
}
}
/*--- Identify those second neighbors that are repeated (candidates to be added).
For a mesh of quads this produces a 9-point stencil from the 5-point of direct
neighbors, and for hexs it produces a 27-point stencil. ---*/
for (auto iNeighbor = 0ul; iNeighbor < Second_Neighbor_Points.size(); iNeighbor++) {
for (auto jNeighbor = iNeighbor + 1; jNeighbor < Second_Neighbor_Points.size(); jNeighbor++) {
/*--- Repeated second neighbor with different origin ---*/
if ((Second_Neighbor_Points[iNeighbor] == Second_Neighbor_Points[jNeighbor]) &&
(Second_Origin_Points[iNeighbor] != Second_Origin_Points[jNeighbor])) {
Suitable_Indirect_Neighbors.push_back(Second_Neighbor_Points[iNeighbor]);
/*--- Create a list of suitable second neighbors, that we will use
to compute the third neighbors. --*/
Suitable_Second_Neighbors.push_back(Second_Neighbor_Points[iNeighbor]);
}
}
}
/*--- Remove duplicates ---*/
sort(Suitable_Second_Neighbors.begin(), Suitable_Second_Neighbors.end());
auto it1 = unique(Suitable_Second_Neighbors.begin(), Suitable_Second_Neighbors.end());
Suitable_Second_Neighbors.resize(it1 - Suitable_Second_Neighbors.begin());
}
void CMultiGridGeometry::SetPoint_Connectivity(const CGeometry* fine_grid) {
/*--- Temporary, CPoint (nodes) then compresses this structure. ---*/
vector<vector<unsigned long>> points(nPoint);
for (auto iCoarsePoint = 0ul; iCoarsePoint < nPoint; iCoarsePoint++) {
/*--- For each child CV (of the fine grid), ---*/
for (auto iChildren = 0u; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren++) {
const auto iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren);
/*--- loop over the parent CVs (coarse grid) of its (fine) neighbors. ---*/
for (auto iFinePoint_Neighbor : fine_grid->nodes->GetPoints(iFinePoint)) {
const auto iParent = fine_grid->nodes->GetParent_CV(iFinePoint_Neighbor);
/*--- If it is not the target coarse point, it is a coarse neighbor. ---*/
if (iParent != iCoarsePoint) {
/*--- Avoid duplicates. ---*/
auto End = points[iCoarsePoint].end();
if (find(points[iCoarsePoint].begin(), End, iParent) == End) points[iCoarsePoint].push_back(iParent);
}
}
}
/*--- Set the number of neighbors variable, this is
important for JST and multigrid in parallel ---*/
nodes->SetnNeighbor(iCoarsePoint, points[iCoarsePoint].size());
}
nodes->SetPoints(points);
}
void CMultiGridGeometry::SetVertex(const CGeometry* fine_grid, const CConfig* config) {
nMarker = fine_grid->GetnMarker();
unsigned short nMarker_Max = config->GetnMarker_Max();
/*--- If any children node belong to the boundary then the entire control
volume will belong to the boundary ---*/
for (auto iCoarsePoint = 0ul; iCoarsePoint < nPoint; iCoarsePoint++)
for (auto iChildren = 0u; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren++) {
auto iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren);
if (fine_grid->nodes->GetBoundary(iFinePoint)) {
nodes->SetBoundary(iCoarsePoint, nMarker);
break;
}
}
vertex = new CVertex**[nMarker];
nVertex = new unsigned long[nMarker];
Tag_to_Marker = new string[nMarker_Max];
for (auto iMarker_Tag = 0u; iMarker_Tag < nMarker_Max; iMarker_Tag++)
Tag_to_Marker[iMarker_Tag] = fine_grid->GetMarker_Tag(iMarker_Tag);
/*--- Compute the number of vertices to do the dimensionalization ---*/
for (auto iMarker = 0u; iMarker < nMarker; iMarker++) nVertex[iMarker] = 0;
for (auto iCoarsePoint = 0ul; iCoarsePoint < nPoint; iCoarsePoint++) {
if (nodes->GetBoundary(iCoarsePoint)) {
for (auto iChildren = 0u; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren++) {
auto iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren);
for (auto iMarker = 0u; iMarker < nMarker; iMarker++) {
if ((fine_grid->nodes->GetVertex(iFinePoint, iMarker) != -1) &&
(nodes->GetVertex(iCoarsePoint, iMarker) == -1)) {
auto iVertex = nVertex[iMarker];
nodes->SetVertex(iCoarsePoint, iVertex, iMarker);
nVertex[iMarker]++;
}
}
}
}
}
for (auto iMarker = 0u; iMarker < nMarker; iMarker++) {
vertex[iMarker] = new CVertex*[fine_grid->GetnVertex(iMarker) + 1];
nVertex[iMarker] = 0;
}
for (auto iCoarsePoint = 0ul; iCoarsePoint < nPoint; iCoarsePoint++)
if (nodes->GetBoundary(iCoarsePoint))
for (auto iMarker = 0u; iMarker < nMarker; iMarker++) nodes->SetVertex(iCoarsePoint, -1, iMarker);
for (auto iMarker = 0u; iMarker < nMarker; iMarker++) nVertex[iMarker] = 0;
for (auto iCoarsePoint = 0ul; iCoarsePoint < nPoint; iCoarsePoint++) {
if (nodes->GetBoundary(iCoarsePoint)) {
for (auto iChildren = 0u; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren++) {
auto iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren);
for (auto iMarker = 0u; iMarker < fine_grid->GetnMarker(); iMarker++) {
if ((fine_grid->nodes->GetVertex(iFinePoint, iMarker) != -1) &&
(nodes->GetVertex(iCoarsePoint, iMarker) == -1)) {
auto iVertex = nVertex[iMarker];
vertex[iMarker][iVertex] = new CVertex(iCoarsePoint, nDim);
nodes->SetVertex(iCoarsePoint, iVertex, iMarker);
/*--- Set the transformation to apply ---*/
unsigned long ChildVertex = fine_grid->nodes->GetVertex(iFinePoint, iMarker);
unsigned short RotationKind = fine_grid->vertex[iMarker][ChildVertex]->GetRotation_Type();
vertex[iMarker][iVertex]->SetRotation_Type(RotationKind);
nVertex[iMarker]++;
}
}
}
}
}
}
void CMultiGridGeometry::MatchActuator_Disk(const CConfig* config) {
int iProcessor = size;
for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++) {
if ((config->GetMarker_All_KindBC(iMarker) == ACTDISK_INLET) ||
(config->GetMarker_All_KindBC(iMarker) == ACTDISK_OUTLET)) {
for (auto iVertex = 0u; iVertex < nVertex[iMarker]; iVertex++) {
auto iPoint = vertex[iMarker][iVertex]->GetNode();
if (nodes->GetDomain(iPoint)) {
vertex[iMarker][iVertex]->SetDonorPoint(iPoint, nodes->GetGlobalIndex(iPoint), iVertex, iMarker, iProcessor);
}
}
}
}
}
void CMultiGridGeometry::MatchPeriodic(const CConfig* config, unsigned short val_periodic) {
int iProcessor = rank;
/*--- Evaluate the number of periodic boundary conditions ---*/