From 7dffeade94360eb5744bbfee0055cead7dfa395c Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Mon, 23 Oct 2023 13:27:46 +0000 Subject: [PATCH] build based on 7f1a5db --- dev/.documenter-siteinfo.json | 2 +- dev/index.html | 2 +- dev/license/index.html | 2 +- dev/overview/index.html | 2 +- dev/ref/index.html | 18 +++++++++--------- dev/reproduce/index.html | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 49d049bc..c04f6469 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-23T13:06:45","documenter_version":"1.1.2"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-10-23T13:27:41","documenter_version":"1.1.2"}} \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index ed3844be..6c33f064 100644 --- a/dev/index.html +++ b/dev/index.html @@ -2,4 +2,4 @@ Home · DispersiveShallowWater.jl

DispersiveShallowWater.jl

Docs-stable Docs-dev Build Status Coveralls Aqua QA License: MIT

DispersiveShallowWater.jl is a Julia package that implements structure-preserving numerical methods for dispersive shallow water models. To date, it provides provably conservative, entropy-conserving and well-balanced numerical schemes for two dispersive shallow water models:

The semidiscretizations are based on summation by parts (SBP) operators, which are implemented in SummationByPartsOperators.jl. In order to obtain fully discrete schemes, the time integration methods from OrdinaryDiffEq.jl are used to solve the resulting ordinary differential equations. Fully discrete entropy-conservative methods can be obtained by using the relaxation method provided by DispersiveShallowWater.jl.

Installation

If you have not yet installed Julia, then you first need to download Julia. Please follow the instructions for your operating system. DispersiveShallowWater.jl works with Julia v1.8 and newer. DispersiveShallowWater.jl is a registered Julia package. Therefore, you can install it by executing the following commands from the Julia REPL

julia> using Pkg
 
 julia> Pkg.add(["DispersiveShallowWater", "OrdinaryDiffEq", "Plots"])

In addition, this installs the packages OrdinaryDiffEq.jl used for time-integration and Plots.jl to visualize the results. If you want to use other SBP operators than the default operators that DispersiveShallowWater.jl uses, then you also need SummationByPartsOperators.jl, which can be installed running

julia> Pkg.add("SummationByPartsOperators")

Usage

In the Julia REPL, first load the package DispersiveShallowWater.jl

julia> using DispersiveShallowWater

You can run a basic simulation that solves the BBM-BBM equations by executing

julia> include(default_example());

The result can be visualized by using the package Plots.jl

julia> using Plots
-julia> plot(semi => sol)

The command plot expects a Pair consisting of a Semidiscretization and an ODESolution. The visualization can also be customized, see the documentation for more details. Other examples can be found in the subdirectory examples/. A list of all examples is returned by running get_examples(). You can pass the filename of one of the examples or your own simulation file to include in order to run it, e.g., include(joinpath(examples_dir(), "svaerd_kalisch_1d", "svaerd_kalisch_1d_dingemans_relaxation.jl")).

Authors

The package is developed and maintained by Joshua Lampert and was initiated as part of the master thesis "Structure-Preserving Numerical Methods for Dispersive Shallow Water Models" (2023). Some parts of this repository are based on parts of Dispersive-wave-schemes-notebooks. A Broad Class of Conservative Numerical Methods for Dispersive Wave Equations by Hendrik Ranocha, Dimitrios Mitsotakis and David Ketcheson. The code structure is inspired by Trixi.jl.

License and contributing

DispersiveShallowWater.jl is published under the MIT license (see License). We are pleased to accept contributions from everyone, preferably in the form of a PR.

+julia> plot(semi => sol)

The command plot expects a Pair consisting of a Semidiscretization and an ODESolution. The visualization can also be customized, see the documentation for more details. Other examples can be found in the subdirectory examples/. A list of all examples is returned by running get_examples(). You can pass the filename of one of the examples or your own simulation file to include in order to run it, e.g., include(joinpath(examples_dir(), "svaerd_kalisch_1d", "svaerd_kalisch_1d_dingemans_relaxation.jl")).

Authors

The package is developed and maintained by Joshua Lampert and was initiated as part of the master thesis "Structure-Preserving Numerical Methods for Dispersive Shallow Water Models" (2023). Some parts of this repository are based on parts of Dispersive-wave-schemes-notebooks. A Broad Class of Conservative Numerical Methods for Dispersive Wave Equations by Hendrik Ranocha, Dimitrios Mitsotakis and David Ketcheson. The code structure is inspired by Trixi.jl.

