Module SpatialDiscretizations

The SpatialDiscretizations module defines the discretization on the reference element and provides the geometric data relating to the mesh and the mapping from reference to physical space.

Overview

Discretizations in StableSpectralElements.jl are constructed by first building a local approximation on a canonical reference element, denoted generically as $\hat{\Omega} \subset \mathbb{R}^d$, and using a bijective transformation $\bm{X}^{(\kappa)} : \hat{\Omega} \rightarrow \Omega^{(\kappa)}$ to construct the approximation on each physical element $\Omega^{(\kappa)} \subset \Omega$ of the mesh $\{ \Omega^{(\kappa)}\}_{\kappa \in \{1:N_e\}}$ in terms of the associated operators on the reference element. An example of such a mapping is shown below, where we also depict the collapsed coordinate transformation $\bm{\chi} : [-1,1]^d \to \hat{\Omega}$ which may be used to construct operators with a tensor-product structure on the reference simplex.

Mesh mapping

In order to define the different geometric reference elements, the subtypes Line, Quad, Hex, Tri, and Tet of AbstractElemShape from StartUpDG.jl are used and re-exported by StableSpectralElements.jl, representing the following reference domains:

\[\begin{aligned} \hat{\Omega}_{\mathrm{line}} &= [-1,1],\\ \hat{\Omega}_{\mathrm{quad}} &= [-1,1]^2,\\ \hat{\Omega}_{\mathrm{hex}} & = [-1,1]^3, \\ \hat{\Omega}_{\mathrm{tri}} &= \big\{ \bm{\xi} \in [-1,1]^2 : \xi_1 + \xi_2 \leq 0 \big\},\\ \hat{\Omega}_{\mathrm{tet}} &= \big\{ \bm{\xi} \in [-1,1]^3 : \xi_1 + \xi_2 + \xi_3 \leq -1 \big\}. \end{aligned}\]

These element types are used in the constructor for StableSpectralElements.jl's ReferenceApproximation type, along with a subtype of AbstractApproximationType (NodalTensor, ModalTensor, NodalMulti, ModalMulti, NodalMultiDiagE, or ModalMultiDiagE) specifying the nature of the local approximation.

All the information used to define the spatial discretization on the physical domain $\Omega$ is contained within a SpatialDiscretization structure, which is constructed using a ReferenceApproximation and a MeshData from StartUpDG.jl. When the constructor for a SpatialDiscretization is called, the grid metrics are computed and stored in a field of type GeometricFactors.

Reference

StableSpectralElements.SpatialDiscretizations.GeometricFactorsType
GeometricFactors(J_q::Matrix{Float64}, 
                 Λ_q::Array{Float64, 4}, 
                 J_f::Matrix{Float64},
                 nJf::Array{Float64, 3},
                 nJq::Array{Float64, 4})

Nodal values of geometric factors used by the solver to construct discretizations on the physical element. Contains the following fields:

  • J_q::Matrix{Float64}: Jacobian determinant $J$ of the mapping from reference coordinates $\bm{\xi} \in \hat{\Omega}$ to physical coordinates $\bm{x} \in \Omega^{(\kappa)}$ at volume quadrature nodes; first dimension is node index (size N_q), second is element index (size N_e)
  • Λ_q::Array{Float64, 4}: Metric terms $J \partial \xi_l / \partial x_m$ at volume quadrature nodes; first index is node index (size N_q), next two are $l$ and $m$ (size d), last is element index (size N_e)
  • J_f::Matrix{Float64}: Facet area element at facet quadrature nodes; first index is node index (size N_f), second is element index (size N_e)
  • nJf::Array{Float64, 3}: Scaled surface normal vector at facet quadrature nodes; first index is component of normal vector (size d), second is node index (size N_f), third is element index (size N_e)
  • nJq::Array{Float64, 4}: Scaled surface normal vector to a given facet computed using the volume metrics (used in flux differencing); first index is component of normal vector (size d), second component is reference facet index, third is volume quadrature node index (size N_q), last is element index (size N_e)
Note

When using sum-factorization algorithms in collapsed coordinates with a StandardForm solver and a ReferenceOperator strategy, apply_reference_mapping! overwrites Λ_q to contain the metrics associated with the composite mapping from $[-1,1]^d$ to $\Omega^{(\kappa)}$. See (6.2) and (6.3) in the following paper:

  • T. Montoya and D. W. Zingg (2024). Efficient tensor-product spectral-element operators with the summation-by-parts property on curved triangles and tetrahedra. SIAM Journal on Scientific Computing 46(4):A2270-A2297.
