@@ -4482,7 +4482,7 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig* config) {
44824482 * which is equivalent to incrementing an integer marking the end of the
44834483 * result and the start of the queue. ---*/
44844484 vector<char > InQueue (nPoint, false );
4485- vector<unsigned long > AuxQueue, Result;
4485+ vector<unsigned long > Result;
44864486 Result.reserve (nPoint);
44874487 unsigned long QueueStart = 0 ;
44884488
@@ -4521,21 +4521,19 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig* config) {
45214521
45224522 /* --- Add all adjacent nodes to the queue in increasing order of their
45234523 degree, checking if the element is already in the queue. ---*/
4524- AuxQueue. clear ();
4524+ auto currEnd = Result. end ();
45254525 for (auto iNode = 0u ; iNode < nodes->GetnPoint (AddPoint); iNode++) {
45264526 const auto AdjPoint = nodes->GetPoint (AddPoint, iNode);
45274527 if (!InQueue[AdjPoint]) {
4528- AuxQueue .push_back (AdjPoint);
4528+ Result .push_back (AdjPoint);
45294529 InQueue[AdjPoint] = true ;
45304530 }
45314531 }
4532- if (AuxQueue.empty ()) continue ;
45334532
4534- /* --- Sort the auxiliar queue based on the number of neighbors (degree). ---*/
4535- stable_sort (AuxQueue. begin (), AuxQueue .end (), [&](unsigned long iPoint, unsigned long jPoint) {
4533+ /* --- Sort the new points based on the number of neighbors (degree). ---*/
4534+ stable_sort (currEnd, Result .end (), [&](unsigned long iPoint, unsigned long jPoint) {
45364535 return nodes->GetnPoint (iPoint) < nodes->GetnPoint (jPoint);
45374536 });
4538- Result.insert (Result.end (), AuxQueue.begin (), AuxQueue.end ());
45394537 }
45404538 }
45414539 reverse (Result.begin (), Result.end ());
0 commit comments