Difference between revisions of "Adaptivity"

From Medusa: Coordinate Free Mehless Method implementation
Jump to: navigation, search
(L shaped domain)
 
(32 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
Go back to [[Medusa#Examples|Examples]].
 
Go back to [[Medusa#Examples|Examples]].
  
 +
{{Box-round|title= Related papers |
 +
[https://e6.ijs.si/ParallelAndDistributedSystems/publications/32230439.pdf J. Slak, G. Kosec; Adaptive radial basis function-generated finite differences method for contact problems, International journal for numerical methods in engineering, vol. 119, 2019 [DOI: 10.1002/nme.6067]]
 +
}}
  
 +
__TOC__
  
__FORCETOC__
+
Solutions to many physical problems governed by partial differential equations (PDE) often significantly vary in magnitude throughout the problem domain. Although in some special cases the areas with high error are known in advance, in general the error distribution is unknown beforehand. Adaptive techniques for solving PDEs are a standard way of dealing with this problem, where problematic regions are iteratively refined. A step further is automatic adaptivity, where problematic regions are chosen automatically using an error indicator and then refined, until certain error threshold is reached. Below, we show some examples of fully automatic adaptivity in Medusa.
 
 
 
==  Basic concept ==
 
==  Basic concept ==
  
 
The adaptive methodology in this paper behaves similarly to "remeshing" used commonly in FEM.  
 
The adaptive methodology in this paper behaves similarly to "remeshing" used commonly in FEM.  
Some initial (possibly variable) nodal spacing $h^0$ is chosen, as well as its lower and upper bounds $h_L$ and  $h_U$, respectively. 3
+
Some initial (possibly variable) nodal spacing $h^0$ is chosen, as well as its lower and upper bounds $h_L$ and  $h_U$, respectively.  
 
Domain $\Omega$ is filled with nodes, conforming to $h^0$ and the solution $u^0$ is obtained.  
 
Domain $\Omega$ is filled with nodes, conforming to $h^0$ and the solution $u^0$ is obtained.  
 
An error indicator is employed to determine which nodes should be (de)refined and the nodal density $h^0$ is altered appropriately.  
 
An error indicator is employed to determine which nodes should be (de)refined and the nodal density $h^0$ is altered appropriately.  
Line 21: Line 24:
 
</ol>
 
</ol>
  
More details can be found in our paper: [https://arxiv.org/abs/1811.10368 https://arxiv.org/abs/1811.10368]
+
More details can be found in our paper <ref name="SlakAdaptive">Slak, J., & Kosec, G. Adaptive radial basis function‐generated finite differences method for contact problems. International Journal for Numerical Methods in Engineering, 2019.</ref>.
  
 
== Node density adaptation ==
 
== Node density adaptation ==
Line 39: Line 42:
 
and $\alpha$ represents the refine aggressiveness, $\beta$ the derefine aggressiveness, $\varepsilon$ the refinement threshold, $\eta$ the derenfinement threshold,
 
and $\alpha$ represents the refine aggressiveness, $\beta$ the derefine aggressiveness, $\varepsilon$ the refinement threshold, $\eta$ the derenfinement threshold,
 
and $m = \min_i  \varepsilon_i$ is the minimal and  $M = \max_i  \varepsilon_i$ is the maximal value of the error indicator.  
 
and $m = \min_i  \varepsilon_i$ is the minimal and  $M = \max_i  \varepsilon_i$ is the maximal value of the error indicator.  
Note that setting $\alpha=1$ or $\beta=1$ disables refinement and derefinement, respectively.  
+
Note that setting $\alpha=1$ or $\beta=1$ disables refinement and derefinement, respectively.
  
 +
This adaptation is illustrated in the figure below.
 +
 +
[[File:density_change.png|1193px]]
  
 
== Error indicators ==
 
== Error indicators ==
Line 51: Line 57:
  
 
The errors $e_1$, $e_2$, $e_\infty$ and $e_E$ refer to relative discrete $L^1$, $L^2$, $L_\infty$ and energy norm errors, respectively. These are evaluated in the computation nodes or on a denser grid by reinterpolation.
 
The errors $e_1$, $e_2$, $e_\infty$ and $e_E$ refer to relative discrete $L^1$, $L^2$, $L_\infty$ and energy norm errors, respectively. These are evaluated in the computation nodes or on a denser grid by reinterpolation.
 +
 +
Relative node density $\rho_i$ is calculated by computing the distances $d_i$ from each node to its closest neighbour and expressing them as the logarithmic ratio against the maximal distance: $\rho_i = -\log_2(d_i / \max_j d_j)$.
  
 
=== L shaped domain ===
 
=== L shaped domain ===
  
The L shaped domain problem  is defined on $\Omega = [-1, 1]^2 \setminus [0, 1] \times [-1, 0]$. The Laplace problem $$\nabla^2u = 0$ with the solution $u = r^{\frac{2}{3}} \sin(\frac{2}{3}\theta)$ given in polar coordinates.
+
The L shaped domain problem  is defined on $\Omega = [-1, 1]^2 \setminus [0, 1] \times [-1, 0]$. The Laplace problem $\nabla^2u = 0$ with the solution $u = r^{\frac{2}{3}} \sin(\frac{2}{3}\theta)$ given in polar coordinates.
  
BF-FD method with Polyharmonic splines augmented with monomials up to and including 2nd order was used to approximate the differential operators. The stencils for each node were chosen by simply selecting the closest $n=15$ nodes. The resulting sparse system was solved using the Intel ® MKL Pardiso sparse solver. Both uniform and fully adaptive refinement was tested. The adaptive procedure was run with $\alpha=3$, $\varepsilon = 10^-2$, $\beta=1$ and $\eta=0$.
+
BF-FD method with Polyharmonic splines augmented with monomials up to and including 2nd order was used to approximate the differential operators. The stencils for each node were chosen by simply selecting the closest $n=15$ nodes. The resulting sparse system was solved using the Intel ® MKL Pardiso sparse solver. Both uniform and fully adaptive refinement was tested. The adaptive procedure was run with $\alpha=3$, $\varepsilon = 10^{-2}$, $\beta=1$ and $\eta=0$.
  
The errors under uniform and adaptive refinement are shown below.
+
The errors under uniform (left) and adaptive (right) refinement are shown below.
  
 
[[File:L_shape_uniform_error.png|500px]][[File:L_shape_adaptive_error.png|500px]]
 
[[File:L_shape_uniform_error.png|500px]][[File:L_shape_adaptive_error.png|500px]]
  
The error and the nodal density during the adaptive iteration are shown below.
+
The error (left) and the nodal density (right) during the adaptive iteration are shown below.
  
 
[[File:L_shape_progress.png|600px]]
 
[[File:L_shape_progress.png|600px]]
  
 
=== Disk under stress ===
 
=== Disk under stress ===
 +
 +
The next case is disk under pressure case from [[Linear elasticity]] solving the Caucy-Navier equation of [[Solid Mechanics]].
 +
The problem considers one quarter of the disk illustrated below by the domain $\Omega$. The spacing $\gamma$ represents the distance from the singularity.
 +
 +
[[File:disk.png|350px]]
 +
 +
Computed $\sigma_{xy}$ stress profiles for three considered cases. The lower three images show close-ups of the computed peaks.
 +
 +
[[File:disk_profiles.png|1050px]]
 +
 +
Error of the numerical solution of the compressed disk problem during adaptive iteration.
 +
 +
[[File:disk_error.png|977px]]
 +
 +
Error indicator value and node density in the last iteration.
 +
 +
[[File:disk_err_den.png|695px]]
 +
 +
Comparison of uniform and adaptive refinement.
 +
 +
[[File:disk_uni_ada_err.png|971px]]
  
 
=== Hertzian contact ===
 
=== Hertzian contact ===
 +
 +
See [[Hertzian_contact]] for the description.
 +
 +
Errors and node counts during adaptive iteration for the solution of the Hertzian problem. Observe the initial decrease due to derefinement.
 +
 +
[[File:her_err_n.png|921px]]
 +
 +
Top surface stress profiles during the iteration. Only even iterations are shown for brevity.
 +
 +
[[File:her_profile.png|840px]]
 +
 +
Comparing adaptive (left) and manual (right) nodal distributions densities for the Hertzian problem. The manual density was used in the refinement paper<ref name="SlakRef">Slak, J., & Kosec, G. (2019). Refined Meshless Local Strong Form solution of Cauchy–Navier equation on an irregular domain. Engineering analysis with boundary elements, 100, 3-13.</ref>.
 +
 +
[[File:her_density.png|906px]]
  
 
=== Fretting fatigue contact ===
 
=== Fretting fatigue contact ===
  
=== Bousinesq problem ===
+
See [[Fretting fatigue case]] for the description.
 +
 
 +
Surface traction $\sigma_{xx}$ under contact in four subsequent adaptive iterations during the solution of the fretting fatigue problem.
 +
 
 +
[[File:fwo_profiles.png|627px]]
 +
 
 +
Nodes of four subsequent adaptive iterations during the solution of the fretting fatigue problem, coloured by von Mises stress.
 +
 
 +
[[File:fwo_iters.png|819px]]
 +
 
 +
Error of surface traction using two reference solutions.
 +
 
 +
[[File:fwo_error.png|505px]]
 +
 
 +
=== Bousinesq's problem ===
 +
 
 +
See [[Linear_elasticity#Point_contact_3D]] for more details.
 +
 
 +
Error with respect to the number of nodes in the adaptive iteration of the solution of the Boussinesq's problem.
 +
The right axis shows the number of computational nodes.
 +
 
 +
[[File:bou_err.png|778px]]
 +
 
 +
Stress profiles along the body diagonal from $[-1, -1, -1]$ to $[-\gamma, -\gamma, -\gamma]$ in adaptive iteration when solving the
 +
Boussinesq's problem.
 +
 
 +
[[File:bou_profile.png|1063px]]
 +
 
 +
The obtained solution in the final iteration with an enlarged portion around the contact area. Both solutions are
 +
plotted only in the computation nodes to also show the final nodal distribution. Nodes are coloured proportional to computed
 +
values of von Mises stress.
 +
 
 +
[[File:bou_sol.png|1165px]]
  
 
=== Helmholz equation ===
 
=== Helmholz equation ===
 +
 +
The equation $\nabla^2 u + \frac{1}{(\alpha+r)^4} u = f$ with the solution $u = sin(\frac{1}{\alpha+r})$ is solved adaptively. The value $\alpha = \frac{1}{5\pi}$ was used and the right hand side $f$ was computed from $u$.
 +
 +
Error under uniform (left) and adaptive (right) refinement.
 +
 +
[[File:osc2d_uniform_error.png|500px]][[File:osc2d_adaptive_error.png|500px]]
 +
 +
Solution and the nodal density in the final iteration.
 +
 +
[[File:osc2d_adaptive_sol.png|500px]][[File:osc2d_adaptive_den.png|500px]]
 +
 +
Error under adaptive refinement for the 3D equation.
 +
 +
[[File:osc3d_adaptive_error.png|500px]]
 +
 +
Solution and the nodal density in the final iteration of the 3D solution.
 +
 +
[[File:osc3d_adaptive_sol.png|500px]][[File:osc3d_adaptive_den.png|500px]]
 +
 +
=References=
 +
<references/>
  
  
 
Go back to [[Medusa#Examples|Examples]].
 
Go back to [[Medusa#Examples|Examples]].

Latest revision as of 18:03, 4 December 2022

Go back to Examples.

edit 

Related papers

J. Slak, G. Kosec; Adaptive radial basis function-generated finite differences method for contact problems, International journal for numerical methods in engineering, vol. 119, 2019 [DOI: 10.1002/nme.6067]


Solutions to many physical problems governed by partial differential equations (PDE) often significantly vary in magnitude throughout the problem domain. Although in some special cases the areas with high error are known in advance, in general the error distribution is unknown beforehand. Adaptive techniques for solving PDEs are a standard way of dealing with this problem, where problematic regions are iteratively refined. A step further is automatic adaptivity, where problematic regions are chosen automatically using an error indicator and then refined, until certain error threshold is reached. Below, we show some examples of fully automatic adaptivity in Medusa.

Basic concept

The adaptive methodology in this paper behaves similarly to "remeshing" used commonly in FEM. Some initial (possibly variable) nodal spacing $h^0$ is chosen, as well as its lower and upper bounds $h_L$ and $h_U$, respectively. Domain $\Omega$ is filled with nodes, conforming to $h^0$ and the solution $u^0$ is obtained. An error indicator is employed to determine which nodes should be (de)refined and the nodal density $h^0$ is altered appropriately. This adaptive cycle below is repeated until the convergence criterion is met. The procedure on $j$-th iteration is written in more detail below:

  1. Fill $\Omega$ with nodes conforming to $h^j$.
  2. Solve the problem to obtain $u^j$.
  3. Compute the error indicator values $\varepsilon_i^j$ for each node $p_i$.
  4. If the mean of $\varepsilon_i^j$ is below some tolerance $\varepsilon$ return $u^j$ as the solution and stop.
  5. Adapt $h^j$ to obtain $h^{j+1}$.

More details can be found in our paper [1].

Node density adaptation

The existing nodal spacing function $h^j$ is evaluated at nodes $p_i$ to obtain values $h_{i,j} = h^j(p_i)$ . These values $h_{i,j}$ are modified by a density factor $f_i$ as $$ h_{i,j+1} = \min(\max(h_{i,j} / f_i, h_L(p_i)), h_U(p_i)), $$ where density factor $f_i$ is computed as $$ f_i = \begin{cases} 1 + \frac{\eta - \varepsilon_i}{\eta - m} (\frac{1}{\beta} - 1), & \varepsilon_i \leq \eta, \quad \text{i.e. decrease the density} \\ 1, & \eta < \varepsilon_i < \varepsilon, \quad \text{i.e. no change in density}\\ 1 + \frac{\varepsilon_i - \varepsilon}{M - \varepsilon} (\alpha - 1), & \varepsilon_i \geq \varepsilon, \quad \text{i.e. increase the density} \end{cases} $$ and $\alpha$ represents the refine aggressiveness, $\beta$ the derefine aggressiveness, $\varepsilon$ the refinement threshold, $\eta$ the derenfinement threshold, and $m = \min_i \varepsilon_i$ is the minimal and $M = \max_i \varepsilon_i$ is the maximal value of the error indicator. Note that setting $\alpha=1$ or $\beta=1$ disables refinement and derefinement, respectively.

This adaptation is illustrated in the figure below.

Density change.png

Error indicators

The work on error indicators is ongoing. For now, we use an ad hoc error indicator $$\varepsilon_i = \operatorname{std}_{j \in I_i}(u_j),$$ which represents the standard deviation of function values over all stencil nodes of a given node $p_i$.

Numerical exmaples

Below are several numerical examples where adaptivity has been tested or used to obtain solutions.

The errors $e_1$, $e_2$, $e_\infty$ and $e_E$ refer to relative discrete $L^1$, $L^2$, $L_\infty$ and energy norm errors, respectively. These are evaluated in the computation nodes or on a denser grid by reinterpolation.

Relative node density $\rho_i$ is calculated by computing the distances $d_i$ from each node to its closest neighbour and expressing them as the logarithmic ratio against the maximal distance: $\rho_i = -\log_2(d_i / \max_j d_j)$.

L shaped domain

The L shaped domain problem is defined on $\Omega = [-1, 1]^2 \setminus [0, 1] \times [-1, 0]$. The Laplace problem $\nabla^2u = 0$ with the solution $u = r^{\frac{2}{3}} \sin(\frac{2}{3}\theta)$ given in polar coordinates.

BF-FD method with Polyharmonic splines augmented with monomials up to and including 2nd order was used to approximate the differential operators. The stencils for each node were chosen by simply selecting the closest $n=15$ nodes. The resulting sparse system was solved using the Intel ® MKL Pardiso sparse solver. Both uniform and fully adaptive refinement was tested. The adaptive procedure was run with $\alpha=3$, $\varepsilon = 10^{-2}$, $\beta=1$ and $\eta=0$.

The errors under uniform (left) and adaptive (right) refinement are shown below.

L shape uniform error.pngL shape adaptive error.png

The error (left) and the nodal density (right) during the adaptive iteration are shown below.

L shape progress.png

Disk under stress

The next case is disk under pressure case from Linear elasticity solving the Caucy-Navier equation of Solid Mechanics. The problem considers one quarter of the disk illustrated below by the domain $\Omega$. The spacing $\gamma$ represents the distance from the singularity.

Disk.png

Computed $\sigma_{xy}$ stress profiles for three considered cases. The lower three images show close-ups of the computed peaks.

Disk profiles.png

Error of the numerical solution of the compressed disk problem during adaptive iteration.

Disk error.png

Error indicator value and node density in the last iteration.

Disk err den.png

Comparison of uniform and adaptive refinement.

Disk uni ada err.png

Hertzian contact

See Hertzian_contact for the description.

Errors and node counts during adaptive iteration for the solution of the Hertzian problem. Observe the initial decrease due to derefinement.

Her err n.png

Top surface stress profiles during the iteration. Only even iterations are shown for brevity.

Her profile.png

Comparing adaptive (left) and manual (right) nodal distributions densities for the Hertzian problem. The manual density was used in the refinement paper[2].

Her density.png

Fretting fatigue contact

See Fretting fatigue case for the description.

Surface traction $\sigma_{xx}$ under contact in four subsequent adaptive iterations during the solution of the fretting fatigue problem.

Fwo profiles.png

Nodes of four subsequent adaptive iterations during the solution of the fretting fatigue problem, coloured by von Mises stress.

Fwo iters.png

Error of surface traction using two reference solutions.

Fwo error.png

Bousinesq's problem

See Linear_elasticity#Point_contact_3D for more details.

Error with respect to the number of nodes in the adaptive iteration of the solution of the Boussinesq's problem. The right axis shows the number of computational nodes.

Bou err.png

Stress profiles along the body diagonal from $[-1, -1, -1]$ to $[-\gamma, -\gamma, -\gamma]$ in adaptive iteration when solving the Boussinesq's problem.

Bou profile.png

The obtained solution in the final iteration with an enlarged portion around the contact area. Both solutions are plotted only in the computation nodes to also show the final nodal distribution. Nodes are coloured proportional to computed values of von Mises stress.

Bou sol.png

Helmholz equation

The equation $\nabla^2 u + \frac{1}{(\alpha+r)^4} u = f$ with the solution $u = sin(\frac{1}{\alpha+r})$ is solved adaptively. The value $\alpha = \frac{1}{5\pi}$ was used and the right hand side $f$ was computed from $u$.

Error under uniform (left) and adaptive (right) refinement.

Osc2d uniform error.pngOsc2d adaptive error.png

Solution and the nodal density in the final iteration.

Osc2d adaptive sol.pngOsc2d adaptive den.png

Error under adaptive refinement for the 3D equation.

Osc3d adaptive error.png

Solution and the nodal density in the final iteration of the 3D solution.

Osc3d adaptive sol.pngOsc3d adaptive den.png

References

  1. Slak, J., & Kosec, G. Adaptive radial basis function‐generated finite differences method for contact problems. International Journal for Numerical Methods in Engineering, 2019.
  2. Slak, J., & Kosec, G. (2019). Refined Meshless Local Strong Form solution of Cauchy–Navier equation on an irregular domain. Engineering analysis with boundary elements, 100, 3-13.


Go back to Examples.