Negative Jacobian

59 views
Skip to first unread message

Binbin Lin

unread,
Mar 7, 2019, 10:36:12 AM3/7/19
to iso2mesh-users
Hello everyone,

I used the method 'cgalmesh' to mesh a voxeldata, the mesh I got when I import it into simulation software i.e ABAQUS, I keep getting the error that the mesh elements have negative Jacobians, while the mesh looks OK.  Has anyone encountered this kind of error before? I would have assumed it is because of the numbering of nodes in the elements...but still didn't change when sort the mesh.

I am glad if anyone could give a hint!

regards, 

 
mesh.inp
mesh.mat
mesh.PNG

Qianqian Fang

unread,
Mar 9, 2019, 3:02:20 PM3/9/19
to iso2mes...@googlegroups.com, Binbin Lin

hi Binbin

I loaded your mesh, and called the below function

vol=elemvolume (node(:,1:3),elem(:,1:4));

it looks to me that all element volumes are positive - that means all elements are consistently oriented. If somehow ABAQUS wants the element to orient the elements in opposite direction, you can do this by flipping any pair of columns (once). such as

elem=elem(:,[1 2 4 3]);


another issue may be contribute to this is the node/element label. I notice both node and element have label fields (last column). if abaqus does not need the node label, you can remove it by

node=node(:,1:3);

let me know if either of these can solve the problem.

Qianqian



regards, 

 
--
You received this message because you are subscribed to the Google Groups "iso2mesh-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-user...@googlegroups.com.
To post to this group, send email to iso2mes...@googlegroups.com.
Visit this group at https://groups.google.com/group/iso2mesh-users.
For more options, visit https://groups.google.com/d/optout.

Binbin Lin

unread,
Mar 18, 2019, 12:41:41 PM3/18/19
to iso2mesh-users
Hi qianqian,

thanks for the response.

Indeed, if I call the function elemvolume, my elements have all positive values. But if I used my function (attached and follow the way after "http://www.iue.tuwien.ac.at/phd/orio/node48.html"  ) to calculate the jacobians, I got several elements with negative jacobians. With my script calculating the flipped elements (elem=elem(:,[1 2 4 3]);) I still have that jacobian error. The simulation program complains about the same thing.

I gave another try importing the mesh to Gmsh and remeshed it, suddenly it worked out.  As I see Gmsh did the flipping as you suggested, but I am still wondering what is wrong with the calculation of jacobians.

regards,
binbin




Am Samstag, 9. März 2019 21:02:20 UTC+1 schrieb q.fang:
On 3/7/19 9:06 AM, Binbin Lin wrote:
Hello everyone,

I used the method 'cgalmesh' to mesh a voxeldata, the mesh I got when I import it into simulation software i.e ABAQUS, I keep getting the error that the mesh elements have negative Jacobians, while the mesh looks OK.  Has anyone encountered this kind of error before? I would have assumed it is because of the numbering of nodes in the elements...but still didn't change when sort the mesh.

I am glad if anyone could give a hint!


hi Binbin

I loaded your mesh, and called the below function

vol=elemvolume (node(:,1:3),elem(:,1:4));

it looks to me that all element volumes are positive - that means all elements are consistently oriented. If somehow ABAQUS wants the element to orient the elements in opposite direction, you can do this by flipping any pair of columns (once). such as

elem=elem(:,[1 2 4 3]);


another issue may be contribute to this is the node/element label. I notice both node and element have label fields (last column). if abaqus does not need the node label, you can remove it by

node=node(:,1:3);

let me know if either of these can solve the problem.

Qianqian



regards, 

 
--
You received this message because you are subscribed to the Google Groups "iso2mesh-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-use...@googlegroups.com.
To post to this group, send email to iso2me...@googlegroups.com.
negative_J.m

Qianqian Fang

unread,
Mar 18, 2019, 1:03:32 PM3/18/19
to iso2mes...@googlegroups.com, Binbin Lin
On 3/18/19 12:41 PM, Binbin Lin wrote:
Hi qianqian,

thanks for the response.

Indeed, if I call the function elemvolume, my elements have all positive values. But if I used my function (attached and follow the way after "http://www.iue.tuwien.ac.at/phd/orio/node48.html"  ) to calculate the jacobians, I got several elements with negative jacobians. With my script calculating the flipped elements (elem=elem(:,[1 2 4 3]);) I still have that jacobian error. The simulation program complains about the same thing.

I gave another try importing the mesh to Gmsh and remeshed it, suddenly it worked out.  As I see Gmsh did the flipping as you suggested, but I am still wondering what is wrong with the calculation of jacobians.


wait, from reading your script, it looks like it computes the Jacobian of triangular surfaces, not for a tetrahedral mesh, can you confirm?

did ABAQUS complain about the volume or the surfaces?

if you want to get consistent orientations for the surface, you should use

elem=meshreorient(node(:,1:3),elem(:,1:4));
face=volface(elem);

or, directly

[node,face]=meshcheckrepair(node(:,1:3),face(:,1:3));


Qianqian

To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-user...@googlegroups.com.
To post to this group, send email to iso2mes...@googlegroups.com.

Andreas Fabri

unread,
Mar 19, 2019, 4:15:50 AM3/19/19
to iso2mes...@googlegroups.com

Hello,

my guess is that if the tetrahedron is rather flat (a sliver)
the determinant is almost zero, and due to the limitations of floating point arithmetic it
it may be positive or negative, depending on the order of the terms in the arithmetic
expression. 

Andreas

To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-user...@googlegroups.com.
To post to this group, send email to iso2mes...@googlegroups.com.
-- 
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912    skype: andreas.fabri

Binbin Lin

unread,
Mar 29, 2019, 2:46:07 PM3/29/19
to iso2mesh-users
Hello qianqian,

it computes the Jacobian of a TET4 element, in a very common way, which is described as in the link mentioned. 
My assumption is that probably there is something wrong how the file is saved. When I export the data to gmsh and hit the mesh button again to reorder, it worked then.  But simply by meshreorient and elem=elem(:,[2 1 3 4]) didn't work out.

regards
Binbin
To unsubscribe from this group and stop receiving emails from it, send an email to iso2me...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages