I am trying to build a custom rectangle mesh, but it seems that I am failing to do a proper one. I wrote a small python script to build the rectangle, using Delaunay triangulation [1]. This results in a file [2] that looks OK when compared with '/meshes/2d/rectangle_tri.mesh'. However, when I try to use this file into the a slightly modified version of '/examples/linear_elasticity/linear_elastic_interactive.py' [3], it raises an orientation error [4].
I really don't undestand what seems to be the issue here. Is it an ordering in the triangular elements? Does Sfepy presupose a specific ordering?
[1] http://www.codesend.com/view/b6612f600b38f6f8552dc89ce072c938/ [2] http://www.codesend.com/view/25adf8bbe8e29f151d068b7ba08b4c82/ [3] http://www.codesend.com/view/910a5af4ba2a2b46f8a83572a7280529/ [4] Error below:
sfepy: reading mesh [line2, tri3, quad4, tetra4, hexa8] (MyMesh.mesh)... sfepy: ...done in 0.00 s sfepy: warning: bad element orientation, trying to correct... sfepy: warning: bad element orientation, trying to correct... Traceback (most recent call last): File "./linear_mod.py", line 98, in <module> main() File "./linear_mod.py", line 44, in main domain = FEDomain('domain', mesh) File "/home/homeGlobal/lcampos/.local/lib/python2.7/site-packages/sfepy-2017.1-py2.7-linux-x86_64.egg/sfepy/discrete/fem/domain.py", line 61, in __init__ self.fix_element_orientation() File "/home/homeGlobal/lcampos/.local/lib/python2.7/site-packages/sfepy-2017.1-py2.7-linux-x86_64.egg/sfepy/discrete/fem/domain.py", line 146, in fix_element_orientation raise RuntimeError('elements cannot be oriented! (%s)' % key) RuntimeError: elements cannot be oriented! (2_3)
Hi,
On 18.4.2017 18:27, rmk236@gmail.com wrote:
I am trying to build a custom rectangle mesh, but it seems that I am failing to do a proper one. I wrote a small python script to build the rectangle, using Delaunay triangulation [1]. This results in a file [2] that looks OK when compared with '/meshes/2d/rectangle_tri.mesh'. However, when I try to use this file into the a slightly modified version of '/examples/linear_elasticity/linear_elastic_interactive.py' [3], it raises an orientation error [4].
I really don't undestand what seems to be the issue here. Is it an ordering in the triangular elements? Does Sfepy presupose a specific ordering?
The medit format you generate assumes 1-based indexing - use
for t in sim + 1:
f.write('%d\t%d\t%d\t3\n' % (t[0], t[1], t[2]))
in WriteMesh() in [1]. Then your script works correctly.
r.
[1] http://www.codesend.com/view/b6612f600b38f6f8552dc89ce072c938/ [2] http://www.codesend.com/view/25adf8bbe8e29f151d068b7ba08b4c82/ [3] http://www.codesend.com/view/910a5af4ba2a2b46f8a83572a7280529/ [4] Error below:
sfepy: reading mesh [line2, tri3, quad4, tetra4, hexa8] (MyMesh.mesh)... sfepy: ...done in 0.00 s sfepy: warning: bad element orientation, trying to correct... sfepy: warning: bad element orientation, trying to correct... Traceback (most recent call last): File "./linear_mod.py", line 98, in <module> main() File "./linear_mod.py", line 44, in main domain = FEDomain('domain', mesh) File "/home/homeGlobal/lcampos/.local/lib/python2.7/site-packages/sfepy-2017.1-py2.7-linux-x86_64.egg/sfepy/discrete/fem/domain.py", line 61, in __init__ self.fix_element_orientation() File "/home/homeGlobal/lcampos/.local/lib/python2.7/site-packages/sfepy-2017.1-py2.7-linux-x86_64.egg/sfepy/discrete/fem/domain.py", line 146, in fix_element_orientation raise RuntimeError('elements cannot be oriented! (%s)' % key) RuntimeError: elements cannot be oriented! (2_3)
SfePy mailing list sfepy@python.org https://mail.python.org/mm3/mailman3/lists/sfepy.python.org/
Thanks, it does work! I cannot find this information in the documentation. Could you point me towards it?
On 04/19/2017 09:28 AM, rmk236@gmail.com wrote:
Thanks, it does work! I cannot find this information in the documentation. Could you point me towards it?
It is one of the external mesh formats sfepy supports for reading, as such it is not described in our docs.
Check the technical report (https://www.ljll.math.upmc.fr/frey/publications/RT-0253.pdf) on https://www.ljll.math.upmc.fr/frey/software.html for the description.
r.
participants (2)
-
rmk236@gmail.com
-
Robert Cimrman