MATH 676 – Finite element methods in scientifjc computing Wolfgang Bangerth, T exas A&M University http://www.dealii.org/ Wolfgang Bangerth
Lecture 17.25: Generating adaptively refjned meshes: Simple refjnement indicators http://www.dealii.org/ Wolfgang Bangerth
Adaptive mesh refjnement (AMR) Example: Intuitive goal: Use a fjne mesh only where “something is happening”. Question 1: Why? Question 2: How? http://www.dealii.org/ Wolfgang Bangerth
Why adaptive mesh refjnement (AMR)? Recall from lecture 16: For many equations, the error has a general structure similar to this: 2 | u | H 2 ∑ K h K 2 2 2 h 2 | u | 2 ‖ e ‖ H ≤ C ≤ C 1 (Ω) 2 ( K ) 2 (Ω) H In particular, this is true for elliptic (“difgusion-dominated”) second order PDEs. http://www.dealii.org/ Wolfgang Bangerth
Adaptive mesh refjnement (AMR) Approach: The optimal strategy to minimize the error while keeping the problem as small as possible is to equilibrate the local contributions e K = C h K | u | H 2 ( K ) That is, we want to choose 1 h K ∝ | u | 2 ( K ) H http://www.dealii.org/ Wolfgang Bangerth
Why adaptive mesh refjnement (AMR)? Recall from lecture 16: For many equations, the error has a general structure similar to this: 2 | u | H 2 ≤ C 2 ∑ K h K 2 ‖ e ‖ H 1 2 ( K ) Then choose the mesh size as: 1 h K ∝ | u | 2 ( K ) H In other words: T o reduce the error, we only need to make the mesh fjne where the local H 2 norm is large! http://www.dealii.org/ Wolfgang Bangerth
Why adaptive mesh refjnement (AMR)? Recall from lecture 16: For many equations, the error has a general structure similar to this: 2 | u | H 2 ≤ C 2 ∑ K h K 2 ‖ e ‖ H 1 2 ( K ) Recall: The H 2 (semi-)norm is defjned as = ∫ K | u | 2 2 +|∇ u | 2 +|∇ 2 u | 2 ‖ u ‖ H 2 ( K ) = ∫ K |∇ 2 2 u | 2 | u | 2 ( K ) H In other words: We only need to refjne where the second derivative is large (= “where something is going on”). http://www.dealii.org/ Wolfgang Bangerth
A brief derivation Why is this so: Consider the Laplace equation −Δ u = f u | ∂Ω = 0 and its weak form: fjnd so that 1 u ∈ V : = H 0 (∇ u, ∇ v )=( f ,v ) ∀ v ∈ V Discretization: Let V h be a fjnite dimensional (fjnite element) sub-space of V. Then the discrete problem reads: 1 Find so that u h ∈ V h ⊂ V = H 0 (∇ u h , ∇ v h )=( f ,v h ) ∀ v h ∈ V h ⊂ V http://www.dealii.org/ Wolfgang Bangerth
A brief derivation From the two problems (∇ u, ∇ v )=( f ,v ) ∀ v ∈ V (∇ u h , ∇ v h )=( f ,v h ) ∀ v h ∈ V h ⊂ V we can deduce “Galerkin orthogonality”: ⏟ (∇( u − u h ) , ∇ v h )= 0 ∀ v h ∈ V h ⊂ V = : e Aside – why this is called “Galerkin orthogonality”: The bilinear form (∇ f , ∇ g )= ∫ ∇ f ( x ) ⋅∇ g ( x ) dx = : ⟨ f ,g ⟩ defjnes a “scalar product” between vectors f(x) , g(x) in H 1 0 . http://www.dealii.org/ Wolfgang Bangerth
A brief derivation Next, consider the “energy norm error”: 2 = (∇( u − u h ) , ∇( u − u h )) ⏟ ‖∇( u − u h )‖ = : e Galerkin orthogonality allows us to add a zero: 2 = (∇( u − u h ) , ∇( u − u h ))+(∇( u − u h ) , ∇ v h ) ⏟ ⏟ ‖∇( u − u h )‖ = : e = 0 = (∇( u − u h ) , ∇( u − u h + v h )) This is true for any choice of fjnite element function v h ! In particular, let us choose v h = u h − I h u http://www.dealii.org/ Wolfgang Bangerth
A brief derivation Consider the “energy norm error”: 2 = (∇( u − u h ) , ∇( u − I h u )) ‖∇( u − u h )‖ Next, recall the Cauchy-Schwarz inequality: ( f ,g ) ≤ ‖ f ‖ ‖ g ‖ ∀ f ,g ∈ L 2 Consequently: 2 ≤ ‖∇ ( u − u h )‖ ‖∇( u − I h u )‖ ‖∇( u − u h )‖ ‖∇( u − u h )‖ ≤ ‖∇( u − I h u )‖ http://www.dealii.org/ Wolfgang Bangerth
A brief derivation Consider the “energy norm error”: ‖∇( u − u h )‖ ≤ ‖∇( u − I h u )‖ This is often called the “best-approximation property”. Interpretation: Intuitively, this means that the fjnite element error is no larger than the interpolation error . But: – We can't compute the interpolant without the exact solution – We can compute the fjnite element approximant http://www.dealii.org/ Wolfgang Bangerth
A brief derivation Properties of the interpolant: Consider 1 / 2 = ( ∑ K ∫ K |∇( u − I h u )| 1 / 2 ‖∇( u − I h u )‖ = ( ∫ Ω |∇( u − I h u )| 2 ) 2 ) The interpolant is defjned on each cell individually: Black: u(x) Red: I h u(x) Note: Error is large where the second derivative is large! http://www.dealii.org/ Wolfgang Bangerth
A brief derivation Properties of the interpolant: Consider 2 ) 1 / 2 = ( ∑ K ‖∇ ( u − I h u )‖ K 1 / 2 ‖∇( u − I h u )‖ = ( ∑ K ∫ K |∇( u − I h u )| 2 ) The “Bramble-Hilbert Lemma” provides the following for piecewise linear elements: 1 / 2 ≤ C h K ‖∇ ‖∇( u − I h u )‖ K = ( ∫ K |∇( u − I h u )| 2 ) 2 u ‖ K 2 ‖∇ 2 = ∑ K ‖∇( u − I h u )‖ K 2 ≤ C ∑ K h K 2 u ‖ K 2 ‖∇( u − I h u )‖ Ω Or, for general elements of polynomial degree p : 2 ≤ C ∑ K h K 2 = C ∑ K h K p + 1 ‖∇ p + 1 u ‖ K 2 p | u | H 2 ‖∇ ( u − I h u )‖ Ω p + 1 ( K ) http://www.dealii.org/ Wolfgang Bangerth
A brief derivation Taken all together: For the Laplace equation, using linear elements, the error satisfjes 2 ≤ C ∑ K h K 2 ‖∇ 2 u ‖ K 2 ‖∇( u − u h )‖ Ω This is called an “a priori” error estimate: ● We can say this about the error “up front” ● Right hand side does not involve computed solution u h ● Not useful in itself because we don't know u http://www.dealii.org/ Wolfgang Bangerth
What to do with this? Taken all together: For the Laplace equation, using linear elements, the error satisfjes 2 ≤ C ∑ K e K 2 ‖∇( u − u h )‖ Ω 2 u ‖ K e K : = h K ‖∇ How can we use this in practice: ● The e K are called “cell-wise error estimators” ● We want to have a mesh that “equilibrates” the error estimators, i.e., 1 e K ≈ const → h K ∝ 2 u ‖ K ‖∇ http://www.dealii.org/ Wolfgang Bangerth
What to do with this? Taken all together: For the Laplace equation, using linear elements, the error satisfjes 2 ≤ C ∑ K e K 2 ‖∇( u − u h )‖ Ω 2 u ‖ K e K : = h K ‖∇ How can we use this in practice: ● Can't evaluate e K because we don't know u ● But maybe we can approximate/estimate 2 u ‖ K ≈ h K ‖∇ h 2 u h ‖ K = : η K e K = h K ‖∇ using the computed solution u h ? http://www.dealii.org/ Wolfgang Bangerth
What to do with this? Idea 1: Just approximate 2 u ≈ ∇ 2 u h ∇ This does not work: ● u h is piecewise linear ● Second derivatives are zero inside cells ● Second derivatives are infjnite at cell interfaces http://www.dealii.org/ Wolfgang Bangerth
What to do with this? Idea 2: Try a fjnite difgerence approximation: + )−∇ u h ( x - ) 2 u ≈ ∇ u h ( x = [∇ u h ] i ∇ h h Where the “jump in gradient” is defjned as [∇ u h ] i : = lim ε→ 0 ∇ u h ( x i +ε)−∇ u h ( x i −ε) This does work: ● Size of the jump in gradient is an indicator of the second derivative ● Can generalize to 2 [∇ u h ] i 2 = ∫ K |∇ 2 ≈ ∑ i ∈∂ K 2 u ‖ K 2 u | ‖∇ h http://www.dealii.org/ Wolfgang Bangerth
What to do with this? Summary: We needed to approximate the cell-wise error indicator 2 ≤ C ∑ K e K 2 ‖∇( u − u h )‖ Ω 2 u ‖ K e K : = h K ‖∇ We can do this in 1d using η K : = h K ( ∑ i ∈∂ K h K ) 1 / 2 2 [∇ u h ] i and in 2d/3d using 1 / 2 1 / 2 ( ∫ ∂ K |[∇ u h ]| 2 ) η K : = h K http://www.dealii.org/ Wolfgang Bangerth
What to do with this? Aside: Why the power of h ? Consider the physical units in 1d: 1 / 2 → L ( ∫ K |∇ ⏟ 2 dx ⏟ 2 u ‖ K = h K 2 u − 1 / 2 ⏟ e K : = h K ‖∇ | ) 2 L 1 / L L Same for the approximation: 1 / 2 1 ( ∑ i ∈∂ K − 1 / 2 2 ) ⏟ ⏟ η K : = h K [∇ u h ] i → L ⏟ h K 1 / L L − 1 L http://www.dealii.org/ Wolfgang Bangerth
What to do with this? Aside: Why the power of h ? Consider the physical units in 2d: 1 / 2 → 1 ( ∫ K |∇ ⏟ 2 dx ⏟ 2 u ‖ K = h K 2 u ⏟ e K : = h K ‖∇ | ) 2 2 1 / L L L Same for the approximation: 1 / 2 → 1 ( ∫ ∂ K |[∇ u h ⏟ 1 / 2 2 dx ⏟ ⏟ η K : = h K ]| ) L 1 / 2 − 1 L L http://www.dealii.org/ Wolfgang Bangerth
What to do with this? Conclusions: If you are solving an equation for which: ● the best-approximation property holds: ‖∇( u − u h )‖ ≤ C ‖∇( u − I h u )‖ ● you are using linear elements ( Q 1 or P 1 ) Then: The indicator 1 / 2 1 / 2 ( ∫ ∂ K |[∇ u h ]| 2 ) η K : = h K is a reasonable approximation to the true error on cell K . http://www.dealii.org/ Wolfgang Bangerth
The “Kelly” error estimator Kelly, de Gago, Zienkiewicz, Babuska, 1983: For the Laplace equation, the following is indeed true: 2 ≤ C ∑ K η K 2 ‖∇( u − u h )‖ 1 / 2 1 / 2 ( ∫ ∂ K |[∇ u h ]| 2 ) η K = h K In other words: For the Laplace equation, we can even prove that our approximation leads to a correct estimate of the error! Because of this paper, η K is typically called the “Kelly error estimator”. In deal.II, it is implemented in the KellyErrorEstimator class. http://www.dealii.org/ Wolfgang Bangerth
Recommend
More recommend