License and contributing

DispersiveShallowWater.jl is published under the MIT license (see License). We are pleased to accept contributions from everyone, preferably in the form of a PR.

diff --git a/dev/license/index.html b/dev/license/index.html index b494535b..c0fcf726 100644 --- a/dev/license/index.html +++ b/dev/license/index.html @@ -1,2 +1,2 @@ -License · DispersiveShallowWater.jl

License

MIT License

Copyright (c) 2023-present Joshua Lampert <joshua.lampert@uni-hamburg.de>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+License · DispersiveShallowWater.jl

License

MIT License

Copyright (c) 2023-present Joshua Lampert <joshua.lampert@uni-hamburg.de>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

diff --git a/dev/overview/index.html b/dev/overview/index.html index 41d66c5c..b57cfa89 100644 --- a/dev/overview/index.html +++ b/dev/overview/index.html @@ -188,4 +188,4 @@ anim = @animate for step in 1:length(sol.u) plot(semi => sol, plot_initial = true, conversion = waterheight_total, step = step, xlim = (-50, 20), ylims = [(-0.8, 0.1)]) end -gif(anim, "shoaling_solution_dg.gif", fps = 25)Example block output

For more details see also the documentation of SummationByPartsOperators.jl

Additional resources

Some more examples sorted by the simulated equations can be found in the examples/ subdirectory. Especially, in examples/svaerd_kalisch_1d/ you can find Julia scripts that solve the SvaerdKalischEquations1D that were not covered in this tutorial. The same steps as described above, however, apply in the same way to these equations. Attention must be paid for these equations because they do not conserve the classical total entropy $\mathcal E$, but a modified entropy $\hat{\mathcal E}$, available as entropy_modified.

More examples, especially focussing on plotting, can be found in the scripts create_figures.jl and plot_examples.jl.

References

+gif(anim, "shoaling_solution_dg.gif", fps = 25)Example block output

For more details see also the documentation of SummationByPartsOperators.jl

Additional resources

Some more examples sorted by the simulated equations can be found in the examples/ subdirectory. Especially, in examples/svaerd_kalisch_1d/ you can find Julia scripts that solve the SvaerdKalischEquations1D that were not covered in this tutorial. The same steps as described above, however, apply in the same way to these equations. Attention must be paid for these equations because they do not conserve the classical total entropy $\mathcal E$, but a modified entropy $\hat{\mathcal E}$, available as entropy_modified.

More examples, especially focussing on plotting, can be found in the scripts create_figures.jl and plot_examples.jl.

References

diff --git a/dev/ref/index.html b/dev/ref/index.html index 3503446e..6de4739c 100644 --- a/dev/ref/index.html +++ b/dev/ref/index.html @@ -1,28 +1,28 @@ -Reference · DispersiveShallowWater.jl

DispersiveShallowWater.jl API

DispersiveShallowWater.AbstractEquationsType
AbstractEquations{NDIMS, NVARS}

An abstract supertype of specific equations such as the BBM-BBM equations. The type parameters encode the number of spatial dimensions (NDIMS) and the number of primary variables (NVARS) of the physics model.

source
DispersiveShallowWater.AnalysisCallbackType
AnalysisCallback(semi; interval=0,
+Reference · DispersiveShallowWater.jl

DispersiveShallowWater.jl API

DispersiveShallowWater.AbstractEquationsType
AbstractEquations{NDIMS, NVARS}

An abstract supertype of specific equations such as the BBM-BBM equations. The type parameters encode the number of spatial dimensions (NDIMS) and the number of primary variables (NVARS) of the physics model.

source
DispersiveShallowWater.AnalysisCallbackType
AnalysisCallback(semi; interval=0,
                        extra_analysis_errors=Symbol[],
                        extra_analysis_integrals=(),
-                       io=stdout)

Analyze a numerical solution every interval time steps. The L2- and the L∞-norm for each component are computed by default. Additional errors can be computed, e.g. by passing extra_analysis_errors = (:conservation_error,).

Further scalar functions func in extra_analysis_integrals are applied to the numerical solution and integrated over the computational domain. Some examples for this are entropy, and energy_total. You can also write your own function with the same signature as the examples listed above and pass it via extra_analysis_integrals. The computed errors and intergrals are saved for each timestep and can be obtained by calling errors and integrals.

During the Simulation, the AnalysisCallback will print information to io.

source
DispersiveShallowWater.BBMBBMEquations1DType
BBMBBMEquations1D(gravity, D)

BBM-BBM (Benjamin–Bona–Mahony) system in one spatial dimension. The equations are given by

\[\begin{aligned} + io=stdout)

Analyze a numerical solution every interval time steps. The L2- and the L∞-norm for each component are computed by default. Additional errors can be computed, e.g. by passing extra_analysis_errors = (:conservation_error,).

Further scalar functions func in extra_analysis_integrals are applied to the numerical solution and integrated over the computational domain. Some examples for this are entropy, and energy_total. You can also write your own function with the same signature as the examples listed above and pass it via extra_analysis_integrals. The computed errors and intergrals are saved for each timestep and can be obtained by calling errors and integrals.

During the Simulation, the AnalysisCallback will print information to io.

source
DispersiveShallowWater.BBMBBMEquations1DType
BBMBBMEquations1D(gravity, D)

BBM-BBM (Benjamin–Bona–Mahony) system in one spatial dimension. The equations are given by

\[\begin{aligned} \eta_t + ((\eta + D)v)_x - \frac{1}{6}D^2\eta_{xxt} &= 0,\\ v_t + g\eta_x + \left(\frac{1}{2}v^2\right)_x - \frac{1}{6}D^2v_{xxt} &= 0. -\end{aligned}\]

The unknown quantities of the BBM-BBM equations are the total water height $\eta$ and the velocity $v$. The gravitational constant is denoted by g and the constant bottom topography (bathymetry) $b = -D$. The water height above the bathymetry is therefore given by $h = \eta + D$.

One reference for the BBM-BBM system can be found in

source
DispersiveShallowWater.BBMBBMVariableEquations1DType
BBMBBMVariableEquations1D(gravity, eta0 = 1.0)

BBM-BBM (Benjamin–Bona–Mahony) system in one spatial dimension with spatially varying bathymetry. The equations are given by

\[\begin{aligned} +\end{aligned}\]

The unknown quantities of the BBM-BBM equations are the total water height $\eta$ and the velocity $v$. The gravitational constant is denoted by g and the constant bottom topography (bathymetry) $b = -D$. The water height above the bathymetry is therefore given by $h = \eta + D$.

One reference for the BBM-BBM system can be found in

source
DispersiveShallowWater.BBMBBMVariableEquations1DType
BBMBBMVariableEquations1D(gravity, eta0 = 1.0)

BBM-BBM (Benjamin–Bona–Mahony) system in one spatial dimension with spatially varying bathymetry. The equations are given by

\[\begin{aligned} \eta_t + ((\eta + D)v)_x - \frac{1}{6}(D^2\eta_{xt})_x &= 0,\\ v_t + g\eta_x + \left(\frac{1}{2}v^2\right)_x - \frac{1}{6}(D^2v_t)_{xx} &= 0. -\end{aligned}\]

The unknown quantities of the BBM-BBM equations are the total water height $\eta$ and the velocity $v$. The gravitational constant is denoted by g and the bottom topography (bathymetry) $b = -D$. The water height above the bathymetry is therefore given by $h = \eta + D$.

One reference for the BBM-BBM system with spatially varying bathymetry can be found in

  • Samer Israwi, Henrik Kalisch, Theodoros Katsaounis, Dimitrios Mitsotakis (2022) A regularized shallow-water waves system with slip-wall boundary conditions in a basin: theory and numerical analysis DOI: 10.1088/1361-6544/ac3c29
source
DispersiveShallowWater.RelaxationCallbackType
RelaxationCallback(invariant)

Use a relaxation method in time in order to exactly preserve the (nonlinear) invariant for a conservative semidiscretization. A possible choice for invariant is invariant = entropy.

Reference

  • Hendrik Ranocha, Mohammed Sayyari, Lisandro Dalcin, Matteo Parsani, David I. Ketcheson (2020) Relaxation Runge–Kutta Methods: Fully-Discrete Explicit Entropy-Stable Schemes for the Compressible Euler and Navier–Stokes Equations DOI: 10.1137/19M1263480
source
DispersiveShallowWater.SemidiscretizationMethod
Semidiscretization(mesh, equations, initial_condition, solver;
+\end{aligned}\]

The unknown quantities of the BBM-BBM equations are the total water height $\eta$ and the velocity $v$. The gravitational constant is denoted by g and the bottom topography (bathymetry) $b = -D$. The water height above the bathymetry is therefore given by $h = \eta + D$.

One reference for the BBM-BBM system with spatially varying bathymetry can be found in

  • Samer Israwi, Henrik Kalisch, Theodoros Katsaounis, Dimitrios Mitsotakis (2022) A regularized shallow-water waves system with slip-wall boundary conditions in a basin: theory and numerical analysis DOI: 10.1088/1361-6544/ac3c29
source
DispersiveShallowWater.RelaxationCallbackType
RelaxationCallback(invariant)

Use a relaxation method in time in order to exactly preserve the (nonlinear) invariant for a conservative semidiscretization. A possible choice for invariant is invariant = entropy.

Reference

  • Hendrik Ranocha, Mohammed Sayyari, Lisandro Dalcin, Matteo Parsani, David I. Ketcheson (2020) Relaxation Runge–Kutta Methods: Fully-Discrete Explicit Entropy-Stable Schemes for the Compressible Euler and Navier–Stokes Equations DOI: 10.1137/19M1263480
source
DispersiveShallowWater.SemidiscretizationMethod
Semidiscretization(mesh, equations, initial_condition, solver;
                    boundary_conditions=boundary_condition_periodic,
                    RealT=real(solver),
                    uEltype=RealT,
-                   initial_cache=NamedTuple())

Construct a semidiscretization of a PDE.

source
DispersiveShallowWater.SolverMethod
Solver(mesh, accuracy_order)

Create a solver, where the summation by parts (SBP) operators are of order accuracy_order and associated to the mesh.

source
DispersiveShallowWater.SolverMethod
Solver(D1, D2)

Create a solver, where D1 is an AbstractDerivativeOperator from SummationByPartsOperators.jl of first derivative_order and D2 is an AbstractDerivativeOperator of second derivative_order or an AbstractMatrix. Both summation by parts operators should be associated with the same grid.

source
DispersiveShallowWater.SvaerdKalischEquations1DType
SvärdKalischEquations1D(gravity, eta0 = 1.0, alpha = 0.0, beta = 0.2308939393939394, gamma = 0.04034343434343434)

Dispersive system by Svärd and Kalisch in one spatial dimension with spatially varying bathymetry. The equations are given in conservative variables by

\[\begin{aligned} + initial_cache=NamedTuple())

Construct a semidiscretization of a PDE.

source
DispersiveShallowWater.SolverMethod
Solver(mesh, accuracy_order)

Create a solver, where the summation by parts (SBP) operators are of order accuracy_order and associated to the mesh.

source
DispersiveShallowWater.SolverMethod
Solver(D1, D2)

Create a solver, where D1 is an AbstractDerivativeOperator from SummationByPartsOperators.jl of first derivative_order and D2 is an AbstractDerivativeOperator of second derivative_order or an AbstractMatrix. Both summation by parts operators should be associated with the same grid.

source
DispersiveShallowWater.SvaerdKalischEquations1DType
SvärdKalischEquations1D(gravity, eta0 = 1.0, alpha = 0.0, beta = 0.2308939393939394, gamma = 0.04034343434343434)

Dispersive system by Svärd and Kalisch in one spatial dimension with spatially varying bathymetry. The equations are given in conservative variables by

\[\begin{aligned} h_t + (hv)_x &= (\hat\alpha(\hat\alpha(h + b)_x)_x)_x,\\ (hv)_t + (hv^2)_x + gh(h + b)_x &= (\hat\alpha v(\hat\alpha(h + b)_x)_x)_x + (\hat\beta v_x)_{xt} + \frac{1}{2}(\hat\gamma v_x)_{xx} + \frac{1}{2}(\hat\gamma v_{xx})_x, \end{aligned}\]

where $\hat\alpha^2 = \alpha\sqrt{gd}d^2$, $\hat\beta = \beta d^3$, $\hat\gamma = \gamma\sqrt{gd}d^3$. The coefficients $\alpha$, $\beta$ and $\gamma$ are provided in dimensionless form and $d = \eta_0 - b$ is the still-water depth and eta0 is the still-water surface (lake-at-rest). The equations can be rewritten in primitive variables as

\[\begin{aligned} \eta_t + ((\eta + D)v)_x = (\hat\alpha(\hat\alpha\eta_x)_x)_x,\\ v_t(\eta + D) - v((\eta + D)v)_x + ((\eta + D)v^2)_x + g(\eta + D)\eta_x &= (\hat\alpha v(\hat\alpha\eta_x)_x)_x - v(\hat\alpha(\hat\alpha\eta_x)_x)_x + (\hat\beta v_x)_{xt} + \frac{1}{2}(\hat\gamma v_x)_{xx} + \frac{1}{2}(\hat\gamma v_{xx})_x. -\end{aligned}\]

The unknown quantities of the Svärd-Kalisch equations are the total water height $\eta$ and the velocity $v$. The gravitational constant is denoted by g and the bottom topography (bathymetry) $b = -D$. The water height above the bathymetry is therefore given by $h = \eta + D$.

The equations by Svärd and Kalisch are presented and analyzed in

  • Magnus Svärd, Henrik Kalisch (2023) A novel energy-bounded Boussinesq model and a well-balanced and stable numerical discretization arXiv: 2302.09924
source
DispersiveShallowWater.cons2primFunction
cons2prim(u, equations)

Convert the conserved variables u to the primitive variables for a given set of equations. u is a vector type of the correct length nvariables(equations). Notice the function doesn't include any error checks for the purpose of efficiency, so please make sure your input is correct. The inverse conversion is performed by prim2cons.

source
DispersiveShallowWater.convergence_testMethod
convergence_test([mod::Module=Main,] example::AbstractString, iterations; kwargs...)

Run iterations simulations using the setup given in example and compute the experimental order of convergence (EOC) in the $L^2$ and $L^\infty$ norm. In each iteration, the resolution of the respective mesh will be doubled. Additional keyword arguments kwargs... and the optional module mod are passed directly to trixi_include.

Adjusted from Trixi.jl.

source
DispersiveShallowWater.eachvariableMethod
eachvariable(equations::AbstractEquations)

Return an iterator over the indices that specify the location in relevant data structures for the variables in equations. In particular, not the variables themselves are returned.

source
DispersiveShallowWater.energy_totalFunction
energy_total(q, equations)

Return the total energy of the primitive variables q for a given set of equations.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.energy_total_modifiedMethod
energy_total_modified(q, equations::SvaerdKalischEquations1D, cache)

Return the modified total energy of the primitive variables q for the SvaerdKalischEquations1D. It contains an additional term containing a derivative compared to the usual energy_total. The energy_total_modified is a conserved quantity of the Svärd-Kalisch equations.

q is a vector of the primitive variables at ALL nodes, i.e., a matrix of the correct length nvariables(equations) as first dimension and the number of nodes as length of the second dimension. cache needs to hold the first-derivative SBP operator D1.

source
DispersiveShallowWater.entropyFunction
entropy(q, equations)

Return the entropy of the primitive variables q for a given set of equations.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.errorsMethod
errors(analysis_callback)

Return the computed errors for each timestep as a named tuple. The shape of each entry is (nvariables, ntimesteps).

source
DispersiveShallowWater.examples_dirMethod
examples_dir()

Return the directory where the example files provided with DispersiveShallowWater.jl are located. If DispersiveShallowWater is installed as a regular package (with ]add DispersiveShallowWater), these files are read-only and should not be modified. To find out which files are available, use, e.g., readdir.

Copied from Trixi.jl.

Examples

readdir(examples_dir())
source
DispersiveShallowWater.get_nameMethod
get_name(equations::AbstractEquations)

Return the canonical, human-readable name for the given system of equations.

Examples

julia> DispersiveShallowWater.get_name(BBMBBMEquations1D(gravity_constant=1.0))
-"BBMBBMEquations1D"
source
DispersiveShallowWater.initial_condition_dingemansMethod
initial_condition_dingemans(x, t, equations::BBMBBMVariableEquations1D, mesh)

The initial condition that uses the dispersion relation of the Euler equations to approximate waves generated by a wave maker as it is done by experiments of Dingemans. The topography is a trapesoidal.

References:

  • Magnus Svärd, Henrik Kalisch (2023) A novel energy-bounded Boussinesq model and a well-balanced and stable numerical discretization arXiv: 2302.09924
  • Maarten W. Dingemans (1994) Comparison of computations with Boussinesq-like models and laboratory measurements link
source
DispersiveShallowWater.initial_condition_dingemansMethod
initial_condition_dingemans(x, t, equations::SvaerdKalischEquations1D, mesh)

The initial condition that uses the dispersion relation of the Euler equations to approximate waves generated by a wave maker as it is done by experiments of Dingemans. The topography is a trapesoidal. It is assumed that equations.eta0 = 0.8.

