Problem with adaptmesh and periodic boundary condition

Hi everyone,

I have run into an issue, which I am not sure how to solve myself. I am solving multiphase (Navier-Stokes + phase-field) equations and marching in time. I use “adaptmesh” function to tailor my FE mesh to the phase function. The code I developed was working fine until recently I got the error:
“Exec error : periodic: Sorry one vertex of edge is losted”

I have found the error in the mailing list here, but adding “fixeborder=true” to “buildmesh” did not do anything. I also tried to make “adaptmesh” use old vertices with “keepbackvertices=true”, but that also did not help.

I created minimal example to reproduce the error (~ 8 MB ZIP file here). When I run it, I get:

minExample> FreeFem++ -ne -nw tryAdapt.edp
-- FreeFem++ v4.6 (Tue 16 Jun 2020 06:53:31 AM CEST - git v4.6-113-g243cbb52)
 Load: lg_fem lg_mesh lg_mesh3 eigenvalue
 load: iovtk
 sizestack + 1024 =3856  ( 2832 )

I am here 1!!!
I am here 2!!!
Abscisse: s0 = 0.399285 <==> s1 0.315121
  current line = 78
Exec error : periodic: Sorry one vertex of edge is losted
   -- number :1
Exec error : periodic: Sorry one vertex of edge is losted
   -- number :1
 err code 8 ,  mpirank 0

Any idea regarding what I am doing wrong? I have also checked the “c” function I am using as an input for adaptmesh and did not see any weird behaviour.

My FreeFEM version is v4.6 (Tue 16 Jun 2020 06:53:31 AM CEST - git v4.6-113-g243cbb52).

Best wishes,
Ugis

Small update. I upgraded to the current development version of FreeFEM:
– FreeFem++ v4.1 (Thu 18 Nov 2021 01:19:08 PM CET - git v4.10-1-g5525c9c1)

Nevertheless, I get the same outcome on the example I have posted.

Any input would be appreciated.

Best,
Ugis

Generally the problem is due buildmesh without option of fixedborder=1 to for no soothing of boundary mesh.
So add fixedborder=1 in the list of parameter of buildmesh.

Hi Frederic,

Thanks a lot for the suggestion. But if you check the file “surface_msh.idp” of my example, I have already added “fixeborder=true” to buildmesh. I also tried to change it to “fixeborder=1”, but there was no improvement.

Perhaps you have some other idea?

Best,
Ugis

I just noticed that for some reason clicking on my example link does not work. If you would like to try it, please copy the link:
http://www.mech.kth.se/~ugis/2021.11.18_lostEdge.zip
into a new window/tab of your web browser.

Is there anyone who is more familiar with the inner workings of adaptmesh and interpolation procedure to help me find out what is the cause for the error?

Best wishes,
Ugis

You find a true bug,

I will try to correct soon as possible
Thank for freefem++

Great, thanks a lot for the help!

Best,
Ugis

I am sorry, it is a hard bug, it takes times.