Multi-phase meshing problem with cgalmesh

261 views
Skip to first unread message

Chuanyue Shen

unread,
Jul 26, 2019, 3:03:08 PM7/26/19
to iso2mesh-users

Hello Dr. Fang,


My goal is to create three-phase tetrahedral FE mesh from tiff stack (unit8). I was using cgalmesh method within the vol2mesh function for this purpose. The mesh generation was successful and I saved the mesh to Abaqus inp file using mesh2abaqus by Michael Wang & Paul Mignone in previous post. However, when I loaded the mesh to Abaqus and submitted a job, the error showed that the volume of the elements is zero, small or negative. The detailed message is shown below. 

Abaqus_message_errors.PNG


I was wondering if the failure was due to the complexity of the tiff. So I simplified the problem, made binary images and tried the cgalmesh method again. Still failed with the same error message. Then I tried the vol2surf (cgalpoly) + cgals2m (cgalpoly) for the binary images and this time it worked. In both cases, I used the same opt parameters and mesh2abaqus to save mesh.


Although the vol2surf+cgals2m worked, I couldn’t use it for multi-phase images as the vol2surf only accept binaries. So I am wonder how can I solve the issue. I have attached the code for multi-phase and two-phase cases as well as the images in this link (https://www.dropbox.com/sh/61px1dinp00pfde/AADsO2nZAYoVeMmjp3AKVEMka?dl=0). A little explanation for the images: they represent porous material, so that one of the phases “void” (black) is not meshed and the corresponding space is left empty.


Another observation is that the mesh created with vol2mesh (cgalmesh) looked problematic indeed in Abaqus, which is very different from the one created with vol2surf+cgals2m. A picture comparison can also be found in the same link.


Thank you in advance for your help.


Regards,

Chuanyue


Qianqian Fang

unread,
Jul 26, 2019, 3:17:42 PM7/26/19
to iso2mes...@googlegroups.com, Chuanyue Shen

hi Chuanyue

cgalmesh and tetgen won't generate zero-volumed (degenerated) elements.

I think what likely happened was that when you export, the label column was messed up, making those part of the meshing data. try removing the label columns before saving.

if the mesh shape was correct, but abaqus still complains about the volume sign, you should call meshreorient() to reorient your element list (remember to take out the label first).

let me know if these fix the problem.

Qianqian

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/54cb246a-b2d6-4cc5-b94e-78dba0a47dfe%40googlegroups.com.


Chuanyue Shen

unread,
Jul 28, 2019, 1:53:25 AM7/28/19
to iso2mesh-users
Hello Dr. Fang,

Thank you very much for the reply.

The label column in element matrix is for differentiating phases, so I think it might be necessary to keep it in the mesh inp file. However, I tried to remove the label column for the two-phase case, but the mesh still gets errors in Abaqus.

I also called the meshreorient() with label removed, but it had no success.

Are there other ways that I could try to solve the issue? Thank you!

Regards,
Chuanyue


To unsubscribe from this group and stop receiving emails from it, send an email to iso2me...@googlegroups.com.

Qianqian Fang

unread,
Jul 28, 2019, 11:08:39 AM7/28/19
to iso2mes...@googlegroups.com, Chuanyue Shen
On 7/28/19 1:53 AM, Chuanyue Shen wrote:
Hello Dr. Fang,

Thank you very much for the reply.

The label column in element matrix is for differentiating phases, so I think it might be necessary to keep it in the mesh inp file. However, I tried to remove the label column for the two-phase case, but the mesh still gets errors in Abaqus.

I also called the meshreorient() with label removed, but it had no success.


I am not sure how you used the results from meshreorient, but from reading the mesh2abaqus.m script, it requires elem to have 5 columns, so this is what you should do

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

and make sure you do not lose the 5th column.


if you want to verify the element volume, you can use

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


you can print the element volume that Abaqus complains and see if that is a real problem. if the element iso2mesh created is not degenerated but abaqus still complains, the best path to get that resolved is to contact abaqus' support or post on its forum.

Qianqian



To unsubscribe from this group and stop receiving emails from it, send an email to iso2mesh-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/iso2mesh-users/349883d2-46f5-4fc9-925c-a1c0fbae02bb%40googlegroups.com.

Chuanyue Shen

unread,
Jul 29, 2019, 3:46:13 AM7/29/19
to iso2mesh-users
Hi Dr. Fang,

Thank you very much. I used what exactly as you mentioned. And the elem volume are verified positive after calling the meshreorient(), but the Abaqus still complained. I will contact the Abaqus support to find if there is a solution.

I tried to use the iso2mesh/sample to create mesh and save to Abaqus (using mesh2abaqus.m as well) to target the problem. This time meshreorient() wasn't used and the elem volume had some negatives, but that did not make the issue because based on some experiments I guess Abaqus may have some functions to reorient.
  • 'demo_grayscale_ex1.m' with v2m (cgalsurf) worked; 
  • 'demo_label_sizing.m' with v2m (cgalmesh) failed; 
  • 'demo_surf2mesh.m' worked; 
  • 'demo_vol2mesh_ex1.m' with cgalsurf method worked;
  • 'demo_vol2mesh_ex1b.m' with simplify method worked;
  • 'demo_vol2mesh_ex1c.m' with cgalmesh;
  • 'demo_vol2mesh_ex2.m' with cgalsurf worked.
It seems cgalmesh is the only case that won't work. I am just confused what makes cgalmesh so different. Can you explain a little if possible?

Thank you,
Chuanyue

Qianqian Fang

unread,
Jul 29, 2019, 12:05:08 PM7/29/19
to iso2mes...@googlegroups.com, Chuanyue Shen
On 7/29/19 3:46 AM, Chuanyue Shen wrote:
Hi Dr. Fang,

Thank you very much. I used what exactly as you mentioned. And the elem volume are verified positive after calling the meshreorient(), but the Abaqus still complained. I will contact the Abaqus support to find if there is a solution.

I tried to use the iso2mesh/sample to create mesh and save to Abaqus (using mesh2abaqus.m as well) to target the problem. This time meshreorient() wasn't used and the elem volume had some negatives, but that did not make the issue because based on some experiments I guess Abaqus may have some functions to reorient.
  • 'demo_grayscale_ex1.m' with v2m (cgalsurf) worked; 
  • 'demo_label_sizing.m' with v2m (cgalmesh) failed; 
  • 'demo_surf2mesh.m' worked; 
  • 'demo_vol2mesh_ex1.m' with cgalsurf method worked;
  • 'demo_vol2mesh_ex1b.m' with simplify method worked;
  • 'demo_vol2mesh_ex1c.m' with cgalmesh;
  • 'demo_vol2mesh_ex2.m' with cgalsurf worked.
It seems cgalmesh is the only case that won't work. I am just confused what makes cgalmesh so different. Can you explain a little if possible?


I don't exactly what abaqus expects, nor had experience in converting iso2mesh mesh data to abaqus.

just from the perspective of the mesh data generated from these sample scripts, I do not see any major difference between the 4 involved meshing workflows:

1. v2m (cgalmesh)
2. v2s (cgalsurf) -> s2m(tetgen)
3. v2s (cgalsurf) -> s2m(cgalpoly)
4. v2s (simplify) -> s2m(tetgen)

the only possible difference is that cgalmesh outputs a 4-column node and 5-column elem array. The last column is the label (in both the node and elem). In comparison, most others either do not have any label, or only contains the elem label.

Please make sure that the 4-th column in node is removed before conversion. Other than that, I don't see any other difference can cause different behaviors.

Qianqian



Thank you,
Chuanyue

On Sunday, July 28, 2019 at 10:08:39 AM UTC-5, q.fang wrote:
On 7/28/19 1:53 AM, Chuanyue Shen wrote:
Hello Dr. Fang,

Thank you very much for the reply.

The label column in element matrix is for differentiating phases, so I think it might be necessary to keep it in the mesh inp file. However, I tried to remove the label column for the two-phase case, but the mesh still gets errors in Abaqus.

I also called the meshreorient() with label removed, but it had no success.


I am not sure how you used the results from meshreorient, but from reading the mesh2abaqus.m script, it requires elem to have 5 columns, so this is what you should do

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

and make sure you do not lose the 5th column.


if you want to verify the element volume, you can use

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


you can print the element volume that Abaqus complains and see if that is a real problem. if the element iso2mesh created is not degenerated but abaqus still complains, the best path to get that resolved is to contact abaqus' support or post on its forum.

Qianqian

--
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.

Chuanyue Shen

unread,
Jul 29, 2019, 3:52:43 PM7/29/19
to iso2mesh-users
Thank you so much Dr. Fang. Just one more question. Except using vol2mesh with cgalmesh, are there other possible ways to create multi-label volumetric mesh? Can we first generate a multi-label surface mesh, then convert it to volume mesh? Or can we create different single-label meshes and combine them together? 

Thanks,
Chuanyue

Qianqian Fang

unread,
Aug 10, 2019, 11:26:02 AM8/10/19
to iso2mes...@googlegroups.com, Chuanyue Shen

On 7/29/19 3:52 PM, Chuanyue Shen wrote:
Thank you so much Dr. Fang. Just one more question. Except using vol2mesh with cgalmesh, are there other possible ways to create multi-label volumetric mesh? Can we first generate a multi-label surface mesh, then convert it to volume mesh?


hi Chuanyue

yes, you can. surface-based meshing pipeline is the recommended method, but involves more work.

are you trying to mesh combinations of simple shapes, or segmented complex volumes like medical images?

for the 1st case, you can create primitives and use surfboolean to merge them, and then s2m to mesh.

for the 2nd case, it is not trivial. We have done some work on meshing multi-layered brain, and a specialized brain meshing toolbox can be found at

https://github.com/fangq/brain2mesh

this approach was described in one of our preprint papers

https://arxiv.org/abs/1708.08954

From Fig. 3 of this paper, you can see that it involves many steps. But the output mesh quality is quite nice.


Or can we create different single-label meshes and combine them together?


unfortunately, no, we do not have volumetric mesh merging capability, nor am I aware of other tools that can do that.

Qianqian



Thanks,
Chuanyue


On Monday, July 29, 2019 at 11:05:08 AM UTC-5, q.fang wrote:
On 7/29/19 3:46 AM, Chuanyue Shen wrote:
Hi Dr. Fang,

Thank you very much. I used what exactly as you mentioned. And the elem volume are verified positive after calling the meshreorient(), but the Abaqus still complained. I will contact the Abaqus support to find if there is a solution.

I tried to use the iso2mesh/sample to create mesh and save to Abaqus (using mesh2abaqus.m as well) to target the problem. This time meshreorient() wasn't used and the elem volume had some negatives, but that did not make the issue because based on some experiments I guess Abaqus may have some functions to reorient.
  • 'demo_grayscale_ex1.m' with v2m (cgalsurf) worked; 
  • 'demo_label_sizing.m' with v2m (cgalmesh) failed; 
  • 'demo_surf2mesh.m' worked; 
  • 'demo_vol2mesh_ex1.m' with cgalsurf method worked;
  • 'demo_vol2mesh_ex1b.m' with simplify method worked;
  • 'demo_vol2mesh_ex1c.m' with cgalmesh;
  • 'demo_vol2mesh_ex2.m' with cgalsurf worked.
It seems cgalmesh is the only case that won't work. I am just confused what makes cgalmesh so different. Can you explain a little if possible?


I don't exactly what abaqus expects, nor had experience in converting iso2mesh mesh data to abaqus.

just from the perspective of the mesh data generated from these sample scripts, I do not see any major difference between the 4 involved meshing workflows:

1. v2m (cgalmesh)
2. v2s (cgalsurf) -> s2m(tetgen)
3. v2s (cgalsurf) -> s2m(cgalpoly)
4. v2s (simplify) -> s2m(tetgen)

the only possible difference is that cgalmesh outputs a 4-column node and 5-column elem array. The last column is the label (in both the node and elem). In comparison, most others either do not have any label, or only contains the elem label.

Please make sure that the 4-th column in node is removed before conversion. Other than that, I don't see any other difference can cause different behaviors.

Qianqian

--
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.

Wen LUO

unread,
May 6, 2022, 5:51:00 PM5/6/22
to iso2mesh-users
Hi Dr. Fang,

I have encountered the same issue. I double checked the Abaqus input file and it does not contain the label columns in the "node" and "elem" variables. I also checked the volume of the tetrahedral elements using the "evol" output of the "meshreorient" function. It indicates that all the element volumes are either 0 or positive (no negative volumes). And in my case, there are 837 elements with 0 volume. I was wondering if you know any of the solutions?

Many thanks,
Wen

Qianqian Fang

unread,
May 7, 2022, 1:19:17 AM5/7/22
to iso2mes...@googlegroups.com, Wen LUO

iso2mesh should not create degenerated elements (neither CGAL tools or tetgen allows output mesh to have degeneracy), so, I think is like a book-keeping issue when saving/exporting your mesh.

can you save a copy of your node/elem variables to a .mat file and share it somewhere?

Stanislav Buklovskyi

unread,
May 23, 2022, 7:26:02 PM5/23/22
to iso2mesh-users
snap.pngHello Dr. Fang,

I am trying to use the same approach to mesh a multi-phase composite (2 phases). Iso2mesh does generate the mesh with cgalmesh but after the import in the software elements look extremely distorted.
Does that happen often? I did try different max volume numbers for the mesh but it didn't help.

Please let me know if you have any thoughts about that. (see screenshot attached) Do you think that a more sophisticated approach needed for such a geometry?

Best,
Stas

суббота, 7 мая 2022 г. в 01:19:17 UTC-4, q.fang:

Qianqian Fang

unread,
May 23, 2022, 11:03:39 PM5/23/22
to iso2mes...@googlegroups.com, Stanislav Buklovskyi

how did you plot the mesh? usually this is caused by the label column  - plot/export the mesh without the 4th column of node and 5th column of elem, unless you need the labels.

Stanislav

unread,
May 24, 2022, 8:30:55 AM5/24/22
to Qianqian Fang, iso2mes...@googlegroups.com

I exported the mesh in FEA software, the plot is from there. I do need labels and I kept the 5th column of elem but I din’t keep 4th column of node because it didn’t consist of integer numbers. I had my phases marked as [1, 2] but labels for nodes were [1.5, 2.5]. Do they correspond to [1,2] elem sets? Is it correct that they’re not integers?

 

Stas

 

From: Qianqian Fang
Sent: Monday, May 23, 2022 11:03 PM
To: iso2mes...@googlegroups.com; Stanislav Buklovskyi
Subject: Re: [iso2mesh-users] Multi-phase meshing problem with cgalmesh

 

how did you plot the mesh? usually this is caused by the label column  - plot/export the mesh without the 4th column of node and 5th column of elem, unless you need the labels.

 

On 5/23/22 19:26, Stanislav Buklovskyi wrote:

Hello Dr. Fang,

Qianqian Fang

unread,
May 24, 2022, 10:13:21 AM5/24/22
to iso2mes...@googlegroups.com, Stanislav

then it is very likely your exported files are either misaligned or misnumbered. does your FEA software use 1 as the first node index or 0?

Buklovskyi, Stanislav

unread,
May 24, 2022, 3:53:46 PM5/24/22
to Qianqian Fang, iso2mes...@googlegroups.com

Thanks for the tip. I think the software uses 1 as the first node index. Also, why do nodes have float labels (1.5 and 2.5 in my case, instead of 1 and 2)? Is that how it’s supposed to be?

 

Thanks,

Chuanyue

 

Hi Dr. Fang,

 

1.       'demo_grayscale_ex1.m' with v2m (cgalsurf) worked; 

2.       'demo_label_sizing.m' with v2m (cgalmesh) failed; 

3.       'demo_surf2mesh.m' worked; 

4.       'demo_vol2mesh_ex1.m' with cgalsurf method worked;

5.       'demo_vol2mesh_ex1b.m' with simplify method worked;

6.       'demo_vol2mesh_ex1c.m' with cgalmesh;

7.       'demo_vol2mesh_ex2.m' with cgalsurf worked.

Stanislav Buklovskyi

unread,
Jun 6, 2022, 9:02:15 PM6/6/22
to iso2mesh-users
Hi Dr. Fang,

I just checked my mesh exporting algorithm. Adding to the discussion above about "elements misalignment". It looks like the problem for me is the "cgalmesh" meshing algorithm. I tried meshing the same volume with both the default and "cgalmesh" mesher. In the first case - no problem with exporting to my software (MSC Marc). In the second case (cgalmesh) - the mesh looks broken, even though the export code is the same. (please see images attached). I wonder if there is a change between these two meshers in something like node numbering or something like that? Please let me know what you think. Any thoughts would be valuable.

Best,
Stas
Picture1.jpgPicture2.jpg

вторник, 24 мая 2022 г. в 15:53:46 UTC-4, Stanislav Buklovskyi:

Qianqian Fang

unread,
Jun 9, 2022, 2:17:10 AM6/9/22
to iso2mes...@googlegroups.com, Stanislav Buklovskyi

your "good" mesh were exported by other software using other exporters. since cgalmesh output looks fine in matlab, I am pretty sure the issue came from your exporter - is the exporting function part of iso2mesh or something else?

Reply all
Reply to author
Forward
0 new messages