References:

  • Magnus Svärd, Henrik Kalisch (2023) A novel energy-bounded Boussinesq model and a well-balanced and stable numerical discretization arXiv: 2302.09924
  • Maarten W. Dingemans (1994) Comparison of computations with Boussinesq-like models and laboratory measurements link
source
DispersiveShallowWater.momentumMethod
momentum(q, equations)

Return the momentum of the primitive variables q for a given set of equations, i.e. the waterheight times the velocity.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.path_create_figuresMethod
path_create_figures()

Return the path to the file that creates all figures used in the master thesis "Structure-preserving Numerical Methods for Dispersive Shallow Water Model" (2023). Executing this julia script may take a while.

Examples

include(DispersiveShallowWater.path_create_figures())
source
DispersiveShallowWater.prim2consFunction
prim2cons(q, equations)

Convert the primitive variables q to the conserved variables for a given set of equations. q is a vector type of the correct length nvariables(equations). Notice the function doesn't include any error checks for the purpose of efficiency, so please make sure your input is correct. The inverse conversion is performed by cons2prim.

source
DispersiveShallowWater.trixi_includeMethod
trixi_include([mod::Module=Main,] example::AbstractString; kwargs...)

include the file example and evaluate its content in the global scope of module mod. You can override specific assignments in example by supplying keyword arguments. It's basic purpose is to make it easier to modify some parameters while running DispersiveShallowWater from the REPL. Additionally, this is used in tests to reduce the computational burden for CI while still providing examples with sensible default values for users.

