Value-based mesh refinement

25 views
Skip to first unread message

Toddy Liu

unread,
Sep 19, 2021, 6:51:33 AM9/19/21
to deal.II User Group
Dear Deal.II community,

Are there any possible ways to do value-based mesh refinement? For example, I want to refine the mesh where the solution varible at the quadrature ranges 0 to 1. Any advice or learning material will be appreciated.

Best,
Toddy

Wolfgang Bangerth

unread,
Sep 20, 2021, 3:03:46 AM9/20/21
to dea...@googlegroups.com
On 9/19/21 12:51 AM, Toddy Liu wrote:
>
> Are there any possible ways to do value-based mesh refinement? For example, I
> want to refine the mesh where the solution varible at the quadrature ranges 0
> to 1. Any advice or learning material will be appreciated.

Yes, we do this in all sorts of situations.

step-1 already shows you how you flag cells for refinement. The only new step
is that you need to evaluate your solution-dependent criterion to decide
whether or not you want to refine. This is typically done using a call such as
fe_values.get_function_values(...)
where you get the values of the solution at the quadrature points of a cell.
(And if you choose QMidpoint, you'd have only a single evaluation point to
deal with.) You would then evaluate whether the value you have warrants mesh
refinement, and if so call
cell->set_refine_flag()

Best
W.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Toddy Liu

unread,
Sep 20, 2021, 3:33:23 AM9/20/21
to dea...@googlegroups.com
Professor Wolfgang,

Thanks for your teaching. I try that as you suggested and managed to solve my problem.

Best, 
Toddy 

Wolfgang Bangerth <bang...@colostate.edu> 于2021年9月20日周一 上午11:03写道:
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/2c2a9894-38b5-ca8f-a720-83dc23e476d8%40colostate.edu.

Wolfgang Bangerth

unread,
Sep 20, 2021, 3:38:11 AM9/20/21
to dea...@googlegroups.com
On 9/19/21 9:33 PM, Toddy Liu wrote:
>
> Thanks for your teaching. I try that as you suggested and managed to solve my
> problem.

By the way, here is an example of where we use this in one of our codes:
https://github.com/geodynamics/aspect/blob/master/source/mesh_refinement/composition_threshold.cc

Toddy Liu

unread,
Sep 20, 2021, 3:54:29 AM9/20/21
to dea...@googlegroups.com
Professor Wolfgang

OK, I will read this material and learn form it.
Thanks for the sharing.

Best,
Toddy

Wolfgang Bangerth <bang...@colostate.edu> 于2021年9月20日周一 上午11:38写道:
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages