FreeFem / FreeFem-sources

FreeFEM source code
https://freefem.org/
Other
746 stars 187 forks source link

Add stokes-adapt-3d example + allow '-hgradreq' & `-nosizreq` args for mmg #293

Closed cmd8 closed 9 months ago

prj- commented 9 months ago

Could you please add this file to this list? https://github.com/FreeFem/FreeFem-sources/blob/cc8d10f7fa598f414137bb950fb84d2a02d07107/examples/hpddm/Makefile.am#L114

cmd8 commented 9 months ago

Note that there are no required triangles in the example, so -hgradreq is not needed in there.

prj- commented 9 months ago

Are you using specific parameters to get "nice" meshes? Without anything, I get rather nasty adapted meshes. It seems I cannot get the code to run one a single process as well.

cmd8 commented 9 months ago

Yes, my meshes are like that also. Small clusters of vertices randomly peppered about for seemingly no reason. I'll look into the single core issue later today... maybe that's a clue.

cmd8 commented 9 months ago

Looks like the issue was with PETSc's internal LU solver being automatically called with 1 proc. This problem is avoided by using -pc_factor_mat_solver_type mumps (which happens automatically with >1 proc). Maybe this is an issue for the other examples too?

cmd8 commented 9 months ago

I can confirm that this problem also occurs on stokes-3d-PETSc.edp. Should I add a MUMPS call to all the other hpddm examples using -pc_type lu?

prj- commented 9 months ago

Maybe leave the MUMPS stuff out, because if there is no Fortran, this will also fail. The failure with one process is fine, I'd still like to see meaningful adapted meshes, with the current parameters, it looks like it does not make sense to do mesh adaptation?

cmd8 commented 9 months ago

Did you see my last commit? It's not an ideal mesh, but it is much better than before. I suspect this is where adaptmesh options like regularization of the FE functions and metric smoothing come in handy...

cmd8 commented 9 months ago

I think the adapted mesh is meaningful now. Let me know if you have any further suggestions!

prj- commented 9 months ago

What parameters are you using to launch the code? This is the kind of mesh I get, which does still not look quite OK to me.

Screenshot 2023-11-18 at 7 59 07 AM
cmd8 commented 9 months ago

This does not look like the most recent version of the example? Are you looking at this version..

prj- commented 9 months ago

My bad. Things look better indeed. Still not exactly what I wanted (what's up with the corners!?), but I don't think there is a point holding this MR up.

cmd8 commented 9 months ago

I think the issues at the corners arises because (1) the pressure approximation depends strongly on the resolution in the corners where the pressure reaches its extreme values, and (2) mshmet does not perform metric smoothing, while adaptmesh does.