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:
|
||||
SS.ReloadAllImported();
|
||||
SS.GenerateAll(0, INT_MAX);
|
||||
SS.later.showTW = true;
|
||||
break;
|
||||
|
||||
default: oops();
|
||||
|
|
1
sketch.h
1
sketch.h
|
@ -104,6 +104,7 @@ public:
|
|||
static const int SINGULAR_JACOBIAN = 11;
|
||||
struct {
|
||||
int how;
|
||||
int dof;
|
||||
SList<hConstraint> remove;
|
||||
} solved;
|
||||
|
||||
|
|
|
@ -440,9 +440,14 @@ void System::Solve(Group *g) {
|
|||
if(rank != mat.m) {
|
||||
FindWhichToRemoveToFixJacobian(g);
|
||||
g->solved.how = Group::SINGULAR_JACOBIAN;
|
||||
g->solved.dof = 0;
|
||||
TextWindow::ReportHowGroupSolved(g->h);
|
||||
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
|
||||
if(!NewtonSolve(0)) {
|
||||
|
|
|
@ -439,7 +439,7 @@ void TextWindow::ShowGroupInfo(void) {
|
|||
if(a == 0) Printf(false, "%Ba (none)");
|
||||
|
||||
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++) {
|
||||
Constraint *c = &(SS.constraint.elem[i]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue