Report the number of degrees of freedom for each group.
[git-p4: depot-paths = "//depot/solvespace/": change = 1834]solver
parent
cdeeb67d83
commit
6269d702fb
|
@ -476,6 +476,7 @@ void GraphicsWindow::MenuEdit(int id) {
|
||||||
case MNU_REGEN_ALL:
|
case MNU_REGEN_ALL:
|
||||||
SS.ReloadAllImported();
|
SS.ReloadAllImported();
|
||||||
SS.GenerateAll(0, INT_MAX);
|
SS.GenerateAll(0, INT_MAX);
|
||||||
|
SS.later.showTW = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default: oops();
|
default: oops();
|
||||||
|
|
1
sketch.h
1
sketch.h
|
@ -104,6 +104,7 @@ public:
|
||||||
static const int SINGULAR_JACOBIAN = 11;
|
static const int SINGULAR_JACOBIAN = 11;
|
||||||
struct {
|
struct {
|
||||||
int how;
|
int how;
|
||||||
|
int dof;
|
||||||
SList<hConstraint> remove;
|
SList<hConstraint> remove;
|
||||||
} solved;
|
} solved;
|
||||||
|
|
||||||
|
|
|
@ -440,9 +440,14 @@ void System::Solve(Group *g) {
|
||||||
if(rank != mat.m) {
|
if(rank != mat.m) {
|
||||||
FindWhichToRemoveToFixJacobian(g);
|
FindWhichToRemoveToFixJacobian(g);
|
||||||
g->solved.how = Group::SINGULAR_JACOBIAN;
|
g->solved.how = Group::SINGULAR_JACOBIAN;
|
||||||
|
g->solved.dof = 0;
|
||||||
TextWindow::ReportHowGroupSolved(g->h);
|
TextWindow::ReportHowGroupSolved(g->h);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// This is not the full Jacobian, but any substitutions or single-eq
|
||||||
|
// solves removed one equation and one unknown, therefore no effect
|
||||||
|
// on the number of DOF.
|
||||||
|
g->solved.dof = mat.n - mat.m;
|
||||||
|
|
||||||
// And do the leftovers as one big system
|
// And do the leftovers as one big system
|
||||||
if(!NewtonSolve(0)) {
|
if(!NewtonSolve(0)) {
|
||||||
|
|
|
@ -439,7 +439,7 @@ void TextWindow::ShowGroupInfo(void) {
|
||||||
if(a == 0) Printf(false, "%Ba (none)");
|
if(a == 0) Printf(false, "%Ba (none)");
|
||||||
|
|
||||||
a = 0;
|
a = 0;
|
||||||
Printf(true, "%Ftconstraints in group");
|
Printf(true, "%Ftconstraints in group (%d DOF)", g->solved.dof);
|
||||||
for(i = 0; i < SS.constraint.n; i++) {
|
for(i = 0; i < SS.constraint.n; i++) {
|
||||||
Constraint *c = &(SS.constraint.elem[i]);
|
Constraint *c = &(SS.constraint.elem[i]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue