# How to use Tetgen to generate meshes for coaxial cylinders?

**URL:** <https://community.freefem.org/t/how-to-use-tetgen-to-generate-meshes-for-coaxial-cylinders/3447>\
**Category:** General Discussion\
**Created:** [August 17, 2024, 1:39am UTC](https://community.freefem.org/t/how-to-use-tetgen-to-generate-meshes-for-coaxial-cylinders/3447 "2024-08-17T01:39:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![qingYang](https://avatars.discourse-cdn.com/v4/letter/q/9f8e36/32.png) [@qingYang](https://community.freefem.org/u/qingYang)\
**Post date:** [August 17, 2024, 1:39am UTC](https://community.freefem.org/t/how-to-use-tetgen-to-generate-meshes-for-coaxial-cylinders/3447/1 "2024-08-17T01:39:07Z")

</div>

Dear Freefem users:  
I recently encountered a problem where I encountered the following error when using Tetgen to generate tetrahedral meshes for three coaxial cylinders.  
erro message : [Assertion fail : (tabregion.N( ) == 5 \* nbregion)]  
I have attached my program and hope to receive help.  
Thank you  
[help.edp](https://community.freefem.org/uploads/short-url/qtMZUeZBuoYiq97kSDHa2tbttRf.edp) (2.3 KB)

---

<div class="post-metadata">

**Author:** ![julienG](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/julieng/32/222_2.png) [@julienG](https://community.freefem.org/u/julienG)\
**Post date:** [August 17, 2024, 9:33am UTC](https://community.freefem.org/t/how-to-use-tetgen-to-generate-meshes-for-coaxial-cylinders/3447/2 "2024-08-17T09:33:16Z")

</div>

Your `domain` array has wrong size. It must be `5*nbregion`. For each region you have to supply `x0,y0,z0,label,voltet`. Where `x0,y0,z0` are coordinates of point of the domain, `label` is the label of your region, and `voltet` the size of tetrahedra.

---

<div class="post-metadata">

**Author:** ![qingYang](https://avatars.discourse-cdn.com/v4/letter/q/9f8e36/32.png) [@qingYang](https://community.freefem.org/u/qingYang)\
**Post date:** [August 17, 2024, 9:59am UTC](https://community.freefem.org/t/how-to-use-tetgen-to-generate-meshes-for-coaxial-cylinders/3447/3 "2024-08-17T09:59:56Z")

</div>

Thank you for your reply. I also noticed this issue in the manual, and after making the necessary changes, it now displays intersecting error messages. Does this mean that Tetgen cannot be used for coaxial cylindrical structures? Because their bottoms intersect.  
Thank you again and I hope to receive further assistance from you.  
Erro message:PLC Error: Two segments intersect at point (0.2,0.0350105,-0.0422254).  
[help.edp](https://community.freefem.org/uploads/short-url/iKy3yhXnvsqMRWqsjHCgLVcjb2U.edp) (2.3 KB)
