ArticlePDF Available

Supplementary materials: Hierarchical a posteriori error estimation of Bank-Weiser type in the FEniCS Project

Authors:
Supplementary materials: Hierarchical a posteriori error
estimation of Bank–Weiser type in the FEniCS Project
Raphaël BulleJack S. HaleAlexei LozinskiStéphane P. A. Bordas
Franz Chouly§
February 10, 2021
1 Indicative snippet of error estimation for Poisson equation
using Bank–Weiser estimator
We present here a snippet of DOLFIN Python code showing function to compute the error of a
Poisson problem using the Bank–Weiser estimator.
from dolfin import *
import fenics_error_estimation
def estimate(u_h):
"""Bank-Weiser error estimation procedure for the Poisson problem.
Parameters
-----------
u_h: dolfin.Function
Solution of Poisson problem.
Returns
-------
The error estimate on each cell of the mesh.
"""
mesh = u_h.function_space().mesh()
# Higher order space
element_f = FiniteElement("DG", triangle, 2)
# Low order space
element_g = FiniteElement("DG", triangle, 1)
Raphaël Bulle would like to acknowledge the support of the ASSIST research project of the University of
Luxembourg. This publication has been prepared in the framework of the DRIVEN project funded by the European
Union’s Horizon 2020 Research and Innovation programme under Grant Agreement No. 811099.
Institute of Computational Engineering, University of Luxembourg, 6 Avenue de la Fonte, 4362 Esch-sur-Alzette,
Luxembourg (raphael.bulle@uni.lu,stephane.bordas@uni.lu,jack.hale@uni.lu)
Laboratoire de Mathématiques de Besançon, UMR CNRS 6623, Université de Bourgogne Franche-Comté, 16
route de Gray, 25030 Besançon Cedex, France (alexei.lozinski@univ-fcomte.fr)
§Université de Bourgogne Franche-Comté, Institut de Mathématiques de Bourgogne, 21078 Dijon, France
(franz.chouly@u-bourgogne.fr)
1
# Construct the Bank-Weiser interpolation operator according to the
# definition of the high and low order spaces.
N = fenics_error_estimation.create_interpolation(element_f, element_g)
V_f = FunctionSpace(mesh, element_f)
e = TrialFunction(V_f)
v = TestFunction(V_f)
f = Constant(0.0)
# Homogeneous zero Dirichlet boundary conditions
bcs = DirichletBC(V_f, Constant(0.0), "on_boundary", "geometric")
# Define the local Bank-Weiser problem on the full higher order space
n = FacetNormal(mesh)
a_e = inner(grad(e), grad(v))*dx
# Residual
L_e = inner(f + div(grad(u_h)), v)*dx + \
inner(jump(grad(u_h), -n), avg(v))*dS
# Local solves on the implied Bank-Weiser space. The solution is returned
# on the full space.
e_h = fenics_error_estimation.estimate(a_e, L_e, N, bcs)
# Estimate of global error
error = norm(e_h, "H10")
# Computation of local error indicator.
V_e = FunctionSpace(mesh, "DG", 0)
v = TestFunction(V_e)
eta_h = Function(V_e, name="eta_h")
# By testing against v in DG_0 this effectively computes
# the estimator on each cell.
eta = assemble(inner(inner(grad(e_h), grad(e_h)), v)*dx)
eta_h.vector()[:] = eta
return eta_h
2
2 Indicative snippet of error estimation for linear elasticity
equations using Poisson estimator
We give here a snippet of DOLFIN Python code showing function to compute the error of a two-
dimensional linear elasticity problem (discretized with Taylor–Hood element) using the Poisson
estimator, based on our implementation of the Bank–Weiser estimator.
import scipy.linalg as sp.linalg
from dolfin import *
import fenics_error_estimation
def estimate(w_h, mu, lmbda):
"""
Parameters
-----------
w_h: dolfin.Function
Solution of the linear elasticity problem.
mu: float
First Lamé coefficient.
lmbda: float
Second Lamé coefficient.
Returns
-------
The error estimate on each cell of the mesh.
"""
mesh = w_h.function_space().mesh()
u_h = w_h.sub(0)
p_h = w_h.sub(1)
# Vectorial high order space.
X_element_f = VectorElement('DG', triangle, 3)
# Scalar high order and low order spaces.
S_element_f = FiniteElement('DG', triangle, 3)
S_element_g = FiniteElement('DG', triangle, 2)
# Construct the scalar projection matrix according to the definition
# of the high and low order spaces.
N_S = create_interpolation(S_element_f, S_element_g)
# Construct the vectorial projection matrix as a block diagonal, each
# block corresponding to a scalar problem.
N_X = sp.linalg.block_diag(N_S, N_S)
f = Constant((0., 0.))
X_f = FunctionSpace(mesh, X_element_f)
e_X = TrialFunction(X_f)
v_X = TestFunction(X_f)
# Homogeneous zero Dirichlet boundary conditions.
3
bcs = DirichletBC(X_f, Constant((0., 0.)), 'on_boundary','geometric')
# Cell residual.
R_T = f + div(2.*mu*sym(grad(u_h))) - grad(p_h)
# Facet residual.
n = FacetNormal(mesh)
R_E = (1./2.)*jump(p_h*Identity(2) - 2.*mu*sym(grad(u_h)), -n)
# Local Poisson problem.
a_X_e = 2.*mu*inner(grad(e_X), grad(v_X))*dx
L_X_e = inner(R_K, v_X)*dx - inner(R_E, avg(v_X))*dS
# Solve Poisson equation locally on implicit Bank--Weiser space.
e_h = fenics_error_estimation.estimate(a_X_e, L_X_e, N_X, bcs)
# Cell residual.
rho_d = 1./(lmbda**(-1)+(2.*mu)**(-1))
r_T = rho_d*(div(u_h) + lmbda**(-1)*p_h)
# Computation of local error indicator.
V_e = FunctionSpace(mesh, 'DG', 0)
v = TestFunction(V_e)
eta_h = Function(V_e)
# By testing against v in DG_0 this effectively computes the estimator
# on each cell.
eta = assemble(2.*mu*inner(inner(grad(e_h), grad(e_h)), v)*dx + \
rho_d**(-1)*inner(inner(eps_h, eps_h), v)*dx)
eta_h.vector()[:] = eta
return eta_h
4
... 4. Finally, we refine the triangulation using the Plaza-Carey algorithm present in FEn-iCS [209]. Details on the implementations can be found in [74,75,77]. ...
... Our method leads to a fully local and parallelizable solution technique for the spectral fractional Laplacian with computable L 2 error. Our method is valid for any finite element degree (however, for the sake of brevity we do not show results with higher degree finite elements) and for one, two and three dimensional problems [77]. ...
... In addition, its computational stencil is highly local which is particularly appealing for three-dimensional problems see e.g. [77]. ...
Thesis
Full-text available
This manuscript is concerned with a posteriori error estimation for the finite element discretization of standard and fractional partial differential equations as well as an application of fractional calculus to the modeling of the human meniscus by poro-elasticity equations. In the introduction, we give an overview of the literature of a posteriori error estimation in finite element methods and of adaptive refinement methods. We emphasize the state–of–the–art of the Bank–Weiser a posteriori error estimation method and of the adaptive refinement methods convergence results. Then, we move to fractional partial differential equations. We give some of the most common discretization methods of fractional Laplacian operator based equations. We review some results of a priori error estimation for the finite element discretization of these equations and give the state–of– the–art of a posteriori error estimation. Finally, we review the literature on the use of the Caputo’s fractional derivative in applications, focusing on anomalous diffusion and poro-elasticity applications. The rest of the manuscript is organized as follow. Chapter 1 is concerned with a proof of the reliability of the Bank–Weiser estimator for three–dimensional problems, extending a result from the literature. In Chapter 2 we present a numerical study of the Bank–Weiser estimator, provide a novel implementation of the estimator in the FEniCS finite element software and apply it to a variety of elliptic equations as well as goal-oriented error estimation. In Chapter 3 we derive a novel a posteriori estimator for the L2 error induced by the finite element discretization of fractional Laplacian operator based equations. In Chapter 4 we present new theoretical results on the convergence of a rational approximation method with consequences on the approximation of fractional norms as well as a priori error estimation results for the finite element discretization of fractional equations. Finally, in Chapter 5 we provide an application of fractional calculus to the study of the human meniscus via poro-elasticity equations.
... To help the definition of a node selection criterion, we presented the computed error indicator, sorted from the lowest error to the highest error in Figure 21 We observe three distinct zones from the results presented in Figure 21. This approach has similarities with the Dörfler marking strategy [52] used in the framework of adaptive finite element method [53]. ...
Preprint
Full-text available
Computer Aided Design (CAD) is widely used in the creation and optimization of various industrial systems and processes. Transforming a CAD geometry into a computational discretization that be used to solve PDEs requires care and a deep knowledge of the selected computational method. In this article, we present a novel integrated collocation scheme based on smart clouds. It allows us to transform a CAD geometry into a complete point collocation model, aware of the base geometry, with minimum effort. For this process, only the geometry of the domain, in the form of a STEP file, and the boundary conditions are needed. We also introduce an adaptive refinement process for the resultant smart cloud using an \textit{a posteriori} error indication. The scheme can be applied to any 2D or 3D geometry, to any PDE and can be applied to most point collocation approaches. We illustrate this with the meshfree Generalized Finite Difference (GFD) method applied to steady linear elasticity problems. We further show that each step of this process, from the initial discretization to the refinement strategy, is connected and is affected by the approach selected in the previous step, thus requiring an integrated scheme where the whole solution process should be considered at once.
... The impact of the selected threshold on the convergence rate is analyzed in a later section (see Section 3.4.4). This approach has similarities with the Dörfler marking strategy [58] used in the framework of adaptive finite element method [59]. ...
Article
Computer Aided Design (CAD) is widely used in the creation and optimization of various industrial systems and processes. Transforming a CAD geometry into a computational discretization that be used to solve PDEs requires care and a deep knowledge of the selected computational method. In this article, we present a novel integrated collocation scheme based on smart clouds. It allows us to transform a CAD geometry into a complete point collocation model, aware of the base geometry, with minimum effort. For this process, only the geometry of the domain, in the form of a STEP file, and the boundary conditions are needed. We also introduce an adaptive refinement process for the resultant smart cloud using an a posteriori error indication. The scheme can be applied to any 2D or 3D geometry, to any PDE and can be applied to most point collocation approaches. We illustrate this with the meshfree Generalized Finite Difference (GFD) method applied to steady linear elasticity problems. We further show that each step of this process, from the initial discretization to the refinement strategy, is connected and is affected by the approach selected in the previous step, thus requiring an integrated scheme where the whole solution process should be considered at once.
Article
We present an easily accessible, object oriented code (written exclusively in Matlab) for adaptive finite element simulations in 2D. It features various refinement routines for triangular meshes as well as fully vectorized FEM ansatz spaces of arbitrary polynomial order and allows for problems with very general coefficients. In particular, our code can handle problems typically arising from iterative linearization methods used to solve nonlinear PDEs. Due to the object oriented programming paradigm, the code can be used easily and is readily extensible. We explain the basic principles of our code and give numerical experiments that underline its flexibility as well as its efficiency.
ResearchGate has not been able to resolve any references for this publication.