Before replacing assignments in example, the keyword argument maxiters is inserted into calls to solve and DispersiveShallowWater.solve with it's default value used in the SciML ecosystem for ODEs, see the "Miscellaneous" section of the documentation.

Copied from Trixi.jl.

Examples

julia> redirect_stdout(devnull) do
+\end{aligned}\]

The unknown quantities of the Svärd-Kalisch equations are the total water height $\eta$ and the velocity $v$. The gravitational constant is denoted by g and the bottom topography (bathymetry) $b = -D$. The water height above the bathymetry is therefore given by $h = \eta + D$.

The equations by Svärd and Kalisch are presented and analyzed in

  • Magnus Svärd, Henrik Kalisch (2023) A novel energy-bounded Boussinesq model and a well-balanced and stable numerical discretization arXiv: 2302.09924
source
DispersiveShallowWater.cons2primFunction
cons2prim(u, equations)

Convert the conserved variables u to the primitive variables for a given set of equations. u is a vector type of the correct length nvariables(equations). Notice the function doesn't include any error checks for the purpose of efficiency, so please make sure your input is correct. The inverse conversion is performed by prim2cons.

source
DispersiveShallowWater.convergence_testMethod
convergence_test([mod::Module=Main,] example::AbstractString, iterations; kwargs...)

Run iterations simulations using the setup given in example and compute the experimental order of convergence (EOC) in the $L^2$ and $L^\infty$ norm. In each iteration, the resolution of the respective mesh will be doubled. Additional keyword arguments kwargs... and the optional module mod are passed directly to trixi_include.

Adjusted from Trixi.jl.

source
DispersiveShallowWater.eachvariableMethod
eachvariable(equations::AbstractEquations)

Return an iterator over the indices that specify the location in relevant data structures for the variables in equations. In particular, not the variables themselves are returned.

source
DispersiveShallowWater.energy_totalFunction
energy_total(q, equations)

Return the total energy of the primitive variables q for a given set of equations.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.energy_total_modifiedMethod
energy_total_modified(q, equations::SvaerdKalischEquations1D, cache)

Return the modified total energy of the primitive variables q for the SvaerdKalischEquations1D. It contains an additional term containing a derivative compared to the usual energy_total. The energy_total_modified is a conserved quantity of the Svärd-Kalisch equations.

q is a vector of the primitive variables at ALL nodes, i.e., a matrix of the correct length nvariables(equations) as first dimension and the number of nodes as length of the second dimension. cache needs to hold the first-derivative SBP operator D1.

source
DispersiveShallowWater.entropyFunction
entropy(q, equations)

