@@ -3609,8 +3609,7 @@ const su2vector<unsigned long>& CGeometry::GetTransposeSparsePatternMap(Connecti
36093609 return pattern.transposePtr ();
36103610}
36113611
3612- const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring (su2double* efficiency, bool maximizeEdgeColorGroupSize,
3613- bool largeNumberOfColors) {
3612+ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring (su2double* efficiency, bool maximizeEdgeColorGroupSize) {
36143613 /* --- Check for dry run mode with dummy geometry. ---*/
36153614 if (nEdge == 0 ) return edgeColoring;
36163615
@@ -3639,23 +3638,14 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien
36393638 /* --- Color the edges. ---*/
36403639 constexpr bool balanceColors = true ;
36413640
3642- /* --- Lambda to account for different numbers of colors. ---*/
3643- auto getColorSparsePattern = [&](unsigned long edgeColorGroupSize) {
3644- if (largeNumberOfColors) {
3645- return colorSparsePattern<unsigned char , 255 >(pattern, edgeColorGroupSize, balanceColors);
3646- } else {
3647- return colorSparsePattern (pattern, edgeColorGroupSize, balanceColors);
3648- }
3649- };
3650-
36513641 /* --- if requested, find an efficient coloring with maximum color group size (up to edgeColorGroupSize) ---*/
36523642 if (maximizeEdgeColorGroupSize) {
36533643 auto upperEdgeColorGroupSize = edgeColorGroupSize + 1 ; /* upper bound that is deemed too large */
36543644 auto nextEdgeColorGroupSize = edgeColorGroupSize; /* next value that we are going to try */
36553645 auto lowerEdgeColorGroupSize = 1ul ; /* lower bound that is known to work */
36563646
36573647 while (true ) {
3658- auto currentEdgeColoring = getColorSparsePattern (nextEdgeColorGroupSize );
3648+ const auto currentEdgeColoring = colorSparsePattern (pattern, edgeColorGroupSize, balanceColors );
36593649
36603650 /* --- if the coloring fails, reduce the color group size ---*/
36613651 if (currentEdgeColoring.empty ()) {
@@ -3675,7 +3665,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien
36753665 else {
36763666 lowerEdgeColorGroupSize = nextEdgeColorGroupSize;
36773667 }
3678- auto increment = (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2 ;
3668+ const auto increment = (upperEdgeColorGroupSize - lowerEdgeColorGroupSize) / 2 ;
36793669
36803670 nextEdgeColorGroupSize = lowerEdgeColorGroupSize + increment;
36813671
@@ -3687,7 +3677,7 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien
36873677 edgeColorGroupSize = nextEdgeColorGroupSize;
36883678 }
36893679
3690- edgeColoring = getColorSparsePattern ( edgeColorGroupSize);
3680+ edgeColoring = colorSparsePattern (pattern, edgeColorGroupSize, balanceColors );
36913681
36923682 /* --- If the coloring fails use the natural coloring. This is a
36933683 * "soft" failure as this "bad" coloring should be detected
0 commit comments