Dear forum, in general, the function
MMG2D_mmg2dlib(mesh, met)
is not idempotent: calling it repeatedly gives different results than calling it once. Regardless of whether it makes sens to call it repeatedly, I wondered how not to make use of the metric computed in the first call.
If met->np was zero before the first call, it is !=0 after the first call. So, I wondered how to reset it to a state with met->np == 0. Just setting met->np = 0 works but it is not an API function (and maybe it leads to a memory leak somewhere). On the other hand, freeing the solution with the API function
MMG2D_Free_solutions(mesh, met)
between the calls does not work: it gives the message ##ERROR: WRONG DATA TYPE in the second call.
I feel there should be an API function to clear a solution/metric since I don’t want to touch the internals of mmg because they can change in the future. What API function should I use to reset a metric/solution to the state it was left after a call to
MMG2D_Init_mesh(MMG5_ARG_start, MMG5_ARG_ppMesh, &mesh, MMG5_ARG_ppMet, &met, MG5_ARG_end
?
Thank you.