Code: Select all
int System::diagnose(Algorithm alg)
I think these are the main lines (reuse the QR decomposition and see how one can map the QR rows/cols with elements/constraints). You have to dig a little bit in the specifics. If I would have to do this today, I would start looking into what can I achieve with the existing QR decomposition, specially with the R triangular matrix. It is not that I like riddles, it is that today I would have to figure it out myselfabdullah wrote:How to tackle this?
a) The Jacobian restricts parameters based on constraints. You can get the DoF of a system by doing a QR decomposition as shown in that function (do not do another one, we already have one in that function I referred above).
b) You can keep track of parameters and the geometric elements to which they belong with the Geoms array in Sketch.h
So basically you know how many parameters a geometric element has and you should be able to know from the QR decomposition which of them are constraint. So elements having all its parameters constraint are "constraint".
With this information it is up to you to show the elements fully constraint or to show those which are not.
Potentially yes. This would be a "fix everything constraint". In practice, the matrix is very sparse (lots of elements are zero).kcleung wrote:So each constraint apparently has the full list of parameters to begin with:
Gradient. The Jacobian is this:kcleung wrote:though I don't get what grad() does.
A line has 4 parameters, P1X, P1Y, P2X, P2Y. The Jacobian has the parameters of the full sketch yes. That is why you can get the rank (linked to DoF) from the QR decomposition of the Jacobian.kcleung wrote:Also, the other thing I don't understand is that the code told us plist is a list of parameters (from the entire sketch?). However, each element can have more than one parameters. So at the end, if we manage to identify a subset of parameters from the plist which is unconstrained, then we will somehow need to map each unconstrained parameter to its element, am I correct?
All GCS is pointers, Geoms contains all the shapes and its parameters.abdullah wrote:b) You can keep track of parameters and the geometric elements to which they belong with the Geoms array in Sketch.h
https://en.wikipedia.org/wiki/QR_decompositionkcleung wrote: Then what do the rows and column of the matrix R represent?
If I remember correctly, that is part of the redundant/conflicting constraint determination. The action the whole diagnose function. I imagine that once you know which constraints are redundant, the rest of the constraints contribute to the current rank (DoF). Then you can use the Eigen functionality I mentioned above to see which parameters are them constraining. I mean, I do not have a solution myself ATM. I just think this is how a solution may be reached to.kcleung wrote:int res = solve(subSysTmp,true,alg,true);
Is the real action taken here?
Thanks for your pointer, and it will take me the rest of this night to digest what you said.abdullah wrote: It is not an easy undertaking the one you have selected. I will cost you time to fully understand what is happening in the code and then to find a way to achieve what you want.
You are welcome.kcleung wrote:Thanks for your pointer, and it will take me the rest of this night to digest what you said.abdullah wrote: It is not an easy undertaking the one you have selected. I will cost you time to fully understand what is happening in the code and then to find a way to achieve what you want.
However, will understand this part of the code help me with development of solvers in other modules, such as the assembly module? If so, then it would be really worthwhile for me to get to the bottom of the code, and the algorithms, despite the upfront cost of my time.