Return the entropy of the primitive variables q for a given set of equations.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.errorsMethod
errors(analysis_callback)

Return the computed errors for each timestep as a named tuple. The shape of each entry is (nvariables, ntimesteps).

source
DispersiveShallowWater.examples_dirMethod
examples_dir()

Return the directory where the example files provided with DispersiveShallowWater.jl are located. If DispersiveShallowWater is installed as a regular package (with ]add DispersiveShallowWater), these files are read-only and should not be modified. To find out which files are available, use, e.g., readdir.

Copied from Trixi.jl.

Examples

readdir(examples_dir())
source
DispersiveShallowWater.get_nameMethod
get_name(equations::AbstractEquations)

Return the canonical, human-readable name for the given system of equations.

Examples

julia> DispersiveShallowWater.get_name(BBMBBMEquations1D(gravity_constant=1.0))
+"BBMBBMEquations1D"
source
DispersiveShallowWater.initial_condition_dingemansMethod
initial_condition_dingemans(x, t, equations::BBMBBMVariableEquations1D, mesh)

The initial condition that uses the dispersion relation of the Euler equations to approximate waves generated by a wave maker as it is done by experiments of Dingemans. The topography is a trapesoidal.

References:

  • Magnus Svärd, Henrik Kalisch (2023) A novel energy-bounded Boussinesq model and a well-balanced and stable numerical discretization arXiv: 2302.09924
  • Maarten W. Dingemans (1994) Comparison of computations with Boussinesq-like models and laboratory measurements link
source
DispersiveShallowWater.initial_condition_dingemansMethod
initial_condition_dingemans(x, t, equations::SvaerdKalischEquations1D, mesh)

The initial condition that uses the dispersion relation of the Euler equations to approximate waves generated by a wave maker as it is done by experiments of Dingemans. The topography is a trapesoidal. It is assumed that equations.eta0 = 0.8.

References:

  • Magnus Svärd, Henrik Kalisch (2023) A novel energy-bounded Boussinesq model and a well-balanced and stable numerical discretization arXiv: 2302.09924
  • Maarten W. Dingemans (1994) Comparison of computations with Boussinesq-like models and laboratory measurements link
source
DispersiveShallowWater.momentumMethod
momentum(q, equations)

Return the momentum of the primitive variables q for a given set of equations, i.e. the waterheight times the velocity.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.path_create_figuresMethod
path_create_figures()

Return the path to the file that creates all figures used in the master thesis "Structure-preserving Numerical Methods for Dispersive Shallow Water Model" (2023). Executing this julia script may take a while.

Examples

include(DispersiveShallowWater.path_create_figures())
source
DispersiveShallowWater.prim2consFunction
prim2cons(q, equations)

Convert the primitive variables q to the conserved variables for a given set of equations. q is a vector type of the correct length nvariables(equations). Notice the function doesn't include any error checks for the purpose of efficiency, so please make sure your input is correct. The inverse conversion is performed by cons2prim.

source
DispersiveShallowWater.trixi_includeMethod
trixi_include([mod::Module=Main,] example::AbstractString; kwargs...)

include the file example and evaluate its content in the global scope of module mod. You can override specific assignments in example by supplying keyword arguments. It's basic purpose is to make it easier to modify some parameters while running DispersiveShallowWater from the REPL. Additionally, this is used in tests to reduce the computational burden for CI while still providing examples with sensible default values for users.

Before replacing assignments in example, the keyword argument maxiters is inserted into calls to solve and DispersiveShallowWater.solve with it's default value used in the SciML ecosystem for ODEs, see the "Miscellaneous" section of the documentation.

Copied from Trixi.jl.

Examples

julia> redirect_stdout(devnull) do
            trixi_include(@__MODULE__, joinpath(examples_dir(), "bbm_bbm_1d", "bbm_bbm_1d_basic.jl"),
                          tspan=(0.0, 0.1))
            sol.t[end]
        end
-0.1
source
DispersiveShallowWater.varnamesFunction
varnames(conversion_function, equations)

Return the list of variable names when applying conversion_function to the conserved variables associated to equations. Common choices of the conversion_function are prim2prim and prim2cons.

source
DispersiveShallowWater.velocityFunction
velocity(q, equations)

Return the velocity of the primitive variables q for a given set of equations.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.waterheightFunction
waterheight(q, equations)

