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

problem.solve() error for linear fitting #182

Open
aliikhsanul opened this issue Jul 17, 2019 · 4 comments
Open

problem.solve() error for linear fitting #182

aliikhsanul opened this issue Jul 17, 2019 · 4 comments

Comments

@aliikhsanul
Copy link

I try to modify the linear fitting example from: https://github.com/OpenCMISS-Examples/examples/tree/v1.0/Fitting/CubeToSphere

So, in short, I am now able to fit the cube to the surface data. The script also allow for multiple fitting iteration but works only with “generatedMesh” and fixed “tau” and “kappa” parameter.

However, the error emerge when I try to do fitting from the previous data (exelem and exnode file). So far, the error is only during execution of “problem.Solve()” (line 588) command.

Here are the steps I have done:

  1. For 1st iteration, I run the python script within python virtual environment:
    python test.py
  2. For the 2nd iteration, I modify some lines in the code:
    a. Line 127. Change “iteration” from 1 to 2.
    b. Line 137. Change “tau” parameter to 0.1

Right after that steps, I got the following error message:

(oclibs_venv_py27_release) cml@CML-LINUX:~/Documents/Code/Github-repo/OpenCMISS/opencmiss/examples_Ali/CubeToSphere2/Python$ python test.py
Number of data points: 2000
Projecting data points onto geometric field
Projection complete
Solving fitting problem, iteration: 1
Solver:
Solver index = 1
Solver pre-solve:
Solver equations solve:

WARNING: Zero Determinant for matrix A.

I have been searching problem to the source code, but I couldn’t find it yet.
Anybody understand how to solve this?

Here I attach the test.py script file.

test.py.zip

@sgenie68
Copy link

Hi,

In line 132 should it read:

exelem = exfile.Exelem("DeformedGeometry" + str(iteration-1) + ".part0.exelem")

??

Cheers,
Gene

@aliikhsanul
Copy link
Author

Yes, I thought it should be that way.
I tried line 130:

exelem = exfile.Exelem("DeformedGeometry" + str(iteration-1) + ".part0.exelem")

but unfortunately, the error warning stays the same, "zero determinant for matrix A".

However, if I try this one, by the end of the calculation, it converges. I don't know whether or not the warning ("zero determinant matrix") has some implications to the result.

@aliikhsanul
Copy link
Author

I have just tried the DIRECT solver instead, and the warning ("zero determinant matrix) is not there anymore. I think that warning happens only for ITERATIVE solver.

@sgenie68
Copy link

Copy that, I will check the code and see what might be affected there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants