Problem with FEDomain creation from custom mesh
Hello
I'm building a Python/Jupyter application that generates highly complex three-dimensional shapes which I want to evaluate in Sfepy. They are closed meshes and available in various CAD formats and as (t)vtk objects.
When I'm trying to simulate linear elasticity based on the Sfepy interactive example I get an error at the creation of the FEDomain (code: domain = FEDomain('domain', myMesh)
AttributeError: 'vtkCommonDataModelPython.vtkPolyData' object has no attribute 'coors'
I cannot seem to find out how to convert (or 'enrich') my tvkt/vtk PolyData in such a way that it can serve as an FEM Mesh.
I've tried the Mesh.from_data(mesh, coors, ngroups, conns, mat_ids, descs) function, but cannot figure out what to do with the arguments aside from mesh...
Help would be greatly appreciated.
Thanks, best -christian
Hi Christian,
you need to generate an unstructured grid, not a polydata. There is no information about connectivity, i.e. connection between 3D elements (tetrahedrons, hexahedrons, ...) and nodes, in the polydata structure. The shape is represented only by facets and it can not simply be converted to FE elements. The solution that comes to my mind is that you export the surface of your geometry to STL format and than you use gmsh [1] (or some other mesher) to produce the FE mesh.
Regards Vladimir
On 09. 12. 19 12:10, christian@spherene.one wrote:
Hello
I'm building a Python/Jupyter application that generates highly complex three-dimensional shapes which I want to evaluate in Sfepy. They are closed meshes and available in various CAD formats and as (t)vtk objects.
When I'm trying to simulate linear elasticity based on the Sfepy interactive example I get an error at the creation of the FEDomain (code: domain = FEDomain('domain', myMesh)
AttributeError: 'vtkCommonDataModelPython.vtkPolyData' object has no attribute 'coors'
I cannot seem to find out how to convert (or 'enrich') my tvkt/vtk PolyData in such a way that it can serve as an FEM Mesh.
I've tried the Mesh.from_data(mesh, coors, ngroups, conns, mat_ids, descs) function, but cannot figure out what to do with the arguments aside from mesh...
Help would be greatly appreciated.
Thanks, best -christian
SfePy mailing list -- sfepy@python.org To unsubscribe send an email to sfepy-leave@python.org https://mail.python.org/mailman3/lists/sfepy.python.org/
Hi Vladimír,
thank you very much, this is helpful (and logic, actually...) !
would maybe the create_conn_graph function from the safety.discrete.fem.mesh module [1] do the trick as well? I would prefer not having to exit my pipeline, as the geometries are created within python and would best be handed directly to sfepy.
(will look into possibly integrating gmsh into the notebook, too.)
best wishes, and thanks again -christian
[1] http://sfepy.org/doc/src/sfepy/discrete/fem/mesh.html?highlight=mesh#module-...
Hi Christian,
create_conn_graph function creates the graph of connectivity for an existing FE mesh, it is not usable for your purpose. I use the attached Python script to do the job. It should be easy to incorporate this into your code.
Regards Vladimir
On 09. 12. 19 18:00, christian@spherene.one wrote:
Hi Vladimír,
thank you very much, this is helpful (and logic, actually...) !
would maybe the create_conn_graph function from the safety.discrete.fem.mesh module [1] do the trick as well? I would prefer not having to exit my pipeline, as the geometries are created within python and would best be handed directly to sfepy.
(will look into possibly integrating gmsh into the notebook, too.)
best wishes, and thanks again -christian
[1] http://sfepy.org/doc/src/sfepy/discrete/fem/mesh.html?highlight=mesh#module-...
SfePy mailing list -- sfepy@python.org To unsubscribe send an email to sfepy-leave@python.org https://mail.python.org/mailman3/lists/sfepy.python.org/
participants (2)
-
christian@spherene.one
-
Vladimír Lukeš