Return the waterheight of the primitive variables q for a given set of equations, i.e. the waterheight above the bathymetry.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.waterheight_totalFunction
waterheight_total(q, equations)

Return the total waterheight of the primitive variables q for a given set of equations, i.e. the waterheight plus the bathymetry.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.@autoinfiltrateMacro
@autoinfiltrate
-@autoinfiltrate condition::Bool

Invoke the @infiltrate macro of the package Infiltrator.jl to create a breakpoint for ad-hoc interactive debugging in the REPL. If the optional argument condition is given, the breakpoint is only enabled if condition evaluates to true.

As opposed to using Infiltrator.@infiltrate directly, this macro does not require Infiltrator.jl to be added as a dependency to DispersiveShallowWater.jl. As a bonus, the macro will also attempt to load the Infiltrator module if it has not yet been loaded manually.

Note: For this macro to work, the Infiltrator.jl package needs to be installed in your current Julia environment stack.

See also: Infiltrator.jl

Internal use only

Please note that this macro is intended for internal use only. It is not part of the public API of DispersiveShallowWater.jl, and it thus can altered (or be removed) at any time without it being considered a breaking change.

source
+0.1source
DispersiveShallowWater.tstopsMethod
tstops(analysis_callback)

Return the time values that correspond to the saved values of the errors and integrals.

source
DispersiveShallowWater.varnamesFunction
varnames(conversion_function, equations)

Return the list of variable names when applying conversion_function to the conserved variables associated to equations. Common choices of the conversion_function are prim2prim and prim2cons.

source
DispersiveShallowWater.velocityFunction
velocity(q, equations)

Return the velocity of the primitive variables q for a given set of equations.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.waterheightFunction
waterheight(q, equations)

Return the waterheight of the primitive variables q for a given set of equations, i.e. the waterheight above the bathymetry.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
DispersiveShallowWater.waterheight_totalFunction
waterheight_total(q, equations)

Return the total waterheight of the primitive variables q for a given set of equations, i.e. the waterheight plus the bathymetry.

q is a vector of the primitive variables at a single node, i.e., a vector of the correct length nvariables(equations).

source
SummationByPartsOperators.gridMethod
grid(semi)

Get the grid of a semidiscretization.

source
DispersiveShallowWater.@autoinfiltrateMacro
@autoinfiltrate
+@autoinfiltrate condition::Bool

Invoke the @infiltrate macro of the package Infiltrator.jl to create a breakpoint for ad-hoc interactive debugging in the REPL. If the optional argument condition is given, the breakpoint is only enabled if condition evaluates to true.

As opposed to using Infiltrator.@infiltrate directly, this macro does not require Infiltrator.jl to be added as a dependency to DispersiveShallowWater.jl. As a bonus, the macro will also attempt to load the Infiltrator module if it has not yet been loaded manually.

Note: For this macro to work, the Infiltrator.jl package needs to be installed in your current Julia environment stack.

See also: Infiltrator.jl

Internal use only

Please note that this macro is intended for internal use only. It is not part of the public API of DispersiveShallowWater.jl, and it thus can altered (or be removed) at any time without it being considered a breaking change.

source
diff --git a/dev/reproduce/index.html b/dev/reproduce/index.html index b1596e42..3824832f 100644 --- a/dev/reproduce/index.html +++ b/dev/reproduce/index.html @@ -1,4 +1,4 @@ Reproduce figures · DispersiveShallowWater.jl

How to reproduce the figures

In order to reproduce all figures used in the master thesis "Structure-Preserving Numerical Methods for Dispersive Shallow Water Models" (2023) by Joshua Lampert execute the file located at the path DispersiveShallowWater.path_create_figures(). From the Julia REPL, this can be done by:

julia> using DispersiveShallowWater
 julia> include(DispersiveShallowWater.path_create_figures())

Note that for one figure Trixi.jl is needed, so download Trixi.jl first:

julia> using Pkg
-julia> Pkg.add("Trixi")

Executing the script may take a while. It will generate a folder out/ with certain subfolders containing the figures. If you want to modify the plots or only produce a subset of plots, you can download the script create_figures.jl, modify it accordingly and run it by:

julia> include("create_figures.jl")
+julia> Pkg.add("Trixi")

Executing the script may take a while. It will generate a folder out/ with certain subfolders containing the figures. If you want to modify the plots or only produce a subset of plots, you can download the script create_figures.jl, modify it accordingly and run it by:

julia> include("create_figures.jl")