Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

adaptive mesh refinement in 3D

More
5 years 11 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
5 years 11 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
5 years 11 months ago #515 by Williamson
Hi Joachim,

Thank you very much! This works.

Thanks,
Kevin
Time to create page: 0.114 seconds