Upwind finite difference schemes

The most standard scheme of solving the Hamilton-Jacobi evolution equation and reinitialisation equation is a first order upwind finite difference scheme. A forward Euler in time method is provided below via HamiltonJacobiEvolution <: LevelSetEvolution along with an upwind finite difference stencil for the spatial discretisation via FirstOrderStencil.

This can be extended in several ways. For example, higher order spatial stencils can be implemented by extending the Stencil interface below. In addition, more advanced ODE solvers could be implemented (e.g., Runge–Kutta methods) or entirely different level set evolution methods by extending the LevelSetEvolution interface below.

HamiltonJacobiEvolution

GridapTopOpt.HamiltonJacobiEvolutionType
struct HamiltonJacobiEvolution{O}

A standard forward Euler in time finite difference method for solving the Hamilton-Jacobi evolution equation and reinitialisation equation on order O finite elements in serial or parallel.

Based on the scheme by Osher and Fedkiw (link).

Parameters

  • stencil::Stencil: Spatial finite difference stencil for a single step HJ equation and reinitialisation equation.
  • model: A CartesianDiscreteModel.
  • space: FE space for level-set function
  • perm: A permutation vector
  • params: Tuple of additional params
  • cache: Stencil cache
source
GridapTopOpt.HamiltonJacobiEvolutionType
HamiltonJacobiEvolution(stencil::Stencil,model,space,tol,max_steps,max_steps_reinit)

Create an instance of HamiltonJacobiEvolution given a stencil, model, FE space, and additional optional arguments. This automatically creates the DoF permutation to handle high-order finite elements.

source
GridapTopOpt.evolve!Function
evolve!(::LevelSetEvolution,φ,args...)

Evolve the level set function φ according to an evolution method LevelSetEvolution.

source
evolve!(::Stencil,φ,vel,Δt,Δx,isperiodic,caches) -> φ

Single finite difference step of the Hamilton-Jacobi evoluation equation for a given Stencil.

source
evolve!(s::HamiltonJacobiEvolution{O},φ,vel,γ) where O

Solve the Hamilton-Jacobi evolution equation using the HamiltonJacobiEvolution.

Hamilton-Jacobi evolution equation

$\frac{\partial\phi}{\partial t} + V(\boldsymbol{x})\lVert\boldsymbol{\nabla}\phi\rVert = 0,$

with $\phi(0,\boldsymbol{x})=\phi_0(\boldsymbol{x})$ and $\boldsymbol{x}\in D,~t\in(0,T)$.

Arguments

  • s::HamiltonJacobiEvolution{O}: Method
  • φ: level set function as a vector of degrees of freedom
  • vel: the normal velocity as a vector of degrees of freedom
  • γ: coeffient on the time step size.
source
GridapTopOpt.reinit!Function
reinit!(::LevelSetEvolution,φ,args...)

Reinitialise the level set function φ according to an evolution method LevelSetEvolution.

source
reinit!(::Stencil,φ_new,φ,vel,Δt,Δx,isperiodic,caches) -> φ

Single finite difference step of the reinitialisation equation for a given Stencil.

source
reinit!(s::HamiltonJacobiEvolution{O},φ,γ) where O

Solve the reinitialisation equation using the HamiltonJacobiEvolution.

Reinitialisation equation

$\frac{\partial\phi}{\partial t} + \mathrm{sign}(\phi_0)(\lVert\boldsymbol{\nabla}\phi\rVert-1) = 0,$

with $\phi(0,\boldsymbol{x})=\phi_0(\boldsymbol{x})$ and $\boldsymbol{x}\in D,~t\in(0,T)$.

Arguments

  • s::HamiltonJacobiEvolution{O}: Method
  • φ: level set function as a vector of degrees of freedom
  • γ: coeffient on the time step size.
source

Spatial stencils for HamiltonJacobiEvolution

Custom Stencil

GridapTopOpt.StencilType
abstract type Stencil

Finite difference stencil for a single step of the Hamilton-Jacobi evolution equation and reinitialisation equation.

Your own spatial stencil can be implemented by extending the methods below.

source
GridapTopOpt.evolve!Method
evolve!(::Stencil,φ,vel,Δt,Δx,isperiodic,caches) -> φ

Single finite difference step of the Hamilton-Jacobi evoluation equation for a given Stencil.

source
GridapTopOpt.reinit!Method
reinit!(::Stencil,φ_new,φ,vel,Δt,Δx,isperiodic,caches) -> φ

Single finite difference step of the reinitialisation equation for a given Stencil.

source
GridapTopOpt.check_orderFunction
check_order(::Stencil,order)

Throw error if insufficient reference element order to implement stencil in parallel.

source