# Assertion fail: femlib/GQuadTree.cpp

**URL:** <https://community.freefem.org/t/assertion-fail-femlib-gquadtree-cpp/1089>\
**Category:** General Discussion\
**Created:** [July 7, 2021, 8:20pm UTC](https://community.freefem.org/t/assertion-fail-femlib-gquadtree-cpp/1089 "2021-07-07T20:20:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [July 7, 2021, 8:20pm UTC](https://community.freefem.org/t/assertion-fail-femlib-gquadtree-cpp/1089/1 "2021-07-07T20:20:34Z")

</div>

Dear all,

I am sure the displacement is very small, however when I do  
**Ths=movemesh(Ths0, [x+dispx,y+dispy,z+dispz]);** // Ths0 is an initial mesh  
it always has the following error after several time stesp:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/7e05c9ed0ed0d977061c2b69343f15a6e1ea1125.png)

Does any one have an idea what’s wrong?

Best,  
Yongxing.

---

<div class="post-metadata">

**Author:** ![Daokun](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/daokun/32/522_2.png) [@Daokun](https://community.freefem.org/u/Daokun)\
**Post date:** [July 7, 2021, 9:43pm UTC](https://community.freefem.org/t/assertion-fail-femlib-gquadtree-cpp/1089/2 "2021-07-07T21:43:38Z")

</div>

The same error occurred in my codes this week. If you have any solution, could you please share with me? Thank you in advance!

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [July 8, 2021, 8:14am UTC](https://community.freefem.org/t/assertion-fail-femlib-gquadtree-cpp/1089/3 "2021-07-08T08:14:23Z")

</div>

After move too mush points are at the same place, so the quadtree not solve this problem.

=\> your is mesh is too bad …

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [July 8, 2021, 9:07am UTC](https://community.freefem.org/t/assertion-fail-femlib-gquadtree-cpp/1089/5 "2021-07-08T09:07:22Z")

</div>

Thank you Prof. Hecht.  
My cylinder just slightly bend after 9 time steps, and all the tetrahedrons are visually good as shown the following figure (an oscillating cylinder in a channel). In addition, I simulated this problem before using my Fortran code which just updates the coordinates of the mesh vertices, and it worked fine as shown in this animation: [yongxingwang.github.io/oscillating\_cylinder.gif at master · yongxingwang/yongxingwang.github.io · GitHub](https://github.com/yongxingwang/yongxingwang.github.io/blob/master/assets/video/oscillating_cylinder.gif). **Is there other possible reason for this error** : Assertion fail: …/femlib/GQuadTree.cpp ?

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/e574918a6ab22bfd3f0a2bcd3681b52cc6b91bd7.jpeg)  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/56d20b0a0eab1fdb9c9b353339aaf5c1d7651ca5.jpeg)

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [July 8, 2021, 12:13pm UTC](https://community.freefem.org/t/assertion-fail-femlib-gquadtree-cpp/1089/6 "2021-07-08T12:13:06Z")

</div>

Can you send the mesh Ths and [dipx,dispy,dispz] Finite element array.  
to see where is the problem exactly.

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [July 8, 2021, 4:16pm UTC](https://community.freefem.org/t/assertion-fail-femlib-gquadtree-cpp/1089/8 "2021-07-08T16:16:31Z")

</div>

Thank you very much! This is a piece of parallel code…

Please find attached the background mesh **Th** , the solid mesh **Ths** , together with the code.

I just found that the problem disappeared if only using one processor. However, it is still strange why the first 9 steps are OK for two or more processors, but then suddenly breaks down.

By the way, the method is similar to Prof. Daniele Boffi’s FSI method (two meshes plus Lagrangian multiplier) you implemented. However, I uses FEM interpolation rather than Lagrangian Multiplier. Prof. Olivier Pironneau is familiar with my work, who was my PhD thesis examiner. Of course, I am quite familiar with your monolithic FSI paper (2017) with Olivier. Olivier shared most of his FSI code, and I have implement your monolithic FSI method in parallel these days – but I came across stability issues, will ask you about that later.

[Th\_cylinder.mesh](https://community.freefem.org/uploads/short-url/tuRWcVeOFDGFB0zmQNx6dp3KTwH.mesh) (639.7 KB)  
[Ths\_cylinder.mesh](https://community.freefem.org/uploads/short-url/kho8Ob8YUCkpsUtRUbzQYiQJNST.mesh) (373.3 KB)  
[fsi\_3d.edp](https://community.freefem.org/uploads/short-url/rHBETOUSZleQFMbrtSXHeqYo75Z.edp) (5.8 KB)

---

<div class="post-metadata">

**Author:** ![zhaog6](https://avatars.discourse-cdn.com/v4/letter/z/4af34b/32.png) [@zhaog6](https://community.freefem.org/u/zhaog6)\
**Post date:** [July 10, 2021, 8:33am UTC](https://community.freefem.org/t/assertion-fail-femlib-gquadtree-cpp/1089/9 "2021-07-10T08:33:48Z")

</div>

Your code seems to work well in my Mac (macOS 11.4 & FreeFEM-v4.9), and the ParaView result looks like ok.

 ![截屏2021-07-10 16.14.29](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/8378c2e9df9a3ecdfbdb5754fd8371122bba4c6d.jpeg)

when your code runs to 36th step, the FreeFEM result are as follow (solid, dx):

 ![截屏2021-07-10 17.15.22](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/ec2ceec6baf2f0fb098683c2befd3f8e56f8df2f.png)

I don’t know much about FSI, just to provide some clues.

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [July 10, 2021, 1:11pm UTC](https://community.freefem.org/t/assertion-fail-femlib-gquadtree-cpp/1089/11 "2021-07-10T13:11:53Z")

</div>

Thank you very much. That’s interesting, I will try it on a different machine. BTW, How many processors did you use?  
Yongxing.

---

<div class="post-metadata">

**Author:** ![zhaog6](https://avatars.discourse-cdn.com/v4/letter/z/4af34b/32.png) [@zhaog6](https://community.freefem.org/u/zhaog6)\
**Post date:** [July 11, 2021, 12:21am UTC](https://community.freefem.org/t/assertion-fail-femlib-gquadtree-cpp/1089/12 "2021-07-11T00:21:31Z")

</div>

-np = 4，I also try to 2 processes and it works fine in my machine.
