adaptive mesh refinement in 3D

More
6 years 6 months ago #513 by Williamson
Hi.

I am trying to do adaptive mesh refinement in 3D, but the refinement process appears to be inefficient in that more elements are being refined than appear necessary. The attached script (refine_experiment.py) is an example of what I mean. The initial mesh has only 54 elements. However, when I mark only the first element for refinement, the refined mesh has 384 elements (global refinement produces 432 elements). Are there additional settings I need to obtain better adaptive refinement?

Thank you,
Kevin

File Attachment:

File Name: refine_experiment.py
File Size:1 KB
More
6 years 6 months ago #514 by joachim
Hi Kevin,

NGSolve uses refinement markers for 3D elements and 2D elements. Per default, all elements are marked for refinement, so you have to unmark all surface elements first:

for el in mesh.Elements(BND):
mesh.SetRefinementFlag(el, False)

then I get 82 elements after refinement,

Joachim
More
6 years 6 months ago #515 by Williamson
Hi Joachim,

Thank you very much! This works.

Thanks,
Kevin
Time to create page: 0.101 seconds