Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solver doesn't report redundancy correctly #6174

Closed
FreeCAD-Bug-Importer opened this issue Feb 7, 2022 · 3 comments · Fixed by #9462
Closed

Solver doesn't report redundancy correctly #6174

FreeCAD-Bug-Importer opened this issue Feb 7, 2022 · 3 comments · Fixed by #9462
Assignees
Labels
Bug This issue or PR is related to a bug WB Sketcher Related to the Sketcher Workbench

Comments

@FreeCAD-Bug-Importer
Copy link
Collaborator

FreeCAD-Bug-Importer commented Feb 7, 2022

Issue imported from https://tracker.freecad.org/view.php?id=4591

  • Reporter: @PLChris
  • Date submitted: 3/9/2021
  • FreeCAD version: 0.19
  • Category: Bug
  • Status: assigned
  • Tags:

Original report text

When multiple redundancies exist, the solver reports only partially redundant constraints and not fully redundant ones.
Forum Discussion

FreeCAD Info

OS: macOS 10.15
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 (Git)
Build type: Release
Branch: master
Hash: b2ca86d8d72b636011a73394bf9bcdedb3b109b7
Python version: 3.8.8
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)

Other bug information

  • Priority: normal
  • Severity: minor
  • Category: Bug
  • Updated: 3/9/2021
@FreeCAD-Bug-Importer FreeCAD-Bug-Importer added WB Sketcher Related to the Sketcher Workbench Bug This issue or PR is related to a bug labels Feb 7, 2022
@luzpaz
Copy link
Contributor

luzpaz commented Apr 15, 2023

@AjinkyaDahale is this ticket still relevant ?

@AjinkyaDahale
Copy link
Contributor

@AjinkyaDahale is this ticket still relevant ?

It might be. In the example given, we could easily delete the redundant constraint without gaining DoF's. If this is still expected there should be a documentation of what "partially redundant" means.

@abdullahtahiriyo
Copy link
Contributor

The issue persists.

If a constraint is fully redundant should not be presented as partially redundant.

Output with current master:
16:01:11  EigenSparseQR, Threads: 1, Vectorization: On, Pivot Threshold: 1e-13, Params: 44, Constr: 46, Rank: 44
16:01:11  Analysing groups of constraints of special interest:
[1 7 7 0 0 0 0 ]
[10 2 2 8 8 9 9 10 7 7 0 0 0 0 0 0 0 0 ]
16:01:11  Chosen redundants: [7 ]
16:01:11  DL: tolg: 1e-80, tolx: 1e-80, tolf: 1e-10, convergence: 1e-10, dogLegGaussStep: FullPivLU, xsize: 44, csize: 45, maxIter: 105
16:01:11  DL: stopcode: 1, Success
16:01:11  Sketcher::RedundantSolving-DogLeg-
16:01:11  Sketcher Redundant solving: 1 redundants
16:01:11  (Partially) Redundant, Group 1, index 9, Tag: 7
16:01:11  (Partially) Redundant, Group 0, index 2, Tag: 7
16:01:11  Sketcher::setUpSketch()-T:0.008

abdullahtahiriyo added a commit to abdullahtahiriyo/FreeCAD_sf_master that referenced this issue May 2, 2023
==========================================

fixes FreeCAD#6174

Problem
=======

The popularity contest heuristic was designed to assume that removing one solver constraint from a redundant group would potentially satisfy it.

This means that for sketcher constraints comprising several solver constraints, the sketcher constraint would never be notified as redundant, but
always partially redundant (where the case may be that it is redundant or that it is partially redundant). This happens because after removing one
solver constraint, it may happen:

(a) that no other solver constraint corresponding to the sketcher constraint remains in the redundant group (so it is indeed partially redundant)
(b) that at least one other solver constraint corresponding to the sketcher constraint remains in the redundant group (so if all solver constraints
remain in the redundant group, the sketcher constraint is actually redundant). This happens because solver constraints of a single sketcher constraint
are orthogonal and consequently, a conflict (or redundancy) emanating from removing one of them cannot actually satisfy the group, as it has no effect
on the other.

Solution
========

When popularity constraint decides on one solver constraint, remove any other solver constraint of the same tag (i.e. same sketcher constraint) that is
present in the conflict group (case b). This does not affect case a, because the solver constraint that is not redundant is not present in the conflict
(redundancy) group.
abdullahtahiriyo added a commit that referenced this issue May 3, 2023
==========================================

fixes #6174

Problem
=======

The popularity contest heuristic was designed to assume that removing one solver constraint from a redundant group would potentially satisfy it.

This means that for sketcher constraints comprising several solver constraints, the sketcher constraint would never be notified as redundant, but
always partially redundant (where the case may be that it is redundant or that it is partially redundant). This happens because after removing one
solver constraint, it may happen:

(a) that no other solver constraint corresponding to the sketcher constraint remains in the redundant group (so it is indeed partially redundant)
(b) that at least one other solver constraint corresponding to the sketcher constraint remains in the redundant group (so if all solver constraints
remain in the redundant group, the sketcher constraint is actually redundant). This happens because solver constraints of a single sketcher constraint
are orthogonal and consequently, a conflict (or redundancy) emanating from removing one of them cannot actually satisfy the group, as it has no effect
on the other.

Solution
========

When popularity constraint decides on one solver constraint, remove any other solver constraint of the same tag (i.e. same sketcher constraint) that is
present in the conflict group (case b). This does not affect case a, because the solver constraint that is not redundant is not present in the conflict
(redundancy) group.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This issue or PR is related to a bug WB Sketcher Related to the Sketcher Workbench
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants