Mesh error after adding file output code

Hi, everyone. I meet a strange problem when I implement my fsi of a falling ball, as you can see in my upload.
The code can operate for the full 6 seconds successfully firstly. However, after adding file output code, it report error on the mesh at time 2.195.
Can anyone help me solve the problem. Thank you in advance.
Initial code:
falling disc.edp (3.6 KB)
After adding file output code:
falling disc.edp (3.9 KB)

I try on another computer. And they can both work. Although the problem is solved. I still feel confused why I met the problem.

THe problem is
NS Time: 1.365
u min -8.00386e-34 max 4
v min -2.43612e-33 max 12
current line = 109
Exec error : Error move mesh triangles was reverse
– number :1
Exec error : Error move mesh triangles was reverse
– number :1

  1. because the solide reach the bottom
    2° the rebuild the mesh every 50 iteration but the quality of mesh is terrible.

see

lines 72 to 80 , where the function real mintcc = checkmovemesh(Th,[x,y]),.;
say the the movemeshj the area of the minimal triangle ( it must be positive).