PyGeM icon indicating copy to clipboard operation
PyGeM copied to clipboard

khandler not working

Open e-dub opened this issue 5 years ago • 5 comments

#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,) 

e-dub avatar Oct 05 '20 14:10 e-dub

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?

  • ../tests/test_datasets/test_square.k
  • ../tests/test_datasets/test_square_comma.k

mtezzele avatar Oct 05 '20 14:10 mtezzele

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 ;-)

e-dub avatar Oct 05 '20 14:10 e-dub

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.

mtezzele avatar Oct 05 '20 15:10 mtezzele

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

e-dub avatar Oct 05 '20 15:10 e-dub

Dear PR solved the problem for comma separated k files

mtezzele avatar Oct 05 '20 15:10 mtezzele