Hello, I am newbie to sfepy. I am using Windows 10 and python 3.9.1 (I also tried some earlier python versions to see if that helped).
I was following the instructions for "Preprocessing: FreeCAD/OpenSCAD + Gmsh" that can be found here: https://sfepy.org/doc-devel/preprocessing.html
I got as far as this command: sfepy-convert -d 3 screwdriver_handle.msh screwdriver_handle.vtk
but the command was not recognised. However, the command sfepy-run is recognised
I was wondering whether this was because I needed to compile the C extension modules (which I had not done). I tried executing the command python setup.py build_ext --inplace from the top level sfepy directory, which, on my system, I believe to be here (at least that is where I found the setp.py file): C:\Users\ChrisWalker\anaconda3\pkgs\sfepy-2022.2-py39h5d4886f_0\Lib\site-packages\sfepy
but I get a load of error messages starting with: Appending sfepy.applications configuration to sfepy Ignoring attempt to set 'name' (from 'sfepy' to 'sfepy.applications') Appending sfepy.base configuration to sfepy Ignoring attempt to set 'name' (from 'sfepy' to 'sfepy.base') non-existing path in 'discrete\\common\\extmods': 'fmfield.c' non-existing path in 'discrete\\common\\extmods': 'refmaps.c' etc etc
I expect I am making some schoolboy errors here, but I cannot spot it. Is anyone able to help ?
Thanks Chris
Hi Chris,
On 9/9/22 10:06, Christopher Walker wrote:
Hello, I am newbie to sfepy. I am using Windows 10 and python 3.9.1 (I also tried some earlier python versions to see if that helped).
I was following the instructions for "Preprocessing: FreeCAD/OpenSCAD + Gmsh" that can be found here: https://sfepy.org/doc-devel/preprocessing.html
I got as far as this command: sfepy-convert -d 3 screwdriver_handle.msh screwdriver_handle.vtk
but the command was not recognised. However, the command sfepy-run is recognised
The docs are a bit in flux now - those commands work in the development version in git. To see the latest release docs, use [1]. For some reason, the menu item to switch between the release/development version docs work only one way (to the development ones), we will try to fix that.
BTW. sfepy-run in your version is just a wrapper to run other commands - "sfepy-run simple" is equivalent to the new "sfepy-run". I planned to post a summarizing post here, but got sidetracked.
The new release with the above updates is scheduled for the end of September. Let us know in case you want to try the git version and struggle with it. As a new user it might be better for you to use the new stuff already.
[1] https://sfepy.org/doc/preprocessing.html
I was wondering whether this was because I needed to compile the C extension modules (which I had not done). I tried executing the command python setup.py build_ext --inplace from the top level sfepy directory, which, on my system, I believe to be here (at least that is where I found the setp.py file): C:\Users\ChrisWalker\anaconda3\pkgs\sfepy-2022.2-py39h5d4886f_0\Lib\site-packages\sfepy
but I get a load of error messages starting with: Appending sfepy.applications configuration to sfepy Ignoring attempt to set 'name' (from 'sfepy' to 'sfepy.applications') Appending sfepy.base configuration to sfepy Ignoring attempt to set 'name' (from 'sfepy' to 'sfepy.base') non-existing path in 'discrete\\common\\extmods': 'fmfield.c' non-existing path in 'discrete\\common\\extmods': 'refmaps.c' etc etc
I expect I am making some schoolboy errors here, but I cannot spot it. Is anyone able to help ?
With anaconda everything is already compiled, but you need to use the full script path as follows (verify please for typos):
"C:\Users\ChrisWalker\anaconda3\pkgs\sfepy-2022.2-py39h5d4886f_0\Lib\site-packages\sfepy\script\convert_mesh.py -d 3 screwdriver_handle.msh screwdriver_handle.vtk"
That is not very user friendly, thus the changes and new commands such as sfepy-convert in the development version.
r.
Hi Robert, Many thanks for your reply. I tried the commands shown at the top of the convert_mesh.py and it worked fine. e.g. python ./script/convert_mesh.py meshes/3d/cylinder.mesh new.vtk sfepy: reading mesh (meshes/3d/cylinder.mesh)... sfepy: number of vertices: 354 sfepy: number of cells: sfepy: 3_4: 1348 sfepy: ...done in 0.02 s sfepy: writing new.vtk... sfepy: ...done
However, when I tried with the screwdriver example, I get this: python ./script/convert_mesh.py -d 3 screwdriver_handle.msh screwdriver_handle.vtk sfepy: reading mesh (screwdriver_handle.msh)... Traceback (most recent call last): File "C:\Users\ChrisWalker\anaconda3\Lib\site-packages\sfepy\script\convert_mesh.py", line 237, in <module> main() File "C:\Users\ChrisWalker\anaconda3\Lib\site-packages\sfepy\script\convert_mesh.py", line 162, in main mesh = Mesh.from_file(filename_in) File "C:\Users\ChrisWalker\anaconda3\lib\site-packages\sfepy\discrete\fem\mesh.py", line 220, in from_file mesh = io.read(mesh, omit_facets=omit_facets) File "C:\Users\ChrisWalker\anaconda3\lib\site-packages\sfepy\discrete\fem\meshio.py", line 421, in read cgdata0[m.cell_sets[k][ic]] = cgrps[ik] IndexError: index 5 is out of bounds for axis 0 with size 2
I am in no rush, so maybe its best to wait until the end of September for the new updates, but I thought it best to mention it in case you think it is something you need to check before the next release. If you want me to send my version of screwdriver_handle.msh then I can do so. Best Wishes Chris
Hi Chris,
On 9/9/22 20:48, Christopher Walker wrote:
Hi Robert, Many thanks for your reply. I tried the commands shown at the top of the convert_mesh.py and it worked fine. e.g. python ./script/convert_mesh.py meshes/3d/cylinder.mesh new.vtk sfepy: reading mesh (meshes/3d/cylinder.mesh)... sfepy: number of vertices: 354 sfepy: number of cells: sfepy: 3_4: 1348 sfepy: ...done in 0.02 s sfepy: writing new.vtk... sfepy: ...done
However, when I tried with the screwdriver example, I get this: python ./script/convert_mesh.py -d 3 screwdriver_handle.msh screwdriver_handle.vtk sfepy: reading mesh (screwdriver_handle.msh)... Traceback (most recent call last): File "C:\Users\ChrisWalker\anaconda3\Lib\site-packages\sfepy\script\convert_mesh.py", line 237, in <module> main() File "C:\Users\ChrisWalker\anaconda3\Lib\site-packages\sfepy\script\convert_mesh.py", line 162, in main mesh = Mesh.from_file(filename_in) File "C:\Users\ChrisWalker\anaconda3\lib\site-packages\sfepy\discrete\fem\mesh.py", line 220, in from_file mesh = io.read(mesh, omit_facets=omit_facets) File "C:\Users\ChrisWalker\anaconda3\lib\site-packages\sfepy\discrete\fem\meshio.py", line 421, in read cgdata0[m.cell_sets[k][ic]] = cgrps[ik] IndexError: index 5 is out of bounds for axis 0 with size 2
I am in no rush, so maybe its best to wait until the end of September for the new updates, but I thought it best to mention it in case you think it is something you need to check before the next release. If you want me to send my version of screwdriver_handle.msh then I can do so.
Thanks for the report, I can reproduce the issue. You can try generate another format, e.g.:
gmsh -3 -format mesh -o screwdriver_handle.mesh screwdriver_handle.geo
Then the subsequent conversion (stripping lower dimensional entities) works for me.
Cheers, r.
participants (2)
-
Christopher Walker
-
Robert Cimrman