Replying on list so that others may chime in.
Unfortunately, I am pretty much swamped with research, so I won't have time to dig into this. But it looks to me like your MED contains objects not (yet) supported by sfepy, either due to changes in the MED file format or not fully developed support of MED in meshio.py. Keep in mind that the MED support is rudimentary at best, although it worked for my purposes at the time.
If you have some time to dig around, you can use hdfview [1] to peak into your MED file (MED is based on hdf5, if I recall correctly). The problem is basically here in meshio.py:
File "e:\sfepy\sfepy\fem\meshio.py", line 1603, in read
coors = mesh_group.NOE.COO.read()
If you look at your MED file with hdfview, you should see a tree like structure and be able to find something similar to NOE node with a COO subnode (check the Salome manuals for more details on MED format). So the function call mesh_group.NOE.COO.read() needs to be updated to the correct names of nodes. Ideally, there would be a more robust way to do find the right nodes (probably in pytables which does the hdf parsing).
I hope I can finish my research soon so that I may return to contributing to SfePy. Good luck with this, and feel free to ask on the sfepy-devel list if you get stuck.
Warm regards, Logan
2012/1/20 rosickey wang <rosi...@gmail.com>
Sorry to bother you:
Thank you for this introduction,http://code.google.com/p/sfepy/wiki/ExampleUsingSalomeWithSfePy
I am a beginner and met some problems
I use sfepy 2011.4 and salome 6.4
this is my script: import geompy import salome vx = geompy.MakeVertex(100, 0, 0) vy = geompy.MakeVertex(0, 100, 0) vz = geompy.MakeVertex( 0, 0, 100) zz = geompy.MakeVertex( 0, 0, 0)
wire_1 = geompy.MakeSketcher("Sketcher:F 150 0:R 90:C 50 115:R 0:C -100 15:L 150:D 0 -1:IY 0") geompy.addToStudy(vx,"vx") geompy.addToStudy(vy,"vy") geompy.addToStudy(vz,"vz") geompy.addToStudy(zz,"zz") geompy.addToStudy(wire_1,"wire_1")
axis = geompy.MakeVector(zz,vx) axisz= geompy.MakeVector(zz,vz) wire_2 = geompy.MakeMirrorByAxis(wire_1,axis) geompy.addToStudy(wire_2,"wire_2") edges1 = geompy.ExtractShapes(wire_1,geompy.ShapeType["EDGE"])
edges2 = geompy.ExtractShapes(wire_2,geompy.ShapeType["EDGE"]) wire = geompy.MakeWire(edges1+edges2) isPlanarFace = 1 face1= geompy.MakeFaceWires(edges1+edges2,isPlanarFace) id_face1 = geompy.addToStudy(face1,"Face")
revolution = geompy.MakePrismVecH(face1,axisz,10)
id_prism1 = geompy.addToStudy(revolution ,"Prism1")
and GUI:
Mesh
Launch module SMESH
Creation of a simple Tetrahedral mesh
Creation of Mesh_Fillet_1 : (menu Mesh/Create Mesh)
Geometry: Fillet_1
Assign a set of hypotheses -> Automatic Tetrahedralization
Max. Length hypothesis opened, click "Cancel".
Click 1D Tab, Add "Automatic Length" hypothesis with
Fitness: 0.2
Click Apply and Close for validation.
The value of Finesse is shown in the study tree once the finesse is validated.
It is possible to modify and adjust it.
Compute (right-click on Mesh_Fillet_1)
but sfepy has some erros:
sfepy: left over: ['data_dir', 'verbose', '_filename', '__builtins__', '__packag
e__', '__doc__', '__name__', '__file__']
sfepy: reading mesh (examples\linear_elasticity\Mesh_Partition_Hexa.med)...
Traceback (most recent call last):
File "./simple.py", line 125, in <module>
main()
File "./simple.py", line 118, in main
app = SimpleApp( conf, options, output_prefix )
File "e:\sfepy\sfepy\applications\simple_app.py", line 68, in __init__
**kwargs)
File "e:\sfepy\sfepy\fem\problemDef.py", line 75, in from_conf
mesh = Mesh.from_file(conf.filename_mesh, prefix_dir=conf_dir)
File "e:\sfepy\sfepy\fem\mesh.py", line 435, in from_file
mesh = io.read(mesh, omit_facets=omit_facets)
File "e:\sfepy\sfepy\fem\meshio.py", line 1603, in read
coors = mesh_group.NOE.COO.read()
File "c:\Python26\lib\site-packages\tables\group.py", line 834, in __getattr__
return self._f_getChild(name)
File "c:\Python26\lib\site-packages\tables\group.py", line 705, in _f_getChild
self._g_checkHasChild(childname)
File "c:\Python26\lib\site-packages\tables\group.py", line 446, in _g_checkHas
Child
% (self._v_pathname, name))
tables.exceptions.NoSuchNodeError: group
/ENS_MAA/Mesh_1
does not have a child named
NOE
Closing remaining open files: examples\linear_elasticity\Mesh_Partition_Hexa.med
... done
I hope you have time to help me Thank you
Hi,
I do not have other advice than what Logan said - try to explore what is inside the hdf5 from salome with tools like h5ls, hdfview etc. Or check internet/salome site for updated docs about MED. We could then easily fix the problem.
r.
On 01/21/12 01:26, Logan Sorenson wrote:
Replying on list so that others may chime in.
Unfortunately, I am pretty much swamped with research, so I won't have time to dig into this. But it looks to me like your MED contains objects not (yet) supported by sfepy, either due to changes in the MED file format or not fully developed support of MED in meshio.py. Keep in mind that the MED support is rudimentary at best, although it worked for my purposes at the time.
If you have some time to dig around, you can use hdfview [1] to peak into your MED file (MED is based on hdf5, if I recall correctly). The problem is basically here in meshio.py:
File "e:\sfepy\sfepy\fem\meshio.py", line 1603, in read
coors = mesh_group.NOE.COO.read()
If you look at your MED file with hdfview, you should see a tree like structure and be able to find something similar to NOE node with a COO subnode (check the Salome manuals for more details on MED format). So the function call mesh_group.NOE.COO.read() needs to be updated to the correct names of nodes. Ideally, there would be a more robust way to do find the right nodes (probably in pytables which does the hdf parsing).
I hope I can finish my research soon so that I may return to contributing to SfePy. Good luck with this, and feel free to ask on the sfepy-devel list if you get stuck.
Warm regards, Logan
2012/1/20 rosickey wang<rosi...@gmail.com>
Sorry to bother you:
Thank you for this introduction,http://code.google.com/p/sfepy/wiki/ExampleUsingSalomeWithSfePy
I am a beginner and met some problems
I use sfepy 2011.4 and salome 6.4
this is my script: import geompy import salome vx = geompy.MakeVertex(100, 0, 0) vy = geompy.MakeVertex(0, 100, 0) vz = geompy.MakeVertex( 0, 0, 100) zz = geompy.MakeVertex( 0, 0, 0)
wire_1 = geompy.MakeSketcher("Sketcher:F 150 0:R 90:C 50 115:R 0:C -100 15:L 150:D 0 -1:IY 0") geompy.addToStudy(vx,"vx") geompy.addToStudy(vy,"vy") geompy.addToStudy(vz,"vz") geompy.addToStudy(zz,"zz") geompy.addToStudy(wire_1,"wire_1")
axis = geompy.MakeVector(zz,vx) axisz= geompy.MakeVector(zz,vz) wire_2 = geompy.MakeMirrorByAxis(wire_1,axis) geompy.addToStudy(wire_2,"wire_2") edges1 = geompy.ExtractShapes(wire_1,geompy.ShapeType["EDGE"])
edges2 = geompy.ExtractShapes(wire_2,geompy.ShapeType["EDGE"]) wire = geompy.MakeWire(edges1+edges2) isPlanarFace = 1 face1= geompy.MakeFaceWires(edges1+edges2,isPlanarFace) id_face1 = geompy.addToStudy(face1,"Face")
revolution = geompy.MakePrismVecH(face1,axisz,10)
id_prism1 = geompy.addToStudy(revolution ,"Prism1")
and GUI:
Mesh
Launch module SMESH
Creation of a simple Tetrahedral mesh
Creation of Mesh_Fillet_1 : (menu Mesh/Create Mesh)
Geometry: Fillet_1
Assign a set of hypotheses -> Automatic Tetrahedralization
Max. Length hypothesis opened, click "Cancel".
Click 1D Tab, Add "Automatic Length" hypothesis with
Fitness: 0.2
Click Apply and Close for validation.
The value of Finesse is shown in the study tree once the finesse is validated.
It is possible to modify and adjust it.
Compute (right-click on Mesh_Fillet_1)
but sfepy has some erros:
sfepy: left over: ['data_dir', 'verbose', '_filename', '__builtins__', '__packag
e__', '__doc__', '__name__', '__file__']
sfepy: reading mesh (examples\linear_elasticity\Mesh_Partition_Hexa.med)...
Traceback (most recent call last):
File "./simple.py", line 125, in<module>
main()
File "./simple.py", line 118, in main
app = SimpleApp( conf, options, output_prefix )
File "e:\sfepy\sfepy\applications\simple_app.py", line 68, in __init__
**kwargs)
File "e:\sfepy\sfepy\fem\problemDef.py", line 75, in from_conf
mesh = Mesh.from_file(conf.filename_mesh, prefix_dir=conf_dir)
File "e:\sfepy\sfepy\fem\mesh.py", line 435, in from_file
mesh = io.read(mesh, omit_facets=omit_facets)
File "e:\sfepy\sfepy\fem\meshio.py", line 1603, in read
coors = mesh_group.NOE.COO.read()
File "c:\Python26\lib\site-packages\tables\group.py", line 834, in __getattr__
return self._f_getChild(name)
File "c:\Python26\lib\site-packages\tables\group.py", line 705, in _f_getChild
self._g_checkHasChild(childname)
File "c:\Python26\lib\site-packages\tables\group.py", line 446, in _g_checkHas
Child
% (self._v_pathname, name))
tables.exceptions.NoSuchNodeError: group
/ENS_MAA/Mesh_1
does not have a child named
NOE
Closing remaining open files: examples\linear_elasticity\Mesh_Partition_Hexa.med
... done
I hope you have time to help me Thank you
participants (2)
-
Logan Sorenson
-
Robert Cimrman