I would like to assess the smallest mesh size at each time increment to compute automatically the CFL and satisfy the stability. It is necessary for nonlinear material with high deformation.
I make this small code to determine the smallest length but it’s limited to the initial mesh:
from dolfinx import fem, io import ufl from mpi4py import MPI comm = MPI.COMM_WORLD with io.XDMFFile(comm, "kalthoff_112m.xdmf", "r") as xdmf: msh = xdmf.read_mesh(name="Grid") cell_tags = xdmf.read_meshtags(msh, name="Grid") cell_edge_min_ufl = ufl.geometry.MinCellEdgeLength(msh) Ve = fem.FunctionSpace(msh, ("DG", 0)) cell_edge_min_expr = fem.Expression(cell_edge_min_ufl, Ve.element.interpolation_points()) r = fem.Function(Ve) r.interpolate(cell_edge_min_expr) with io.XDMFFile(msh.comm, "cell_length.xdmf", "w") as xdmf: xdmf.write_mesh(msh) xdmf.write_function(r)
Is it possible to extend it at each increment in terms of a deformed domain ?
Or might I need to rewrite a function to compute distance between two vertex in taking account the displacement during the time ?
Thank you for the advice,