diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 92ec326a..ad520f30 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-05T22:24:36","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-10-06T19:20:22","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/ConservationLaws/index.html b/dev/ConservationLaws/index.html index e079d333..3ece339f 100644 --- a/dev/ConservationLaws/index.html +++ b/dev/ConservationLaws/index.html @@ -1,8 +1,8 @@ -ConservationLaws · StableSpectralElements.jl

Module ConservationLaws

Overview

The equations to be solved are defined by subtypes of AbstractConservationLaw on which functions such as physical_flux and numerical_flux are dispatched. Objects of type AbstractConservationLaw contain two type parameters, d and PDEType, the former denoting the spatial dimension of the problem, which is inherited by all subtypes, and the latter being a subtype of AbstractPDEType denoting the particular type of PDE being solved, which is either FirstOrder or SecondOrder. Whereas first-order problems remove the dependence of the flux tensor on the solution gradient in order to obtain systems of the form

\[\partial_t \underline{U}(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \underline{\bm{F}}(\underline{U}(\bm{x},t)) = \underline{0},\]

second-order problems are treated by StableSpectralElements.jl as first-order systems of the form

\[\begin{aligned} +ConservationLaws · StableSpectralElements.jl

Module ConservationLaws

The ConservationLaws module defines the systems of partial differential equations which are solved by StableSpectralElements.jl.

Overview

The equations to be solved are defined by subtypes of AbstractConservationLaw on which functions such as physical_flux and numerical_flux are dispatched. Whereas first-order problems (i.e. subtypes of AbstractConservationLaw{d, FirstOrder}) remove the dependence of the flux tensor on the solution gradient in order to obtain systems of the form

\[\partial_t \underline{U}(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \underline{\bm{F}}(\underline{U}(\bm{x},t)) = \underline{0},\]

second-order problems (i.e. subtypes of AbstractConservationLaw{d, SecondOrder}) are treated by StableSpectralElements.jl as first-order systems of the form

\[\begin{aligned} \underline{\bm{Q}}(\bm{x},t) - \bm{\nabla}_{\bm{x}} \underline{U}(\bm{x},t) &= \underline{0},\\ \partial_t \underline{U}(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \underline{\bm{F}}(\underline{U}(\bm{x},t), \underline{\bm{Q}}(\bm{x},t)) &= \underline{0}. -\end{aligned}\]

Currently, the linear advection and advection-diffusion equations, the inviscid and viscous Burgers' equations, and the compressible Euler equations are supported by StableSpectralElements.jl, but any system of the above form can in principle be implemented, provided that appropriate physical and numerical fluxes are defined.

Reference

StableSpectralElements.ConservationLaws.LinearAdvectionEquationType
LinearAdvectionEquation(a::NTuple{d,Float64}) where {d}

Define a linear advection equation of the form

\[\partial_t U(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \big( \bm{a} U(\bm{x},t) \big) = 0,\]

with a constant advection velocity $\bm{a} \in \R^d$. A specialized constructor LinearAdvectionEquation(a::Float64) is provided for the one-dimensional case.

source
StableSpectralElements.ConservationLaws.LinearAdvectionDiffusionEquationType
LinearAdvectionDiffusionEquation(a::NTuple{d,Float64}, b::Float64) where {d}

Define a linear advection-diffusion equation of the form

\[\partial_t U(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \big( \bm{a} U(\bm{x},t) - b \bm{\nabla} U(\bm{x},t)\big) = 0,\]

with a constant advection velocity $\bm{a} \in \R^d$ and diffusion coefficient $b \in \R^+$. A specialized constructor LinearAdvectionDiffusionEquation(a::Float64, b::Float64) is provided for the one-dimensional case.

source
StableSpectralElements.ConservationLaws.InviscidBurgersEquationType
InviscidBurgersEquation(a::NTuple{d,Float64}) where {d}

Define an inviscid Burgers' equation of the form

\[\partial_t U(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \big(\tfrac{1}{2}\bm{a} U(\bm{x},t)^2 \big) = 0,\]

where $\bm{a} \in \R^d$. A specialized constructor InviscidBurgersEquation() is provided for the one-dimensional case with a = (1.0,).

source
StableSpectralElements.ConservationLaws.ViscousBurgersEquationType
ViscousBurgersEquation(a::NTuple{d,Float64}, b::Float64) where {d}

Define a viscous Burgers' equation of the form

\[\partial_t U(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \big(\tfrac{1}{2}\bm{a} U(\bm{x},t)^2 - b \bm{\nabla} U(\bm{x},t)\big) = 0,\]

where $\bm{a} \in \R^d$ and $b \in \R^+$. A specialized constructor ViscousBurgersEquation(b::Float64) is provided for the one-dimensional case with a = (1.0,).

source
StableSpectralElements.ConservationLaws.EulerEquationsType
EulerEquations{d}(γ::Float64) where {d}

Define an Euler system governing compressible, adiabatic fluid flow, taking the form

\[\frac{\partial}{\partial t}\left[\begin{array}{c} +\end{aligned}\]

Currently, the linear advection and advection-diffusion equations (LinearAdvectionEquation and LinearAdvectionDiffusionEquation), the inviscid and viscous Burgers' equations (InviscidBurgersEquation and ViscousBurgersEquation), and the compressible Euler equations (EulerEquations) are supported by StableSpectralElements.jl, but any system of the above form can in principle be implemented, provided that appropriate physical and numerical fluxes are defined.

Reference

StableSpectralElements.ConservationLaws.EulerEquationsType
EulerEquations{d}(γ::Float64) where {d}

Define an Euler system governing compressible, adiabatic fluid flow, taking the form

\[\frac{\partial}{\partial t}\left[\begin{array}{c} \rho(\bm{x}, t) \\ \rho(\bm{x}, t) V_1(\bm{x}, t) \\ \vdots \\ @@ -14,4 +14,7 @@ \vdots \\ \rho(\bm{x}, t) V_d(\bm{x}, t) V_m(\bm{x}, t)+P(\bm{x}, t) \delta_{d m} \\ V_m(\bm{x}, t)(E(\bm{x}, t)+P(\bm{x}, t)) -\end{array}\right]=\underline{0},\]

where $\rho(\bm{x},t) \in \mathbb{R}$ is the fluid density, $\bm{V}(\bm{x},t) \in \mathbb{R}^d$ is the flow velocity, $E(\bm{x},t) \in \mathbb{R}$ is the total energy per unit volume, and the pressure is given for an ideal gas with constant specific heat as

\[P(\bm{x},t) = (\gamma - 1)\Big(E(\bm{x},t) - \frac{1}{2}\rho(\bm{x},t) \lVert \bm{V}(\bm{x},t)\rVert^2\Big).\]

The specific heat ratio is specified as a parameter $\gamma$, which must be greater than unity.

source
+\end{array}\right]=\underline{0},\]

where $\rho(\bm{x},t) \in \mathbb{R}$ is the fluid density, $\bm{V}(\bm{x},t) \in \mathbb{R}^d$ is the flow velocity, $E(\bm{x},t) \in \mathbb{R}$ is the total energy per unit volume, and the pressure is given for an ideal gas with constant specific heat as

\[P(\bm{x},t) = (\gamma - 1)\Big(E(\bm{x},t) - \frac{1}{2}\rho(\bm{x},t) \lVert \bm{V}(\bm{x},t)\rVert^2\Big).\]

The specific heat ratio is specified as a parameter $\gamma$, which must be greater than unity.

source
StableSpectralElements.ConservationLaws.EulerPeriodicTestType
EulerPeriodicTest(conservation_law::EulerEquations{d},
+                  strength = 0.2, L = 2.0)

Periodic wave test case for EulerEquations{d} on the domain $\Omega = [0,L]^d$, based on the following paper:

  • G.-S. Jiang and C.-W. Shu (1996). Efficient implementation of weighted ENO schemes. Journal of Computational Physics 126(1): 202-228.
source
StableSpectralElements.ConservationLaws.InviscidBurgersEquationType
InviscidBurgersEquation(a::NTuple{d,Float64}) where {d}

Define an inviscid Burgers' equation of the form

\[\partial_t U(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \big(\tfrac{1}{2}\bm{a} U(\bm{x},t)^2 \big) = 0,\]

where $\bm{a} \in \R^d$. A specialized constructor InviscidBurgersEquation() is provided for the one-dimensional case with a = (1.0,).

source
StableSpectralElements.ConservationLaws.IsentropicVortexType
IsentropicVortex(conservation_law::EulerEquations{2};
+                 Ma = 0.4, θ = π/4, R = 1.0, β = 1.0,
+                 σ = 1.0, x_0 = (0.0, 0.0))

Isentropic vortex test case for EulerEquations{2}

source
StableSpectralElements.ConservationLaws.KelvinHelmholtzInstabilityType
KelvinHelmholtzInstability(conservation_law::EulerEquations{2}, ρ_0 = 0.5)

Kelvin-Helmholtz instability initial condition for EulerEquations{2} on the domain $\Omega = [0,2]^2$

source
StableSpectralElements.ConservationLaws.LinearAdvectionDiffusionEquationType
LinearAdvectionDiffusionEquation(a::NTuple{d,Float64}, b::Float64) where {d}

Define a linear advection-diffusion equation of the form

\[\partial_t U(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \big( \bm{a} U(\bm{x},t) - b \bm{\nabla} U(\bm{x},t)\big) = 0,\]

with a constant advection velocity $\bm{a} \in \R^d$ and diffusion coefficient $b \in \R^+$. A specialized constructor LinearAdvectionDiffusionEquation(a::Float64, b::Float64) is provided for the one-dimensional case.

source
StableSpectralElements.ConservationLaws.LinearAdvectionEquationType
LinearAdvectionEquation(a::NTuple{d,Float64}) where {d}

Define a linear advection equation of the form

\[\partial_t U(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \big( \bm{a} U(\bm{x},t) \big) = 0,\]

with a constant advection velocity $\bm{a} \in \R^d$. A specialized constructor LinearAdvectionEquation(a::Float64) is provided for the one-dimensional case.

source
StableSpectralElements.ConservationLaws.TaylorGreenVortexType
TaylorGreenVortex(conservation_law::EulerEquations{3}, Ma = 0.1)

Inviscid Taylor-Green vortex initial condition for EulerEquations{3} on the domain $\Omega = [0, 2\pi]^3$.

source
StableSpectralElements.ConservationLaws.ViscousBurgersEquationType
ViscousBurgersEquation(a::NTuple{d,Float64}, b::Float64) where {d}

Define a viscous Burgers' equation of the form

\[\partial_t U(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \big(\tfrac{1}{2}\bm{a} U(\bm{x},t)^2 - b \bm{\nabla} U(\bm{x},t)\big) = 0,\]

where $\bm{a} \in \R^d$ and $b \in \R^+$. A specialized constructor ViscousBurgersEquation(b::Float64) is provided for the one-dimensional case with a = (1.0,).

source
diff --git a/dev/Solvers/index.html b/dev/Solvers/index.html index c8901209..8251658a 100644 --- a/dev/Solvers/index.html +++ b/dev/Solvers/index.html @@ -1,5 +1,18 @@ -Solvers · StableSpectralElements.jl

Module Solvers

Overview

StableSpectralElements.jl is based on a semi-discrete approach to the numerical solution of partial differential equations, in which the spatial discretization is performed first in order to obtain a system of ordinary differential equations of the form

\[\frac{\mathrm{d} }{\mathrm{d}t}\underline{u}(t) = \underline{R}(\underline{u}(t),t),\]

where $\underline{u}(t) \in \mathbb{R}^{N_p \cdot N_c \cdot N_e}$ is the global solution array containing the $N_p$ coefficients for each of the $N_c$ solution variables and each of the $N_e$ mesh elements. Such systems can be solved using standard time-marching methods from OrdinaryDiffEq.jl by computing the semi-discrete residual $\underline{R}(\underline{u}(t),t)$ using a Julia function with the following signature:

semi_discrete_residual(dudt::AbstractArray{Float64,3},
+Solvers · StableSpectralElements.jl

Module Solvers

The Solvers module implements the algorithms which evaluate the semi-discrete residual corresponding to the discretization of an AbstractConservationLaw in space using the operators and geometric information contained within the SpatialDiscretization to create an ODEProblem, which can be solved using your choice of time-marching method from OrdinaryDiffEq.jl.

Overview

StableSpectralElements.jl is based on a semi-discrete or "method-of-lines" approach to the numerical solution of partial differential equations, in which the spatial discretization is performed first in order to obtain a system of ordinary differential equations of the form $\underline{u}'(t) = \underline{R}(\underline{u}(t),t)$, where $\underline{u}(t) \in \mathbb{R}^{N_p \cdot N_c \cdot N_e}$ is the global solution array containing the $N_p$ coefficients for each of the $N_c$ solution variables and each of the $N_e$ mesh elements. These systems can be solved using standard time-marching methods from OrdinaryDiffEq.jl by computing the semi-discrete residual $\underline{R}(\underline{u}(t),t)$ using the in-place function semi_discrete_residual!.

Reference

StableSpectralElements.Solvers.semi_discrete_residual!Function
semi_discrete_residual!(dudt::AbstractArray{Float64,3},
                        u::AbstractArray{Float64, 3},
                        solver::Solver,
-                       t::Float64)

The first parameter contains the time derivative to be computed in place, the second parameter is the current solution state, and the fourth parameter is the time $t$. The third parameter, which is of type Solver, contains all the information defining the spatial discretization as well as preallocated arrays used for temporary storage. The particular algorithm used for computing the semi-discrete residual is then dispatched based on the particular parametric subtype of Solver which is passed into the semi_discrete_residual! function.

Reference

+ t::Float64)

In-place function for evaluating the right-hand side of $\underline{u}'(t) = \underline{R}(\underline{u}(t),t)$ within the ordinary differential equation solver.

Arguments

  • dudt::AbstractArray{Float64,3}: Time derivative (first index is nodal or modal coefficient, second index is solution variable, third index is mesh element)
  • u::AbstractArray{Float64,3}: Current global solution state (first index is nodal or modal coefficient, second index is solution variable, third index is mesh element)
  • solver::Solver: Parameter of type Solver containing all the information defining the spatial discretization, the algorithms used to evaluate the semi-discrete residual, and preallocated arrays used for temporary storage; type parameters of Solver are used to dispatch the resulting algorithm based on the equation type, operator type, mass matrix solver (i.e. CholeskySolver, DiagonalSolver, or WeightAdjustedSolver), residual form (i.e. StandardForm or FluxDifferencingForm), and parallelism (i.e. Serial or Threaded).
  • t::Float64: Time variable
source
StableSpectralElements.Solvers.FluxDifferencingFormType
FluxDifferencingForm(; mapping_form = SkewSymmetricMapping(),
+               inviscid_numerical_flux = LaxFriedrichsNumericalFlux(),
+               viscous_numerical_flux = BR1(),
+               two_point_flux = EntropyConservativeFlux())

Type used for dispatch indicating the use of a flux-differencing (e.g. entropy-stable or kinetic-energy-preserving) discontinuous spectral-element formulation based on two-point flux functions.

source
StableSpectralElements.Solvers.FluxDifferencingOperatorsType
FluxDifferencingOperators{S_type, C_type, V_type, Vt_type, R_type, Rt_type} <:
+   AbstractDiscretizationOperators

Set of operators and nodal values of geometric factors used to evaluate the semi-discrete residual for the FluxDifferencingForm in reference space. Note that no physical-operator formulation is implemented for the flux-differencing form.

source
StableSpectralElements.Solvers.PhysicalOperatorsType
PhysicalOperators{d, VOL_type, FAC_type, V_type, R_type} <:
+   AbstractDiscretizationOperators

Set of operators used to evaluate the semi-discrete residual for the StandardForm by precomputing matrices for each physical element.

source
StableSpectralElements.Solvers.ReferenceOperatorsType
ReferenceOperators{D_type, Dt_type, V_type, Vt_type, R_type, Rt_type} <:
+   AbstractDiscretizationOperators

Set of operators and nodal values of geometric factors used to evaluate the semi-discrete residual for the StandardForm in reference space.

source
StableSpectralElements.Solvers.SolverType
Solver{ConservationLaw <: AbstractConservationLaw, 
+       Operators <: AbstractDiscretizationOperators,
+       MassSolver <: AbstractMassMatrixSolver,
+       ResidualForm <: AbstractMassMatrixSolver,
+       Parallelism <: AbstractParallelism,
+       PreAllocatedArrays <: AbstractPreAllocatedArrays}

Composite type defining the spatial discretization which is passed into semi_discrete_residual! function to compute the time derivative within an ordinary differential equation solver from OrdinaryDiffEq.jl. The algorithm used to compute the semi-discrete residual is dispatched based on the type parameters.

source
StableSpectralElements.Solvers.StandardFormType
StandardForm(; mapping_form = SkewSymmetricMapping(),
+               inviscid_numerical_flux = LaxFriedrichsNumericalFlux(),
+               viscous_numerical_flux = BR1())

Type used for dispatch indicating the use of a standard (i.e. not flux-differencing) weak-form discontinuous spectral-element method. The mapping_form argument can be set to StandardMapping() to recover a standard discontinuous Galerkin formulation.

source
diff --git a/dev/SpatialDiscretizations/index.html b/dev/SpatialDiscretizations/index.html index 26cde797..c9cdd9db 100644 --- a/dev/SpatialDiscretizations/index.html +++ b/dev/SpatialDiscretizations/index.html @@ -1,9 +1,15 @@ -SpatialDiscretizations · StableSpectralElements.jl

Module SpatialDiscretizations

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} +SpatialDiscretizations · StableSpectralElements.jl

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, which are stored as the fields reference_approximation and mesh. When the constructor for a SpatialDiscretization is called, the grid metrics are computed and stored in the field geometric_factors of type GeometricFactors.

Reference

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,Tri, Quad, Hex, 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
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).

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).

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).

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).

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).

source
+\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
diff --git a/dev/index.html b/dev/index.html index 5f629145..69a3875a 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,5 +1,5 @@ -Home · StableSpectralElements.jl

StableSpectralElements.jl

StableSpectralElements.jl is a Julia framework for the numerical solution of partial differential equations of the form

\[\partial_t \underline{U}(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \underline{\bm{F}}(\underline{U}(\bm{x},t), \bm{\nabla}_{\bm{x}}\underline{U}(\bm{x},t)) = \underline{0},\]

for $t \in (0,T)$ with $T \in \mathbb{R}^+ $ and $\bm{x} \in \Omega \subset \mathbb{R}^d$, subject to appropriate initial and boundary conditions, where $\underline{U}(\bm{x},t)$ is the vector of solution variables and $\underline{\bm{F}}(\underline{U}(\bm{x},t),\bm{\nabla}_{\bm{x}}\underline{U}(\bm{x},t))$ is the flux tensor containing advective and/or diffusive contributions. These equations are spatially discretized on curvilinear unstructured grids using energy-stable and entropy-stable discontinuous spectral element methods in order to generate ODEProblem objects suitable for time integration using OrdinaryDiffEq.jl within the SciML ecosystem. StableSpectralElements.jl also includes postprocessing tools employing WriteVTK.jl for generating .vtu files, allowing for visualization of high-order numerical solutions on unstructured grids using ParaView or other software. Shared-memory parallelization is supported through multithreading.

The functionality provided by StartUpDG.jl for the handling of mesh data structures, polynomial basis functions, and quadrature nodes is employed throughout this package. Moreover, StableSpectralElements.jl implements dispatched strategies for semi-discrete operator evaluation using LinearMaps.jl, allowing for the efficient matrix-free application of tensor-product operators.

Discretizations satisfying the summation-by-parts (SBP) property employing nodal as well as modal bases are implemented, with the latter allowing for efficient and low-storage inversion of the dense elemental mass matrices arising from curvilinear meshes through the use of weight-adjusted approximations. Tensor-product formulations supporting sum factorization are available on triangles and tetrahedra through the use of SBP operators in collapsed coordinates, as well as on quadrilaterals and hexahedra.

Theory

For a comprehensive overview of the numerical methods implemented in StableSpectralElements.jl, please refer to Tristan's PhD thesis, Provably Stable Discontinuous Spectral-Element Methods with the Summation-by-Parts Property: Unified Matrix Analysis and Efficient Tensor-Product Formulations on Curved Simplices.

Installation

StableSpectralElements.jl is a registered Julia package (compatible with Julia versions 1.10 and higher) and can be installed by entering the following commands within the Julia REPL (read-eval-print loop):

using Pkg; Pkg.add("StableSpectralElements")

Alternatively, you can clone the repository and run your local version as follows:

git clone https://github.com/tristanmontoya/StableSpectralElements.jl.git
+Home · StableSpectralElements.jl

StableSpectralElements.jl

StableSpectralElements.jl is a Julia framework for the numerical solution of partial differential equations of the form

\[\partial_t \underline{U}(\bm{x},t) + \bm{\nabla}_{\bm{x}} \cdot \underline{\bm{F}}(\underline{U}(\bm{x},t), \bm{\nabla}_{\bm{x}}\underline{U}(\bm{x},t)) = \underline{0},\]

for $t \in (0,T)$ with $T \in \mathbb{R}^+ $ and $\bm{x} \in \Omega \subset \mathbb{R}^d$, subject to appropriate initial and boundary conditions, where $\underline{U}(\bm{x},t)$ is the vector of solution variables and $\underline{\bm{F}}(\underline{U}(\bm{x},t),\bm{\nabla}_{\bm{x}}\underline{U}(\bm{x},t))$ is the flux tensor containing advective and/or diffusive contributions. These equations are spatially discretized on curvilinear unstructured grids using energy-stable and entropy-stable discontinuous spectral element methods in order to generate ODEProblem objects suitable for time integration using OrdinaryDiffEq.jl within the SciML ecosystem. StableSpectralElements.jl also includes postprocessing tools employing WriteVTK.jl for generating .vtu files, allowing for visualization of high-order numerical solutions on unstructured grids using ParaView or other software. Shared-memory parallelization is supported through multithreading.

The functionality provided by StartUpDG.jl for the handling of mesh data structures, polynomial basis functions, and quadrature nodes is employed throughout this package. Moreover, StableSpectralElements.jl implements dispatched strategies for semi-discrete operator evaluation using LinearMaps.jl, allowing for the efficient matrix-free application of tensor-product operators.

Discretizations satisfying the summation-by-parts (SBP) property employing nodal as well as modal bases are implemented, with the latter allowing for efficient and low-storage inversion of the dense elemental mass matrices arising from curvilinear meshes through the use of weight-adjusted approximations. Tensor-product formulations supporting sum factorization are available on triangles and tetrahedra through the use of SBP operators in collapsed coordinates, as well as on quadrilaterals and hexahedra.

Theory

For a comprehensive overview of the numerical methods implemented in StableSpectralElements.jl, please refer to Tristan's PhD thesis, Provably Stable Discontinuous Spectral-Element Methods with the Summation-by-Parts Property: Unified Matrix Analysis and Efficient Tensor-Product Formulations on Curved Simplices.

Installation

StableSpectralElements.jl is a registered Julia package (compatible with Julia versions 1.10 and higher) and can be installed by entering the following commands within the Julia REPL (read-eval-print loop):

using Pkg; Pkg.add("StableSpectralElements")

Alternatively, you can clone the repository and run your local version as follows:

git clone https://github.com/tristanmontoya/StableSpectralElements.jl.git
 cd StableSpectralElements.jl
 julia --project=.

In either case, you can then start using the package by entering using StableSpectralElements.

Examples

We recommend that users refer to the following Jupyter notebooks (included in the examples directory) for examples of how to use StableSpectralElements.jl:

Citing

If you use StableSpectralElements.jl in your research, please cite the following publications:

@article{MontoyaZinggTensorProduct24,
     title = {Efficient Tensor-Product Spectral-Element Operators with the Summation-by-Parts 
@@ -22,4 +22,4 @@
     pages = {113360},
     doi = {10.1016/j.jcp.2024.113360},
     year = {2024}
-}

License

This software is released under the GPLv3 license.

+}

The following repositories are associated with the above papers, and contain the code required to reproduce the results presented therein:

License

This software is released under the GPLv3 license.

diff --git a/dev/objects.inv b/dev/objects.inv index ac500ca3..5403b781 100644 Binary files a/dev/objects.inv and b/dev/objects.inv differ diff --git a/dev/search_index.js b/dev/search_index.js index 7ce57757..ff2935ae 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"Solvers/#Module-Solvers","page":"Solvers","title":"Module Solvers","text":"","category":"section"},{"location":"Solvers/#Overview","page":"Solvers","title":"Overview","text":"","category":"section"},{"location":"Solvers/","page":"Solvers","title":"Solvers","text":"StableSpectralElements.jl is based on a semi-discrete approach to the numerical solution of partial differential equations, in which the spatial discretization is performed first in order to obtain a system of ordinary differential equations of the form ","category":"page"},{"location":"Solvers/","page":"Solvers","title":"Solvers","text":"fracmathrmd mathrmdtunderlineu(t) = underlineR(underlineu(t)t)","category":"page"},{"location":"Solvers/","page":"Solvers","title":"Solvers","text":"where underlineu(t) in mathbbR^N_p cdot N_c cdot N_e is the global solution array containing the N_p coefficients for each of the N_c solution variables and each of the N_e mesh elements. Such systems can be solved using standard time-marching methods from OrdinaryDiffEq.jl by computing the semi-discrete residual underlineR(underlineu(t)t) using a Julia function with the following signature:","category":"page"},{"location":"Solvers/","page":"Solvers","title":"Solvers","text":"semi_discrete_residual(dudt::AbstractArray{Float64,3},\n u::AbstractArray{Float64, 3},\n solver::Solver,\n t::Float64)","category":"page"},{"location":"Solvers/","page":"Solvers","title":"Solvers","text":"The first parameter contains the time derivative to be computed in place, the second parameter is the current solution state, and the fourth parameter is the time t. The third parameter, which is of type Solver, contains all the information defining the spatial discretization as well as preallocated arrays used for temporary storage. The particular algorithm used for computing the semi-discrete residual is then dispatched based on the particular parametric subtype of Solver which is passed into the semi_discrete_residual! function.","category":"page"},{"location":"Solvers/#Reference","page":"Solvers","title":"Reference","text":"","category":"section"},{"location":"SpatialDiscretizations/#Module-SpatialDiscretizations","page":"SpatialDiscretizations","title":"Module SpatialDiscretizations","text":"","category":"section"},{"location":"SpatialDiscretizations/#Overview","page":"SpatialDiscretizations","title":"Overview","text":"","category":"section"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"Discretizations in StableSpectralElements.jl are constructed by first building a local approximation on a canonical reference element, denoted generically as hatOmega subset mathbbR^d, and using a bijective transformation bmX^(kappa) hatOmega rightarrow Omega^(kappa) to construct the approximation on each physical element Omega^(kappa) subset Omega of the mesh Omega^(kappa)_kappa in 1N_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 bmchi -11^d to hatOmega which may be used to construct operators with a tensor-product structure on the reference simplex.","category":"page"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"(Image: Mesh mapping)","category":"page"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"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:","category":"page"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"beginaligned\nhatOmega_mathrmline = -11\nhatOmega_mathrmquad = -11^2\nhatOmega_mathrmhex = -11^3 \nhatOmega_mathrmtri = big bmxi in -11^2 xi_1 + xi_2 leq 0 big\nhatOmega_mathrmtet = big bmxi in -11^3 xi_1 + xi_2 + xi_3 leq -1 big\nendaligned","category":"page"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"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. ","category":"page"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"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, which are stored as the fields reference_approximation and mesh. When the constructor for a SpatialDiscretization is called, the grid metrics are computed and stored in the field geometric_factors of type GeometricFactors.","category":"page"},{"location":"SpatialDiscretizations/#Reference","page":"SpatialDiscretizations","title":"Reference","text":"","category":"section"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"CurrentModule = SpatialDiscretizations","category":"page"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":" ReferenceApproximation\n NodalTensor\n ModalTensor\n NodalMulti\n ModalMulti\n NodalMultiDiagE\n ModalMultiDiagE","category":"page"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.ReferenceApproximation","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.ReferenceApproximation","text":"ReferenceApproximation(approx_type::AbstractReferenceMapping,\n element_type::StartUpDG.AbstractElemShape, kwargs...)\n\nData 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:\n\napprox_type::AbstractApproximationType: Type of operators used for the discretization on the reference element (NodalTensor, ModalTensor, NodalMulti, ModalMulti, NodalMultiDiagE, or ModalMultiDiagE)\nreference_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,Tri, Quad, Hex, and Tet)\nD::NTuple{d, <:LinearMap}: Tuple of operators of size N_q by N_q approximating each partial derivative at the volume quadrature nodes\nV::LinearMap: Generalized Vandermonde matrix of size N_q by N_p mapping solution degrees of freedom to values at volume quadrature nodes\nVf::LinearMap: Generalized Vandermonde matrix of size N_f by N_p mapping solution degrees of freedom to values at facet quadrature nodes\nR::LinearMap: Interpolation/extrapolation operator of size N_f by N_q which maps nodal data from volume quadrature nodes to facet quadrature nodes \nW::Diagonal: Volume quadrature weight matrix of size N_q by N_q\nB::Diagonal: Facet quadrature weight matrix of size N_f by N_f\nV_plot::LinearMap: Generalized Vandermonde matrix mapping solution degrees of freedom to plotting nodes\nreference_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\n\nOuter constructors are provided to construct the discrete operators by dispatching on each combination of subtypes of AbstractApproximationType and StartUpDG.AbstractElemShape. \n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.NodalTensor","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.NodalTensor","text":"NodalTensor(p::Int)\n\nApproximation 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).\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.ModalTensor","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.ModalTensor","text":"ModalTensor(p::Int)\n\nApproximation 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).\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.NodalMulti","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.NodalMulti","text":"NodalMulti(p::Int)\n\nApproximation 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).\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.ModalMulti","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.ModalMulti","text":"ModalMulti(p::Int)\n\nApproximation 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).\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.NodalMultiDiagE","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.NodalMultiDiagE","text":"NodalMultiDiagE(p::Int)\n\nApproximation 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).\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.ModalMultiDiagE","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.ModalMultiDiagE","text":"ModalMultiDiagE(p::Int)\n\nApproximation 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).\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#Module-ConservationLaws","page":"ConservationLaws","title":"Module ConservationLaws","text":"","category":"section"},{"location":"ConservationLaws/#Overview","page":"ConservationLaws","title":"Overview","text":"","category":"section"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"The equations to be solved are defined by subtypes of AbstractConservationLaw on which functions such as physical_flux and numerical_flux are dispatched. Objects of type AbstractConservationLaw contain two type parameters, d and PDEType, the former denoting the spatial dimension of the problem, which is inherited by all subtypes, and the latter being a subtype of AbstractPDEType denoting the particular type of PDE being solved, which is either FirstOrder or SecondOrder. Whereas first-order problems remove the dependence of the flux tensor on the solution gradient in order to obtain systems of the form","category":"page"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"partial_t underlineU(bmxt) + bmnabla_bmx cdot underlinebmF(underlineU(bmxt)) = underline0","category":"page"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"second-order problems are treated by StableSpectralElements.jl as first-order systems of the form ","category":"page"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"beginaligned\nunderlinebmQ(bmxt) - bmnabla_bmx underlineU(bmxt) = underline0\npartial_t underlineU(bmxt) + bmnabla_bmx cdot underlinebmF(underlineU(bmxt) underlinebmQ(bmxt)) = underline0\nendaligned","category":"page"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"Currently, the linear advection and advection-diffusion equations, the inviscid and viscous Burgers' equations, and the compressible Euler equations are supported by StableSpectralElements.jl, but any system of the above form can in principle be implemented, provided that appropriate physical and numerical fluxes are defined.","category":"page"},{"location":"ConservationLaws/#Reference","page":"ConservationLaws","title":"Reference","text":"","category":"section"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"CurrentModule = ConservationLaws","category":"page"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":" LinearAdvectionEquation\n LinearAdvectionDiffusionEquation\n InviscidBurgersEquation\n ViscousBurgersEquation\n EulerEquations","category":"page"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.LinearAdvectionEquation","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.LinearAdvectionEquation","text":"LinearAdvectionEquation(a::NTuple{d,Float64}) where {d}\n\nDefine a linear advection equation of the form\n\npartial_t U(bmxt) + bmnabla_bmx cdot big( bma U(bmxt) big) = 0\n\nwith a constant advection velocity bma in R^d. A specialized constructor LinearAdvectionEquation(a::Float64) is provided for the one-dimensional case.\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.LinearAdvectionDiffusionEquation","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.LinearAdvectionDiffusionEquation","text":"LinearAdvectionDiffusionEquation(a::NTuple{d,Float64}, b::Float64) where {d}\n\nDefine a linear advection-diffusion equation of the form\n\npartial_t U(bmxt) + bmnabla_bmx cdot big( bma U(bmxt) - b bmnabla U(bmxt)big) = 0\n\nwith a constant advection velocity bma in R^d and diffusion coefficient b in R^+. A specialized constructor LinearAdvectionDiffusionEquation(a::Float64, b::Float64) is provided for the one-dimensional case.\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.InviscidBurgersEquation","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.InviscidBurgersEquation","text":"InviscidBurgersEquation(a::NTuple{d,Float64}) where {d}\n\nDefine an inviscid Burgers' equation of the form\n\npartial_t U(bmxt) + bmnabla_bmx cdot big(tfrac12bma U(bmxt)^2 big) = 0\n\nwhere bma in R^d. A specialized constructor InviscidBurgersEquation() is provided for the one-dimensional case with a = (1.0,).\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.ViscousBurgersEquation","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.ViscousBurgersEquation","text":"ViscousBurgersEquation(a::NTuple{d,Float64}, b::Float64) where {d}\n\nDefine a viscous Burgers' equation of the form\n\npartial_t U(bmxt) + bmnabla_bmx cdot big(tfrac12bma U(bmxt)^2 - b bmnabla U(bmxt)big) = 0\n\nwhere bma in R^d and b in R^+. A specialized constructor ViscousBurgersEquation(b::Float64) is provided for the one-dimensional case with a = (1.0,).\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.EulerEquations","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.EulerEquations","text":"EulerEquations{d}(γ::Float64) where {d}\n\nDefine an Euler system governing compressible, adiabatic fluid flow, taking the form\n\nfracpartialpartial tleftbeginarrayc\nrho(bmx t) \nrho(bmx t) V_1(bmx t) \nvdots \nrho(bmx t) V_d(bmx t) \nE(bmx t)\nendarrayright+sum_m=1^d fracpartialpartial x_mleftbeginarrayc\nrho(bmx t) V_m(bmx t) \nrho(bmx t) V_1(bmx t) V_m(bmx t)+P(bmx t) delta_1 m \nvdots \nrho(bmx t) V_d(bmx t) V_m(bmx t)+P(bmx t) delta_d m \nV_m(bmx t)(E(bmx t)+P(bmx t))\nendarrayright=underline0\n\nwhere rho(bmxt) in mathbbR is the fluid density, bmV(bmxt) in mathbbR^d is the flow velocity, E(bmxt) in mathbbR is the total energy per unit volume, and the pressure is given for an ideal gas with constant specific heat as\n\nP(bmxt) = (gamma - 1)Big(E(bmxt) - frac12rho(bmxt) lVert bmV(bmxt)rVert^2Big)\n\nThe specific heat ratio is specified as a parameter gamma, which must be greater than unity.\n\n\n\n\n\n","category":"type"},{"location":"#StableSpectralElements.jl","page":"Home","title":"StableSpectralElements.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"StableSpectralElements.jl is a Julia framework for the numerical solution of partial differential equations of the form","category":"page"},{"location":"","page":"Home","title":"Home","text":"partial_t underlineU(bmxt) + bmnabla_bmx cdot underlinebmF(underlineU(bmxt) bmnabla_bmxunderlineU(bmxt)) = underline0","category":"page"},{"location":"","page":"Home","title":"Home","text":"for t in (0T) with T in mathbbR^+ and bmx in Omega subset mathbbR^d, subject to appropriate initial and boundary conditions, where underlineU(bmxt) is the vector of solution variables and underlinebmF(underlineU(bmxt)bmnabla_bmxunderlineU(bmxt)) is the flux tensor containing advective and/or diffusive contributions. These equations are spatially discretized on curvilinear unstructured grids using energy-stable and entropy-stable discontinuous spectral element methods in order to generate ODEProblem objects suitable for time integration using OrdinaryDiffEq.jl within the SciML ecosystem. StableSpectralElements.jl also includes postprocessing tools employing WriteVTK.jl for generating .vtu files, allowing for visualization of high-order numerical solutions on unstructured grids using ParaView or other software. Shared-memory parallelization is supported through multithreading.","category":"page"},{"location":"","page":"Home","title":"Home","text":"The functionality provided by StartUpDG.jl for the handling of mesh data structures, polynomial basis functions, and quadrature nodes is employed throughout this package. Moreover, StableSpectralElements.jl implements dispatched strategies for semi-discrete operator evaluation using LinearMaps.jl, allowing for the efficient matrix-free application of tensor-product operators.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Discretizations satisfying the summation-by-parts (SBP) property employing nodal as well as modal bases are implemented, with the latter allowing for efficient and low-storage inversion of the dense elemental mass matrices arising from curvilinear meshes through the use of weight-adjusted approximations. Tensor-product formulations supporting sum factorization are available on triangles and tetrahedra through the use of SBP operators in collapsed coordinates, as well as on quadrilaterals and hexahedra.","category":"page"},{"location":"#Theory","page":"Home","title":"Theory","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"For a comprehensive overview of the numerical methods implemented in StableSpectralElements.jl, please refer to Tristan's PhD thesis, Provably Stable Discontinuous Spectral-Element Methods with the Summation-by-Parts Property: Unified Matrix Analysis and Efficient Tensor-Product Formulations on Curved Simplices.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"StableSpectralElements.jl is a registered Julia package (compatible with Julia versions 1.10 and higher) and can be installed by entering the following commands within the Julia REPL (read-eval-print loop):","category":"page"},{"location":"","page":"Home","title":"Home","text":"using Pkg; Pkg.add(\"StableSpectralElements\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"Alternatively, you can clone the repository and run your local version as follows:","category":"page"},{"location":"","page":"Home","title":"Home","text":"git clone https://github.com/tristanmontoya/StableSpectralElements.jl.git\ncd StableSpectralElements.jl\njulia --project=.","category":"page"},{"location":"","page":"Home","title":"Home","text":"In either case, you can then start using the package by entering using StableSpectralElements.","category":"page"},{"location":"#Examples","page":"Home","title":"Examples","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"We recommend that users refer to the following Jupyter notebooks (included in the examples directory) for examples of how to use StableSpectralElements.jl:","category":"page"},{"location":"","page":"Home","title":"Home","text":"Linear advection-diffusion equation in 1D\nInviscid Burgers' equation in 1D with energy-conservative scheme\nEuler equations in 1D with entropy-conservative Gauss collocation methods\nLinear advection equation in 2D\nIsentropic Euler vortex in 2D with entropy-stable modal scheme on triangles\nLinear advection equation in 3D\n3D Euler equations with entropy-stable modal scheme on tetrahedra","category":"page"},{"location":"#Citing","page":"Home","title":"Citing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you use StableSpectralElements.jl in your research, please cite the following publications:","category":"page"},{"location":"","page":"Home","title":"Home","text":"@article{MontoyaZinggTensorProduct24,\n title = {Efficient Tensor-Product Spectral-Element Operators with the Summation-by-Parts \n Property on Curved Triangles and Tetrahedra},\n author = {Montoya, Tristan and Zingg, David W},\n journal = {{SIAM} Journal on Scientific Computing},\n volume = {46},\n number = {4},\n pages = {A2270--A2297},\n doi = {10.1137/23M1573963},\n year = {2024}\n}\n\n@article{MontoyaZinggEntropyStable24,\n title = {Efficient Entropy-Stable Discontinuous Spectral-Element Methods Using \n Tensor-Product Summation-by-Parts Operators on Triangles and Tetrahedra},\n author = {Montoya, Tristan and Zingg, David W},\n journal = {Journal of Computational Physics},\n volume = {516},\n pages = {113360},\n doi = {10.1016/j.jcp.2024.113360},\n year = {2024}\n}","category":"page"},{"location":"#License","page":"Home","title":"License","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"This software is released under the GPLv3 license.","category":"page"}] +[{"location":"Solvers/#Module-Solvers","page":"Solvers","title":"Module Solvers","text":"","category":"section"},{"location":"Solvers/","page":"Solvers","title":"Solvers","text":"The Solvers module implements the algorithms which evaluate the semi-discrete residual corresponding to the discretization of an AbstractConservationLaw in space using the operators and geometric information contained within the SpatialDiscretization to create an ODEProblem, which can be solved using your choice of time-marching method from OrdinaryDiffEq.jl.","category":"page"},{"location":"Solvers/#Overview","page":"Solvers","title":"Overview","text":"","category":"section"},{"location":"Solvers/","page":"Solvers","title":"Solvers","text":"StableSpectralElements.jl is based on a semi-discrete or \"method-of-lines\" approach to the numerical solution of partial differential equations, in which the spatial discretization is performed first in order to obtain a system of ordinary differential equations of the form underlineu(t) = underlineR(underlineu(t)t), where underlineu(t) in mathbbR^N_p cdot N_c cdot N_e is the global solution array containing the N_p coefficients for each of the N_c solution variables and each of the N_e mesh elements. These systems can be solved using standard time-marching methods from OrdinaryDiffEq.jl by computing the semi-discrete residual underlineR(underlineu(t)t) using the in-place function semi_discrete_residual!.","category":"page"},{"location":"Solvers/#Reference","page":"Solvers","title":"Reference","text":"","category":"section"},{"location":"Solvers/","page":"Solvers","title":"Solvers","text":"Modules = [Solvers]\nOrder = [:function, :type]","category":"page"},{"location":"Solvers/#StableSpectralElements.Solvers.semi_discrete_residual!","page":"Solvers","title":"StableSpectralElements.Solvers.semi_discrete_residual!","text":"semi_discrete_residual!(dudt::AbstractArray{Float64,3},\n u::AbstractArray{Float64, 3},\n solver::Solver,\n t::Float64)\n\nIn-place function for evaluating the right-hand side of underlineu(t) = underlineR(underlineu(t)t) within the ordinary differential equation solver.\n\nArguments\n\ndudt::AbstractArray{Float64,3}: Time derivative (first index is nodal or modal coefficient, second index is solution variable, third index is mesh element) \nu::AbstractArray{Float64,3}: Current global solution state (first index is nodal or modal coefficient, second index is solution variable, third index is mesh element) \nsolver::Solver: Parameter of type Solver containing all the information defining the spatial discretization, the algorithms used to evaluate the semi-discrete residual, and preallocated arrays used for temporary storage; type parameters of Solver are used to dispatch the resulting algorithm based on the equation type, operator type, mass matrix solver (i.e. CholeskySolver, DiagonalSolver, or WeightAdjustedSolver), residual form (i.e. StandardForm or FluxDifferencingForm), and parallelism (i.e. Serial or Threaded).\nt::Float64: Time variable\n\n\n\n\n\n","category":"function"},{"location":"Solvers/#StableSpectralElements.Solvers.FluxDifferencingForm","page":"Solvers","title":"StableSpectralElements.Solvers.FluxDifferencingForm","text":"FluxDifferencingForm(; mapping_form = SkewSymmetricMapping(),\n inviscid_numerical_flux = LaxFriedrichsNumericalFlux(),\n viscous_numerical_flux = BR1(),\n two_point_flux = EntropyConservativeFlux())\n\nType used for dispatch indicating the use of a flux-differencing (e.g. entropy-stable or kinetic-energy-preserving) discontinuous spectral-element formulation based on two-point flux functions.\n\n\n\n\n\n","category":"type"},{"location":"Solvers/#StableSpectralElements.Solvers.FluxDifferencingOperators","page":"Solvers","title":"StableSpectralElements.Solvers.FluxDifferencingOperators","text":"FluxDifferencingOperators{S_type, C_type, V_type, Vt_type, R_type, Rt_type} <:\n AbstractDiscretizationOperators\n\nSet of operators and nodal values of geometric factors used to evaluate the semi-discrete residual for the FluxDifferencingForm in reference space. Note that no physical-operator formulation is implemented for the flux-differencing form.\n\n\n\n\n\n","category":"type"},{"location":"Solvers/#StableSpectralElements.Solvers.PhysicalOperators","page":"Solvers","title":"StableSpectralElements.Solvers.PhysicalOperators","text":"PhysicalOperators{d, VOL_type, FAC_type, V_type, R_type} <:\n AbstractDiscretizationOperators\n\nSet of operators used to evaluate the semi-discrete residual for the StandardForm by precomputing matrices for each physical element.\n\n\n\n\n\n","category":"type"},{"location":"Solvers/#StableSpectralElements.Solvers.ReferenceOperators","page":"Solvers","title":"StableSpectralElements.Solvers.ReferenceOperators","text":"ReferenceOperators{D_type, Dt_type, V_type, Vt_type, R_type, Rt_type} <:\n AbstractDiscretizationOperators\n\nSet of operators and nodal values of geometric factors used to evaluate the semi-discrete residual for the StandardForm in reference space.\n\n\n\n\n\n","category":"type"},{"location":"Solvers/#StableSpectralElements.Solvers.Solver","page":"Solvers","title":"StableSpectralElements.Solvers.Solver","text":"Solver{ConservationLaw <: AbstractConservationLaw, \n Operators <: AbstractDiscretizationOperators,\n MassSolver <: AbstractMassMatrixSolver,\n ResidualForm <: AbstractMassMatrixSolver,\n Parallelism <: AbstractParallelism,\n PreAllocatedArrays <: AbstractPreAllocatedArrays}\n\nComposite type defining the spatial discretization which is passed into semi_discrete_residual! function to compute the time derivative within an ordinary differential equation solver from OrdinaryDiffEq.jl. The algorithm used to compute the semi-discrete residual is dispatched based on the type parameters.\n\n\n\n\n\n","category":"type"},{"location":"Solvers/#StableSpectralElements.Solvers.StandardForm","page":"Solvers","title":"StableSpectralElements.Solvers.StandardForm","text":"StandardForm(; mapping_form = SkewSymmetricMapping(),\n inviscid_numerical_flux = LaxFriedrichsNumericalFlux(),\n viscous_numerical_flux = BR1())\n\nType used for dispatch indicating the use of a standard (i.e. not flux-differencing) weak-form discontinuous spectral-element method. The mapping_form argument can be set to StandardMapping() to recover a standard discontinuous Galerkin formulation.\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#Module-SpatialDiscretizations","page":"SpatialDiscretizations","title":"Module SpatialDiscretizations","text":"","category":"section"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"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.","category":"page"},{"location":"SpatialDiscretizations/#Overview","page":"SpatialDiscretizations","title":"Overview","text":"","category":"section"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"Discretizations in StableSpectralElements.jl are constructed by first building a local approximation on a canonical reference element, denoted generically as hatOmega subset mathbbR^d, and using a bijective transformation bmX^(kappa) hatOmega rightarrow Omega^(kappa) to construct the approximation on each physical element Omega^(kappa) subset Omega of the mesh Omega^(kappa)_kappa in 1N_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 bmchi -11^d to hatOmega which may be used to construct operators with a tensor-product structure on the reference simplex.","category":"page"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"(Image: Mesh mapping)","category":"page"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"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:","category":"page"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"beginaligned\nhatOmega_mathrmline = -11\nhatOmega_mathrmquad = -11^2\nhatOmega_mathrmhex = -11^3 \nhatOmega_mathrmtri = big bmxi in -11^2 xi_1 + xi_2 leq 0 big\nhatOmega_mathrmtet = big bmxi in -11^3 xi_1 + xi_2 + xi_3 leq -1 big\nendaligned","category":"page"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"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. ","category":"page"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"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.","category":"page"},{"location":"SpatialDiscretizations/#Reference","page":"SpatialDiscretizations","title":"Reference","text":"","category":"section"},{"location":"SpatialDiscretizations/","page":"SpatialDiscretizations","title":"SpatialDiscretizations","text":"Modules = [SpatialDiscretizations]\nOrder = [:function, :type]","category":"page"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.GeometricFactors","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.GeometricFactors","text":"GeometricFactors(J_q::Matrix{Float64}, \n Λ_q::Array{Float64, 4}, \n J_f::Matrix{Float64},\n nJf::Array{Float64, 3},\n nJq::Array{Float64, 4})\n\nNodal values of geometric factors used by the solver to construct discretizations on the physical element. Contains the following fields:\n\nJ_q::Matrix{Float64}: Jacobian determinant J of the mapping from reference coordinates bmxi in hatOmega to physical coordinates bmx in Omega^(kappa) at volume quadrature nodes; first dimension is node index (size N_q), second is element index (size N_e)\nΛ_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)\nJ_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)\nnJf::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)\nnJq::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)\n\nnote: Note\nWhen 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 -11^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.\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.ModalMulti","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.ModalMulti","text":"ModalMulti(p::Int)\n\nApproximation 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.\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.ModalMultiDiagE","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.ModalMultiDiagE","text":"ModalMultiDiagE(p::Int)\n\nApproximation 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.\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.ModalTensor","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.ModalTensor","text":"ModalTensor(p::Int)\n\nApproximation 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.\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.NodalMulti","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.NodalMulti","text":"NodalMulti(p::Int)\n\nApproximation 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.\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.NodalMultiDiagE","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.NodalMultiDiagE","text":"NodalMultiDiagE(p::Int)\n\nApproximation 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.\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.NodalTensor","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.NodalTensor","text":"NodalTensor(p::Int)\n\nApproximation 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.\n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.ReferenceApproximation","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.ReferenceApproximation","text":"ReferenceApproximation(approx_type::AbstractReferenceMapping,\n element_type::StartUpDG.AbstractElemShape, kwargs...)\n\nData 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:\n\napprox_type::AbstractApproximationType: Type of operators used for the discretization on the reference element (NodalTensor, ModalTensor, NodalMulti, ModalMulti, NodalMultiDiagE, or ModalMultiDiagE)\nreference_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)\nD::NTuple{d, <:LinearMap}: Tuple of operators of size N_q by N_q approximating each partial derivative at the volume quadrature nodes\nV::LinearMap: Generalized Vandermonde matrix of size N_q by N_p mapping solution degrees of freedom to values at volume quadrature nodes\nVf::LinearMap: Generalized Vandermonde matrix of size N_f by N_p mapping solution degrees of freedom to values at facet quadrature nodes\nR::LinearMap: Interpolation/extrapolation operator of size N_f by N_q which maps nodal data from volume quadrature nodes to facet quadrature nodes \nW::Diagonal: Volume quadrature weight matrix of size N_q by N_q\nB::Diagonal: Facet quadrature weight matrix of size N_f by N_f\nV_plot::LinearMap: Generalized Vandermonde matrix mapping solution degrees of freedom to plotting nodes\nreference_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\n\nOuter constructors are provided to construct the discrete operators by dispatching on each combination of subtypes of AbstractApproximationType and StartUpDG.AbstractElemShape. \n\n\n\n\n\n","category":"type"},{"location":"SpatialDiscretizations/#StableSpectralElements.SpatialDiscretizations.SpatialDiscretization","page":"SpatialDiscretizations","title":"StableSpectralElements.SpatialDiscretizations.SpatialDiscretization","text":"SpatialDiscretization(mesh::StartUpDG.MeshData,\n reference_approximation::ReferenceApproximation,\n metric_type::AbstractMetrics, kwargs...)\n\nComposite type containing data for constructing the discretization on the reference element as well as the mesh and associated metric terms.\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#Module-ConservationLaws","page":"ConservationLaws","title":"Module ConservationLaws","text":"","category":"section"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"The ConservationLaws module defines the systems of partial differential equations which are solved by StableSpectralElements.jl.","category":"page"},{"location":"ConservationLaws/#Overview","page":"ConservationLaws","title":"Overview","text":"","category":"section"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"The equations to be solved are defined by subtypes of AbstractConservationLaw on which functions such as physical_flux and numerical_flux are dispatched. Whereas first-order problems (i.e. subtypes of AbstractConservationLaw{d, FirstOrder}) remove the dependence of the flux tensor on the solution gradient in order to obtain systems of the form","category":"page"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"partial_t underlineU(bmxt) + bmnabla_bmx cdot underlinebmF(underlineU(bmxt)) = underline0","category":"page"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"second-order problems (i.e. subtypes of AbstractConservationLaw{d, SecondOrder}) are treated by StableSpectralElements.jl as first-order systems of the form ","category":"page"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"beginaligned\nunderlinebmQ(bmxt) - bmnabla_bmx underlineU(bmxt) = underline0\npartial_t underlineU(bmxt) + bmnabla_bmx cdot underlinebmF(underlineU(bmxt) underlinebmQ(bmxt)) = underline0\nendaligned","category":"page"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"Currently, the linear advection and advection-diffusion equations (LinearAdvectionEquation and LinearAdvectionDiffusionEquation), the inviscid and viscous Burgers' equations (InviscidBurgersEquation and ViscousBurgersEquation), and the compressible Euler equations (EulerEquations) are supported by StableSpectralElements.jl, but any system of the above form can in principle be implemented, provided that appropriate physical and numerical fluxes are defined.","category":"page"},{"location":"ConservationLaws/#Reference","page":"ConservationLaws","title":"Reference","text":"","category":"section"},{"location":"ConservationLaws/","page":"ConservationLaws","title":"ConservationLaws","text":"Modules = [ConservationLaws]\nOrder = [:function, :type]","category":"page"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.AbstractConservationLaw","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.AbstractConservationLaw","text":"AbstractConservationLaw{d, PDEType, N_c}\n\nAbstract type for a conservation law, where d is the number of spatial dimensions, PDEType <: AbstractPDEType is either FirstOrder or SecondOrder, and N_c is the number of conservative variables.\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.EulerEquations","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.EulerEquations","text":"EulerEquations{d}(γ::Float64) where {d}\n\nDefine an Euler system governing compressible, adiabatic fluid flow, taking the form\n\nfracpartialpartial tleftbeginarrayc\nrho(bmx t) \nrho(bmx t) V_1(bmx t) \nvdots \nrho(bmx t) V_d(bmx t) \nE(bmx t)\nendarrayright+sum_m=1^d fracpartialpartial x_mleftbeginarrayc\nrho(bmx t) V_m(bmx t) \nrho(bmx t) V_1(bmx t) V_m(bmx t)+P(bmx t) delta_1 m \nvdots \nrho(bmx t) V_d(bmx t) V_m(bmx t)+P(bmx t) delta_d m \nV_m(bmx t)(E(bmx t)+P(bmx t))\nendarrayright=underline0\n\nwhere rho(bmxt) in mathbbR is the fluid density, bmV(bmxt) in mathbbR^d is the flow velocity, E(bmxt) in mathbbR is the total energy per unit volume, and the pressure is given for an ideal gas with constant specific heat as\n\nP(bmxt) = (gamma - 1)Big(E(bmxt) - frac12rho(bmxt) lVert bmV(bmxt)rVert^2Big)\n\nThe specific heat ratio is specified as a parameter gamma, which must be greater than unity.\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.EulerPeriodicTest","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.EulerPeriodicTest","text":"EulerPeriodicTest(conservation_law::EulerEquations{d},\n strength = 0.2, L = 2.0)\n\nPeriodic wave test case for EulerEquations{d} on the domain Omega = 0L^d, based on the following paper:\n\nG.-S. Jiang and C.-W. Shu (1996). Efficient implementation of weighted ENO schemes. Journal of Computational Physics 126(1): 202-228.\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.InviscidBurgersEquation","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.InviscidBurgersEquation","text":"InviscidBurgersEquation(a::NTuple{d,Float64}) where {d}\n\nDefine an inviscid Burgers' equation of the form\n\npartial_t U(bmxt) + bmnabla_bmx cdot big(tfrac12bma U(bmxt)^2 big) = 0\n\nwhere bma in R^d. A specialized constructor InviscidBurgersEquation() is provided for the one-dimensional case with a = (1.0,).\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.IsentropicVortex","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.IsentropicVortex","text":"IsentropicVortex(conservation_law::EulerEquations{2};\n Ma = 0.4, θ = π/4, R = 1.0, β = 1.0,\n σ = 1.0, x_0 = (0.0, 0.0))\n\nIsentropic vortex test case for EulerEquations{2}\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.KelvinHelmholtzInstability","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.KelvinHelmholtzInstability","text":"KelvinHelmholtzInstability(conservation_law::EulerEquations{2}, ρ_0 = 0.5)\n\nKelvin-Helmholtz instability initial condition for EulerEquations{2} on the domain Omega = 02^2\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.LinearAdvectionDiffusionEquation","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.LinearAdvectionDiffusionEquation","text":"LinearAdvectionDiffusionEquation(a::NTuple{d,Float64}, b::Float64) where {d}\n\nDefine a linear advection-diffusion equation of the form\n\npartial_t U(bmxt) + bmnabla_bmx cdot big( bma U(bmxt) - b bmnabla U(bmxt)big) = 0\n\nwith a constant advection velocity bma in R^d and diffusion coefficient b in R^+. A specialized constructor LinearAdvectionDiffusionEquation(a::Float64, b::Float64) is provided for the one-dimensional case.\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.LinearAdvectionEquation","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.LinearAdvectionEquation","text":"LinearAdvectionEquation(a::NTuple{d,Float64}) where {d}\n\nDefine a linear advection equation of the form\n\npartial_t U(bmxt) + bmnabla_bmx cdot big( bma U(bmxt) big) = 0\n\nwith a constant advection velocity bma in R^d. A specialized constructor LinearAdvectionEquation(a::Float64) is provided for the one-dimensional case.\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.TaylorGreenVortex","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.TaylorGreenVortex","text":"TaylorGreenVortex(conservation_law::EulerEquations{3}, Ma = 0.1)\n\nInviscid Taylor-Green vortex initial condition for EulerEquations{3} on the domain Omega = 0 2pi^3.\n\n\n\n\n\n","category":"type"},{"location":"ConservationLaws/#StableSpectralElements.ConservationLaws.ViscousBurgersEquation","page":"ConservationLaws","title":"StableSpectralElements.ConservationLaws.ViscousBurgersEquation","text":"ViscousBurgersEquation(a::NTuple{d,Float64}, b::Float64) where {d}\n\nDefine a viscous Burgers' equation of the form\n\npartial_t U(bmxt) + bmnabla_bmx cdot big(tfrac12bma U(bmxt)^2 - b bmnabla U(bmxt)big) = 0\n\nwhere bma in R^d and b in R^+. A specialized constructor ViscousBurgersEquation(b::Float64) is provided for the one-dimensional case with a = (1.0,).\n\n\n\n\n\n","category":"type"},{"location":"#StableSpectralElements.jl","page":"Home","title":"StableSpectralElements.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"StableSpectralElements.jl is a Julia framework for the numerical solution of partial differential equations of the form","category":"page"},{"location":"","page":"Home","title":"Home","text":"partial_t underlineU(bmxt) + bmnabla_bmx cdot underlinebmF(underlineU(bmxt) bmnabla_bmxunderlineU(bmxt)) = underline0","category":"page"},{"location":"","page":"Home","title":"Home","text":"for t in (0T) with T in mathbbR^+ and bmx in Omega subset mathbbR^d, subject to appropriate initial and boundary conditions, where underlineU(bmxt) is the vector of solution variables and underlinebmF(underlineU(bmxt)bmnabla_bmxunderlineU(bmxt)) is the flux tensor containing advective and/or diffusive contributions. These equations are spatially discretized on curvilinear unstructured grids using energy-stable and entropy-stable discontinuous spectral element methods in order to generate ODEProblem objects suitable for time integration using OrdinaryDiffEq.jl within the SciML ecosystem. StableSpectralElements.jl also includes postprocessing tools employing WriteVTK.jl for generating .vtu files, allowing for visualization of high-order numerical solutions on unstructured grids using ParaView or other software. Shared-memory parallelization is supported through multithreading.","category":"page"},{"location":"","page":"Home","title":"Home","text":"The functionality provided by StartUpDG.jl for the handling of mesh data structures, polynomial basis functions, and quadrature nodes is employed throughout this package. Moreover, StableSpectralElements.jl implements dispatched strategies for semi-discrete operator evaluation using LinearMaps.jl, allowing for the efficient matrix-free application of tensor-product operators.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Discretizations satisfying the summation-by-parts (SBP) property employing nodal as well as modal bases are implemented, with the latter allowing for efficient and low-storage inversion of the dense elemental mass matrices arising from curvilinear meshes through the use of weight-adjusted approximations. Tensor-product formulations supporting sum factorization are available on triangles and tetrahedra through the use of SBP operators in collapsed coordinates, as well as on quadrilaterals and hexahedra.","category":"page"},{"location":"#Theory","page":"Home","title":"Theory","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"For a comprehensive overview of the numerical methods implemented in StableSpectralElements.jl, please refer to Tristan's PhD thesis, Provably Stable Discontinuous Spectral-Element Methods with the Summation-by-Parts Property: Unified Matrix Analysis and Efficient Tensor-Product Formulations on Curved Simplices.","category":"page"},{"location":"#Installation","page":"Home","title":"Installation","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"StableSpectralElements.jl is a registered Julia package (compatible with Julia versions 1.10 and higher) and can be installed by entering the following commands within the Julia REPL (read-eval-print loop):","category":"page"},{"location":"","page":"Home","title":"Home","text":"using Pkg; Pkg.add(\"StableSpectralElements\")","category":"page"},{"location":"","page":"Home","title":"Home","text":"Alternatively, you can clone the repository and run your local version as follows:","category":"page"},{"location":"","page":"Home","title":"Home","text":"git clone https://github.com/tristanmontoya/StableSpectralElements.jl.git\ncd StableSpectralElements.jl\njulia --project=.","category":"page"},{"location":"","page":"Home","title":"Home","text":"In either case, you can then start using the package by entering using StableSpectralElements.","category":"page"},{"location":"#Examples","page":"Home","title":"Examples","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"We recommend that users refer to the following Jupyter notebooks (included in the examples directory) for examples of how to use StableSpectralElements.jl:","category":"page"},{"location":"","page":"Home","title":"Home","text":"Linear advection-diffusion equation in 1D\nInviscid Burgers' equation in 1D with energy-conservative scheme\nEuler equations in 1D with entropy-conservative Gauss collocation methods\nLinear advection equation in 2D\nIsentropic Euler vortex in 2D with entropy-stable modal scheme on triangles\nLinear advection equation in 3D\n3D Euler equations with entropy-stable modal scheme on tetrahedra","category":"page"},{"location":"#Citing","page":"Home","title":"Citing","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"If you use StableSpectralElements.jl in your research, please cite the following publications:","category":"page"},{"location":"","page":"Home","title":"Home","text":"@article{MontoyaZinggTensorProduct24,\n title = {Efficient Tensor-Product Spectral-Element Operators with the Summation-by-Parts \n Property on Curved Triangles and Tetrahedra},\n author = {Montoya, Tristan and Zingg, David W},\n journal = {{SIAM} Journal on Scientific Computing},\n volume = {46},\n number = {4},\n pages = {A2270--A2297},\n doi = {10.1137/23M1573963},\n year = {2024}\n}\n\n@article{MontoyaZinggEntropyStable24,\n title = {Efficient Entropy-Stable Discontinuous Spectral-Element Methods Using \n Tensor-Product Summation-by-Parts Operators on Triangles and Tetrahedra},\n author = {Montoya, Tristan and Zingg, David W},\n journal = {Journal of Computational Physics},\n volume = {516},\n pages = {113360},\n doi = {10.1016/j.jcp.2024.113360},\n year = {2024}\n}","category":"page"},{"location":"","page":"Home","title":"Home","text":"The following repositories are associated with the above papers, and contain the code required to reproduce the results presented therein:","category":"page"},{"location":"","page":"Home","title":"Home","text":"https://github.com/tristanmontoya/ReproduceSBPSimplex\nhttps://github.com/tristanmontoya/ReproduceEntropyStableDSEM","category":"page"},{"location":"#License","page":"Home","title":"License","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"This software is released under the GPLv3 license.","category":"page"}] }