source
StableSpectralElements.SpatialDiscretizations.ModalMultiType
ModalMulti(p::Int)

Approximation type for a modal formulation of polynomial degree $p$ based on multidimensional volume and facet quadrature rules (generalized Vandermonde, derivative and interpolation/extrapolation operators are all dense). Currently supports Tri and Tet element types.

source
StableSpectralElements.SpatialDiscretizations.ModalMultiDiagEType
ModalMultiDiagE(p::Int)

Approximation type for a modal formulation based on a multidimensional volume quadrature rule of polynomial degree $p$ including nodes collocated with those used for facet integration (generalized Vandermonde and derivative operators are dense, interpolation/ extrapolation operator picks out values at facet quadrature nodes). Currently supports only the Tri element type.

source
StableSpectralElements.SpatialDiscretizations.ModalTensorType
ModalTensor(p::Int)

Approximation type for a modal formulation of polynomial degree $p$ based on tensor-product volume and facet quadrature rules (generalized Vandermonde matrix is not necessarily identity, derivative and interpolation/extrapolation operators have tensor-product structure). Currently supports Tri and Tet element types.

source
StableSpectralElements.SpatialDiscretizations.NodalMultiType
NodalMulti(p::Int)

Approximation type for a nodal formulation based on multidimensional volume and facet quadrature rules (generalized Vandermonde matrix is identity, derivative and interpolation/extrapolation operators are dense). Currently supports Tri and Tet element types.

source
StableSpectralElements.SpatialDiscretizations.NodalMultiDiagEType
NodalMultiDiagE(p::Int)

Approximation type for a nodal formulation of polynomial degree $p$ based on a multidimensional volume quadrature rule including nodes collocated with those used for facet integration (generalized Vandermonde matrix is identity, derivative operator is dense, interpolation/extrapolation operator picks out values at facet quadrature nodes). Currently supports only the Tri element type.

source
StableSpectralElements.SpatialDiscretizations.NodalTensorType
NodalTensor(p::Int)

Approximation type for a nodal formulation of polynomial degree $p$ based on tensor-product volume and facet quadrature rules (generalized Vandermonde matrix is identity, derivative and interpolation/extrapolation operators have tensor-product structure). Currently supports Line, Tri, Tet, Quad, and Hex element types.

source
StableSpectralElements.SpatialDiscretizations.ReferenceApproximationType
ReferenceApproximation(approx_type::AbstractReferenceMapping,
                       element_type::StartUpDG.AbstractElemShape, kwargs...)

Data structure defining the discretization on the reference element, containing the following fields, which are defined according to the approximation type, element type, and other parameters passed into the outer constructor:

  • approx_type::AbstractApproximationType: Type of operators used for the discretization on the reference element (NodalTensor, ModalTensor, NodalMulti, ModalMulti, NodalMultiDiagE, or ModalMultiDiagE)
  • reference_element::StartUpDG.RefElemData: Data structure containing quadrature node positions and operators used for defining the mapping from reference to physical space; contains the field element_type::StartUpDG.AbstractElemShape which determines the shape of the reference element (currently, StableSpectralElements.jl supports the options Line, Quad, Hex, Tri, and Tet)
  • D::NTuple{d, <:LinearMap}: Tuple of operators of size N_q by N_q approximating each partial derivative at the volume quadrature nodes
  • V::LinearMap: Generalized Vandermonde matrix of size N_q by N_p mapping solution degrees of freedom to values at volume quadrature nodes
  • Vf::LinearMap: Generalized Vandermonde matrix of size N_f by N_p mapping solution degrees of freedom to values at facet quadrature nodes
  • R::LinearMap: Interpolation/extrapolation operator of size N_f by N_q which maps nodal data from volume quadrature nodes to facet quadrature nodes
  • W::Diagonal: Volume quadrature weight matrix of size N_q by N_q
  • B::Diagonal: Facet quadrature weight matrix of size N_f by N_f
  • V_plot::LinearMap: Generalized Vandermonde matrix mapping solution degrees of freedom to plotting nodes
  • reference_mapping::AbstractReferenceMapping: Optional collapsed coordinate transformation (either ReferenceMapping or NoMapping); if such a mapping is used (i.e. not NoMapping), the discrete derivative operators approximate partial derivatives with respect to components of the collapsed coordinate system

Outer constructors are provided to construct the discrete operators by dispatching on each combination of subtypes of AbstractApproximationType and StartUpDG.AbstractElemShape.

source