mathLab / PyGeM

Python Geometrical Morphing
http://mathlab.github.io/PyGeM/
Other
338 stars 118 forks source link

khandler not working #214

Open e-dub opened 3 years ago

e-dub commented 3 years ago

187 makes changes to original khandler resulting inablility to read in file. Revert to old code previous to this commit?

See tutorial-6-k.py to reproduce the following error:

  File ~/opt/PyGeM/tutorials/tutorial-6-k.py", line 14, in <module>
    new_mesh_points = ffd(mesh_points)

  File "/usr/local/lib/python3.8/dist-packages/pygem-2.0.0-py3.8.egg/pygem/ffd.py", line 560, in __call__
    src_reference_frame_pts = self.psi(src_pts - self.box_origin)

ValueError: operands could not be broadcast together with shapes (0,) (3,) 
mtezzele commented 3 years ago

Thanks. Can you tell me the shape of mesh_points after the following line: mesh_points = handler.parse('../tests/test_datasets/test_pipe.k')

Moreover do you have the same problem using the following files instead?

e-dub commented 3 years ago

mesh_points = (29189,3)

Those files work as the nodes are defined above the elements. The new code uses the *elements to break the code. Not all preprocessors export k files in this fashion though. Therefore ungood ;-)

mtezzele commented 3 years ago

Ok perfect, you have already found the problem. I will leave this issue open. If you want/are able to propose a patch to solve this we would be more than happy.

e-dub commented 3 years ago

I would return to the previous code. I do not know what this PR solved.

mtezzele commented 3 years ago

Dear PR solved the problem for comma separated k files