202
views
0
8 months ago by
I want to adapt my mesh in a time dependent simulation. I dont want to refine an initial cell more than a certain number of times. So the initial cell would be at level zero, its children at level one, and so on. Is such level information available in the mesh and how to get it ?
Community: FEniCS Project

1
7 months ago by

I never found anything about cell levels. This would require some kind of mesh hierarchy concept which doesn't exist in fenics.

As a work-around for my project, I made an option restricting the minimum cell size. So I do roughly

def unmark_cells_exceeding_minimum_circumradius(mesh, refine, min_radius):

for cell in fenics.cells(mesh):

if not refine[cell]:

continue

refine[cell] = False

return refine

refine = fenics.CellFunction("bool", mesh)

refine.set_all(False)

refine = mark_cells_to_refine(refine, solution)

mesh = fenics.refine(mesh, refine)