Overview

This package contains routines to initialize reference element operators, physical mesh arrays, and connectivity arrays for nodal DG methods. The codes roughly based on Nodal Discontinuous Galerkin Methods by Hesthaven and Warburton (2007).

StartUpDG.jl is intended mainly to aid in the implementation of rhs! functions for DG discretizations of time-dependent partial differential equations, which can then be used with the OrdinaryDiffEq.jl library to evolve a solution in time. For example, it has been used in most publications since 2020 by the authors Jesse Chan and Yimin Lin, as well as in the following external publications:

It is also used in the Trixi.jl library.

A short example

using StartUpDG

# polynomial degree and mesh size
N = 3
K1D = 8

# init ref element and mesh
rd = RefElemData(Tri(), N)
VXY, EToV = uniform_mesh(Tri(), K1D)
md = MeshData(VXY, EToV, rd)

# Define a function by interpolation
(; x, y ) = md
u = @. exp(-10 * (x^2 + y^2))

# Compute derivatives using geometric mapping + chain rule
(; Dr, Ds ) = rd
(; rxJ, sxJ, J ) = md
dudx = (rxJ .* (Dr * u) + sxJ .* (Ds * u)) ./ J