Skip to content

Commit ab6e2b2

Browse files
committed
deprecate CONV_CRITERIA
1 parent 377562e commit ab6e2b2

2 files changed

Lines changed: 38 additions & 48 deletions

File tree

Common/src/CConfig.cpp

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,8 +1785,6 @@ void CConfig::SetConfig_Options() {
17851785
/*!\par CONFIG_CATEGORY: Convergence\ingroup Config*/
17861786
/*--- Options related to convergence ---*/
17871787

1788-
// This option is deprecated. After a grace period until 7.2.0 the usage warning should become an error.
1789-
addStringOption("CONV_CRITERIA", ConvCriteria, "this option is deprecated");
17901788
/*!\brief CONV_RESIDUAL_MINVAL\n DESCRIPTION: Min value of the residual (log10 of the residual)\n DEFAULT: -14.0 \ingroup Config*/
17911789
addDoubleOption("CONV_RESIDUAL_MINVAL", MinLogResidual, -14.0);
17921790
/*!\brief CONV_STARTITER\n DESCRIPTION: Iteration number to begin convergence monitoring\n DEFAULT: 5 \ingroup Config*/
@@ -2966,19 +2964,18 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){
29662964
newString.append("UNST_RESTART_ITER is deprecated. Use RESTART_ITER instead.\n\n");
29672965
else if (!option_name.compare("DYN_RESTART_ITER"))
29682966
newString.append("DYN_RESTART_ITER is deprecated. Use RESTART_ITER instead.\n\n");
2969-
// This option is deprecated. After a grace period until 7.2.0 the usage warning should become an error.
2970-
/*else if (!option_name.compare("CONV_CRITERIA"))
2971-
newString.append(string("CONV_CRITERIA is deprecated. SU2 will choose the criteria automatically based on the CONV_FIELD.\n") +
2972-
string("RESIDUAL for any RMS_* BGS_* value. CAUCHY for coefficients like DRAG etc.\n\n"));*/
2973-
if (!option_name.compare("THERMAL_DIFFUSIVITY"))
2967+
else if (!option_name.compare("CONV_CRITERIA"))
2968+
newString.append("CONV_CRITERIA is deprecated. SU2 will choose the criteria automatically based on the CONV_FIELD.\n"
2969+
"RESIDUAL for any RMS_* BGS_* value. CAUCHY for coefficients like DRAG etc.\n\n");
2970+
else if (!option_name.compare("THERMAL_DIFFUSIVITY"))
29742971
newString.append("THERMAL_DIFFUSIVITY is deprecated. See the INC_ENERGY_EQUATION options instead.\n\n");
2975-
if (!option_name.compare("THERMAL_DIFFUSIVITY_SOLID"))
2972+
else if (!option_name.compare("THERMAL_DIFFUSIVITY_SOLID"))
29762973
newString.append("THERMAL_DIFFUSIVITY_SOLID is deprecated. Set THERMAL_CONDUCTIVITY_CONSTANT, MATERIAL_DENSITY and SPECIFIC_HEAT_CP instead.\n\n");
2977-
if (!option_name.compare("SOLID_THERMAL_CONDUCTIVITY"))
2974+
else if (!option_name.compare("SOLID_THERMAL_CONDUCTIVITY"))
29782975
newString.append("SOLID_THERMAL_CONDUCTIVITY is deprecated. Use THERMAL_CONDUCTIVITY_CONSTANT instead.\n\n");
2979-
if (!option_name.compare("SOLID_DENSITY"))
2976+
else if (!option_name.compare("SOLID_DENSITY"))
29802977
newString.append("SOLID_DENSITY is deprecated. Use MATERIAL_DENSITY instead.\n\n");
2981-
if (!option_name.compare("SOLID_TEMPERATURE_INIT"))
2978+
else if (!option_name.compare("SOLID_TEMPERATURE_INIT"))
29822979
newString.append("SOLID_TEMPERATURE_INIT is deprecated. Use FREESTREAM_TEMPERATURE instead.\n\n");
29832980
else {
29842981
/*--- Find the most likely candidate for the unrecognized option, based on the length
@@ -5233,11 +5230,6 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
52335230

52345231
} // species transport checks
52355232

5236-
// This option is deprecated. After a grace period until 7.2.0 the usage warning should become an error.
5237-
if(OptionIsSet("CONV_CRITERIA") && rank == MASTER_NODE) {
5238-
cout << "\n\nWARNING: CONV_CRITERIA is deprecated. SU2 will choose the criteria automatically based on the CONV_FIELD.\n"
5239-
"That is, RESIDUAL for any RMS_* BGS_* value, and CAUCHY for coefficients such as DRAG etc.\n" << endl;
5240-
}
52415233
}
52425234

52435235
void CConfig::SetMarkers(SU2_COMPONENT val_software) {

Common/src/geometry/CPhysicalGeometry.cpp

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4752,20 +4752,30 @@ void CPhysicalGeometry::SetPoint_Connectivity() {
47524752

47534753
void CPhysicalGeometry::SetRCM_Ordering(CConfig *config) {
47544754

4755-
queue<unsigned long> Queue;
4756-
vector<char> inQueue(nPoint, false);
4755+
/*--- The result is the RCM ordering, during the process it is also used as
4756+
* the queue of new points considered by the algorithm. This is possible
4757+
* because points move from the front of the queue to the back of the result,
4758+
* which is equivalent to incrementing an integer marking the end of the
4759+
* result and the start of the queue. ---*/
4760+
vector<char> InQueue(nPoint, false);
47574761
vector<unsigned long> AuxQueue, Result;
47584762
Result.reserve(nPoint);
4763+
unsigned long QueueStart = 0;
47594764

4765+
/*--- Exclude halo nodes from the ordering process. ---*/
4766+
for (auto iPoint = nPointDomain; iPoint < nPoint; iPoint++) {
4767+
InQueue[iPoint] = true;
4768+
}
4769+
4770+
/*--- Repeat as many times as necessary to handle disconnected graphs. ---*/
47604771
while (Result.size() < nPointDomain) {
47614772

47624773
/*--- Select the node with the lowest degree in the grid. ---*/
4763-
47644774
auto AddPoint = nPoint;
47654775
auto MinDegree = std::numeric_limits<unsigned short>::max();
47664776
for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) {
47674777
auto Degree = nodes->GetnPoint(iPoint);
4768-
if (!inQueue[iPoint] && Degree < MinDegree) {
4778+
if (!InQueue[iPoint] && Degree < MinDegree) {
47694779
MinDegree = Degree;
47704780
AddPoint = iPoint;
47714781
}
@@ -4775,59 +4785,47 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig *config) {
47754785
}
47764786

47774787
/*--- Seed the queue with the minimum degree node. ---*/
4788+
Result.push_back(AddPoint);
4789+
InQueue[AddPoint] = true;
47784790

4779-
Queue.push(AddPoint);
4780-
inQueue[AddPoint] = true;
4781-
4782-
/*--- Loop until reorganizing all the nodes. ---*/
4791+
/*--- Loop until reorganizing all nodes connected to AddPoint. This will
4792+
* also terminate early once the ordering + queue include all points. ---*/
4793+
while (QueueStart < Result.size() && Result.size() < nPointDomain) {
47834794

4784-
while (!Queue.empty()) {
4785-
4786-
/*--- Extract the first node from the queue and add it to the order. ---*/
4787-
4788-
AddPoint = Queue.front();
4789-
Result.push_back(AddPoint);
4790-
Queue.pop();
4795+
/*--- Move the start of the queue, equivalent to taking from the front of
4796+
* the queue and inserting at the end of the result. ---*/
4797+
AddPoint = Result[QueueStart];
4798+
++QueueStart;
47914799

47924800
/*--- Add all adjacent nodes to the queue in increasing order of their
47934801
degree, checking if the element is already in the queue. ---*/
4794-
47954802
AuxQueue.clear();
47964803
for (auto iNode = 0u; iNode < nodes->GetnPoint(AddPoint); iNode++) {
4797-
auto AdjPoint = nodes->GetPoint(AddPoint, iNode);
4798-
if (!inQueue[AdjPoint] && (AdjPoint < nPointDomain)) {
4804+
const auto AdjPoint = nodes->GetPoint(AddPoint, iNode);
4805+
if (!InQueue[AdjPoint]) {
47994806
AuxQueue.push_back(AdjPoint);
4807+
InQueue[AdjPoint] = true;
48004808
}
48014809
}
48024810
if (AuxQueue.empty()) continue;
48034811

48044812
/*--- Sort the auxiliar queue based on the number of neighbors (degree). ---*/
4805-
48064813
stable_sort(AuxQueue.begin(), AuxQueue.end(),
48074814
[&](unsigned long iPoint, unsigned long jPoint) {
48084815
return nodes->GetnPoint(iPoint) < nodes->GetnPoint(jPoint);
48094816
}
48104817
);
4811-
4812-
for (auto iPoint : AuxQueue) {
4813-
Queue.push(iPoint);
4814-
inQueue[iPoint] = true;
4815-
}
4818+
Result.insert(Result.end(), AuxQueue.begin(), AuxQueue.end());
48164819
}
48174820
}
4821+
reverse(Result.begin(), Result.end());
48184822

48194823
/*--- Check that all the points have been added ---*/
4820-
4821-
for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) {
4822-
if (!inQueue[iPoint]) {
4823-
SU2_MPI::Error("RCM ordering failed", CURRENT_FUNCTION);
4824-
}
4824+
for (const auto status : InQueue) {
4825+
if (!status) SU2_MPI::Error("RCM ordering failed", CURRENT_FUNCTION);
48254826
}
48264827

4827-
reverse(Result.begin(), Result.end());
4828-
48294828
/*--- Add the MPI points ---*/
4830-
48314829
for (auto iPoint = nPointDomain; iPoint < nPoint; iPoint++) {
48324830
Result.push_back(iPoint);
48334831
}

0 commit comments

Comments
 (0)