change the loop pattern when there are PLC errors

That gave a direct improvement for the four PLC error case from Thingi:

```
            name status       time     error new status   new time new error
Thingi10K_104400 FAILED   1.710520 PLC_error     FAILED   1.243950 PLC_error
Thingi10K_162100 FAILED   1.970900 PLC_error     passed   1.018690
Thingi10K_285604 FAILED  13.096400 PLC_error     FAILED   4.543940 PLC_error
Thingi10K_464846 FAILED 321.774000 PLC_error     FAILED  16.658500 PLC_error
```

One case `Thingi10K_162100` passed. And the other three got runtime
improvement before they reach the error.
This commit is contained in:
Laurent Rineau 2024-01-05 16:46:50 +01:00
parent 06288f3f04
commit de6c5f2895
1 changed files with 11 additions and 1 deletions

View File

@ -2199,6 +2199,7 @@ public:
cdt_2_are_initialized = true; cdt_2_are_initialized = true;
const auto npos = face_constraint_misses_subfaces.npos; const auto npos = face_constraint_misses_subfaces.npos;
auto i = face_constraint_misses_subfaces.find_first(); auto i = face_constraint_misses_subfaces.find_first();
bool the_process_made_progress = false;
while(i != npos) { while(i != npos) {
try { try {
if(restore_face(i)) { if(restore_face(i)) {
@ -2207,6 +2208,7 @@ public:
std::cerr << "restore_face(" << i << ") incomplete, back to conforming...\n"; std::cerr << "restore_face(" << i << ") incomplete, back to conforming...\n";
Conforming_Dt::restore_Delaunay(insert_in_conflict_visitor); Conforming_Dt::restore_Delaunay(insert_in_conflict_visitor);
} }
the_process_made_progress = true;
} }
catch(PLC_error& e) { catch(PLC_error& e) {
std::cerr << std::string("ERROR: PLC error with face #F") << std::to_string(e.face_index) + "\n"; std::cerr << std::string("ERROR: PLC error with face #F") << std::to_string(e.face_index) + "\n";
@ -2219,7 +2221,15 @@ public:
std::cerr << "Next face is face #F " << i << '\n'; std::cerr << "Next face is face #F " << i << '\n';
continue; continue;
} }
i = face_constraint_misses_subfaces.find_next(i);
// If we have made progress, we start again from the beginning.
// Otherwise, either we are done, or there was a full loop with
// only PLC errors.
if(i == npos && true == the_process_made_progress) {
i = face_constraint_misses_subfaces.find_first(); i = face_constraint_misses_subfaces.find_first();
the_process_made_progress = false;
}
} }
} }