Skip to content

Commit

Permalink
tidy - clean up for release
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylt committed Oct 18, 2022
1 parent 0c28b08 commit e1ca1fa
Show file tree
Hide file tree
Showing 30 changed files with 1,317 additions and 966 deletions.
2 changes: 1 addition & 1 deletion .Style.jl
Expand Up @@ -9,6 +9,6 @@ using JuliaFormatter
# run JuliaFormatter
# ------------------------------------------------------------------------------

format(["src", "test", "examples", "docs"])
format(["src", "test", "examples", "docs"], format_docstrings = true)

# ------------------------------------------------------------------------------
4 changes: 2 additions & 2 deletions CITATION.cff
@@ -1,8 +1,8 @@
cff-version: 1.1.0
title: "LFAToolkit.jl"
message: "Please cite the following works when using this software."
version: 0.5.0
date-released: 2022-01-05
version: 0.6.0
date-released: 2022-10-18
license: BSD-2-Clause
authors:
- family-names: Thompson
Expand Down
10 changes: 8 additions & 2 deletions Project.toml
@@ -1,7 +1,11 @@
name = "LFAToolkit"
uuid = "3f92b583-c0aa-4596-8bdf-f02f6c0a52df"
authors = ["Jeremy L Thompson <thompson.jeremy.luke@gmail.com>"]
version = "0.5.0"
authors = [
"Jed Brown <jed@jedbrown.org>",
"Adeleke Bankoe <AdelekeBankole@colorado.edu>",
"Jeremy L Thompson <thompson.jeremy.luke@gmail.com>",
]
version = "0.6.0"

[deps]
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
Expand All @@ -12,6 +16,8 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
julia = "1.3"
Polynomials = "2.0.25"
FastGaussQuadrature = "0.4.9"

[extras]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Expand Down
7 changes: 4 additions & 3 deletions docs/Project.toml
@@ -1,9 +1,10 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
LFAToolkit = "3f92b583-c0aa-4596-8bdf-f02f6c0a52df"

[compat]
Documenter = "=0.25.2"
DocumenterTools = "=0.1.6"
Documenter = "0.27.23"
DocumenterCitations = "0.2.12"
DocumenterTools = "0.1.16"
12 changes: 7 additions & 5 deletions docs/make.jl
@@ -1,7 +1,7 @@
# ------------------------------------------------------------------------------
# documentation
# ------------------------------------------------------------------------------
using Documenter, DocumenterTools, Markdown, LFAToolkit
using Documenter, DocumenterCitations, DocumenterTools, Markdown, LFAToolkit
DocMeta.setdocmeta!(LFAToolkit, :DocTestSetup, :(using LFAToolkit); recursive = true)

# The DOCSARGS environment variable can be used to pass additional arguments to make.jl.
Expand All @@ -16,8 +16,14 @@ end
# ------------------------------------------------------------------------------
# make
# ------------------------------------------------------------------------------
bib = CitationBibliography(joinpath(@__DIR__, "src/references.bib"))
makedocs(
bib,
modules = [LFAToolkit],
clean = false,
strict = true,
sitename = "LFAToolkit.jl",
authors = "Jed Brown, Adeleke Bankole, and Jeremy L Thompson",
format = Documenter.HTML(
# Use clean URLs, unless built as a "local" build
prettyurls = !("local" in ARGS),
Expand All @@ -33,10 +39,6 @@ makedocs(
"Release Notes" => "release_notes.md",
"References" => "references.md",
],
clean = false,
sitename = "LFAToolkit.jl",
authors = "Jeremy L Thompson",
linkcheck = !("skiplinks" in ARGS),
)

# ------------------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions docs/src/background.md
@@ -1,6 +1,6 @@
# Mathematical Background

Local Fourier Analysis (LFA) was first used by Brandt [1] to analyze the convergence of multi-level adaptive techniques for solving PDEs discretized with finite differences, but the technique has been adapted for multi-level and multi-grid techniques using finite element discretizations.
Local Fourier Analysis (LFA) was first used in [brandt1977](@cite) to analyze the convergence of multi-level adaptive techniques for solving PDEs discretized with finite differences, but the technique has been adapted for multi-level and multi-grid techniques using finite element discretizations.
While this library focuses on the finite element discretizations, finite difference discretizations of PDEs can often be recovered from finite element formulations by using linear finite elements on a structured grid.
This fact makes LFAToolkit.jl an extremely flexible tool for LFA.

Expand Down Expand Up @@ -47,7 +47,7 @@ In this context, low frequencies are given by ``\theta \in T^{low} = \left[ - \p

## High Order Finite Elements

Consider the specific case of a Topeliz operator representing a scalar PDE in 1D with the weak formulation given by Brown in [2],
Consider the specific case of a Topeliz operator representing a scalar PDE in 1D with the weak formulation given by [brown2010](@cite),

```math
\int_{\Omega} v \cdot f_0 \left( u, \nabla u \right) + \nabla v : f_1 \left( u, \nabla u \right) = \int_{\Omega} f v, \forall v \in V
Expand All @@ -63,7 +63,7 @@ Selecting a finite element basis, we can discretize the weak form and produce
A u = b.
```

Using the algebraic representation of PDE operators discussed in [2], the PDE operator ``A`` is of the form
Using the algebraic representation of PDE operators discussed in [brown2010](@cite), the PDE operator ``A`` is of the form

```math
A = P^T A_e P
Expand Down Expand Up @@ -205,7 +205,7 @@ If multiple pre or post-smoothing passes are used, we have
where ``\nu`` is the number of smoothing passes.

More sophisticated smoothers can be used, such as the Chebyshev semi-iterative method.
For discussion of the error propegation of the Chebyshev semi-iteative method, see Gutknecht and Röllin [3].
For discussion of the error propegation of the Chebyshev semi-iteative method, see [gutknecht2002](@cite).
User defined smoothers are supported, where the user provides ``M^{-1}`` or a function computing ``M^{-1}`` based upon ``A``, and ``\tilde{M}^{-1}_h`` and ``\tilde{S}_h`` are automatically generated and used inside the multigrid symbol matrix.

### Grid Transfer Operators
Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples.md
Expand Up @@ -6,9 +6,9 @@ This section documents the LFAToolkit examples.

```@contents
Pages = [
"examples/diffusion.md",
"examples/advection.md",
"examples/advection_supg.md",
"examples/diffusion.md",
"examples/linear_elasticity.md",
"examples/hyperelasticity.md",
]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/examples/advection.md
Expand Up @@ -25,7 +25,7 @@ In this weak formulation, boundary terms have been omitted, as they are not pres
The advection operator is a classical test case to see dispersion spectrum inside LFAToolkit.
Here we show the advection operator on a non-polynomial basis derived from the Hale-Trefethen strip transformation applied to a H1 Lagrange basis.

For understanding about nonpolynomial bases, see paper Hale and Trefethen (2008) New quadrature formulas from conformal maps. https://doi.org/10.1137/07068607X
For further discussion on non-polynomial bases, see [hale2008](@cite).

````@eval
using Markdown
Expand Down
7 changes: 2 additions & 5 deletions docs/src/examples/advection_supg.md
Expand Up @@ -20,6 +20,8 @@ for an appropriate test space ``V \subseteq H^1 \left( \Omega \right)`` on the d
In this weak formulation, boundary terms have been omitted, as they are not present on the infinite grid for Local Fourier Analysis.
The SUPG stabilization is controlled by the parameter ``τ``, where ``τ = 0`` gives the classical Galerkin formulation and ``τ = \dfrac{h}{2}`` gives a nodally exact solution to the steady advection equation with source when using linear elements (this can be extended to advection-diffusion with a further scaling that depends on the cell Péclet number).

For discussion on SUPG, see [hughes1979](@cite), [brooks1982](@cite), and [whiting2003](@cite).

### LFAToolkit code

The symbol of the continuous advection operator ``u_t + c u_x = 0`` applied to the Fourier mode ``e^{i\theta x}`` is ``i\theta``.
Expand All @@ -28,11 +30,6 @@ One may compare the continuous spectrum with the discrete symbol, which is neces
To understand dispersion within the resolved frequencies, we instead plot the phase speed ``\lambda/\theta``, which should be very close to ``c`` through the resolved frequencies.
Here we show the SUPG advection operator on ``H^1`` Lagrange basis.

For understanding about SUPG in this work, see papers by Hughes TJR, Brooks AN (1979, 1982) and C.H. Whiting
A multi-dimensional upwind scheme with no crosswind diffusion. In: Hughes TJR, editor. Finite element methods for convection dominated flows, AMD-vol. 34. New York: ASME, (1979), pp. 19-35.
Streamline upwind/Petrov–Galerkin formulations for convection dominated flows with particular emphasis on the incompressible Navier–Stokes equations. Comput Meth Appl Mech Eng, 32 (1982), pp. 199-259.
Hierarchical basis for stabilized finite element methods for compressible flows. Comput. Methods Appl. Mech. Engrg. 192, (2003), pp. 5167-5185.

````@eval
using Markdown
Markdown.parse("""
Expand Down
3 changes: 1 addition & 2 deletions docs/src/index.md
Expand Up @@ -23,8 +23,7 @@ Pages = [
"examples.md",
"public.md",
"private.md",
"release_notes.md",
"references.md"
"release_notes.md"
]
Depth = 1
```
101 changes: 101 additions & 0 deletions docs/src/references.bib
@@ -0,0 +1,101 @@
@article{brandt1977,
title = {Multi-level adaptive solutions to boundary-value problems},
author = {Brandt, Achi},
journal = {Mathematics of computation},
volume = {31},
number = {138},
pages = {333--390},
year = {1977}
}

@article{brooks1982,
title = {Streamline upwind/Petrov-Galerkin formulations for convection dominated flows with particular emphasis on the incompressible Navier-Stokes equations},
author = {
Brooks, Alexander N and
Hughes, Thomas JR
},
journal = {Computer methods in applied mechanics and engineering},
volume = {32},
number = {1-3},
pages = {199--259},
year = {1982},
publisher = {Elsevier}
}

@article{brown2010,
title = {Efficient nonlinear solvers for nodal high-order finite elements in 3D},
author = {Brown, Jed},
journal = {Journal of Scientific Computing},
volume = {45},
number = {1},
pages = {48--63},
year = {2010},
publisher = {Springer}
}

@article{gutknecht2002,
title = {The Chebyshev iteration revisited},
author = {
Gutknecht, Martin H and
Röllin, Stefan
},
journal = {Parallel Computing},
volume = {28},
number = {2},
pages = {263--283},
year = {2002},
publisher = {Elsevier}
}

@article{hale2008,
title = {New quadrature formulas from conformal maps},
author = {
Hale, Nicholas and
Trefethen, Lloyd N
},
journal = {SIAM Journal on Numerical Analysis},
volume = {46},
number = {2},
pages = {930--948},
year = {2008},
publisher = {SIAM}
}

@article{hughes1979,
title = {A multidimentional upwind scheme with no crosswind diffusion},
author = {Hughes, Thomas JR},
journal = {Finite element methods for convection dominated flows},
volume = {AMD 34},
pages = {19--35},
year = {1979},
publisher = {ASME.}
}

@article{melvin2012,
title = {Dispersion analysis of the spectral element method},
author = {
Melvin, Thomas and
Staniforth, Andrew and
Thuburn, John
},
journal = {Quarterly Journal of the Royal Meteorological Society},
volume = {138},
number = {668},
pages = {1934--1947},
year = {2012},
}

@article{whiting2003,
title = {Hierarchical basis for stabilized finite element methods for compressible flows},
author = {
Whiting, Christian H and
Jansen, Kenneth E and
Dey, Saikat
},
journal = {Computer methods in applied mechanics and engineering},
volume = {192},
number = {47-48},
pages = {5167--5185},
year = {2003},
publisher = {Elsevier}
}
17 changes: 2 additions & 15 deletions docs/src/references.md
@@ -1,17 +1,4 @@
# References

A. Brandt, *Multi-level adaptive solutions to boundary-value problems*, Math. Comp., 31(138) (1977), pp. 33-390.

A. N. Brooks and T. J. R. Hughes *Streamline upwind/Petrov–Galerkin formulations for convection dominated flows with particular emphasis on the incompressible Navier–Stokes equations*, Comput Meth Appl Mech Eng, 32 (1982), pp. 199-259.

J. Brown, *Efficient nonlinear solvers for nodal high-order finite elements in 3D*, Journal of Scientific Computing, 45 (2010), pp. 48-63.

M. Gutknecht and S. Röllin, *The Chebyshev iteration revisited*, Parallel Computing, 28 (2002), pp. 263-283.

N. Hale and L. N. Trefethen, [New quadrature formulas from conformal maps](https://doi.org/10.1137/07068607X), SIAM Journal on Numerical Analysis. Vol. 46, No. 2, (2008), pp. 930-948.

T. J. R. Hughes and A. N. Brooks *A multi-dimensional upwind scheme with no crosswind diffusion*, In: Hughes TJR, editor. Finite element methods for convection dominated flows, AMD-vol. 34. New York: ASME, (1979), pp. 19-35.

T. Melvin, A. Staniforth and J. Thuburn, *Dispersion analysis of the spectral element method*, Q.J.R. Meteorol. Soc. 138, (2012), pp. 1934-1947.

C. H. Whiting, K. E. Jansen and S. Dey, *Hierarchical basis for stabilized finite element methods for compressible flows*, Comput. Methods Appl. Mech. Engrg. 192, (2003), pp. 5167-5185.
```@bibliography
```
7 changes: 6 additions & 1 deletion docs/src/release_notes.md
Expand Up @@ -4,10 +4,15 @@

Current development includes:

## v0.6.0

This release includes conformal maps for bases, new operator convenience constructors, and small internal improvements.

Enhancements:

* Added conformal maps `sausage_transformation`, `kosloff_talezer_transformation`, and `hale_trefethen_strip_transformation` for basis quadrature spaces.
* Add advection operator convenience constructor and examples.
* Add advection and SUPG advection operator convenience constructor and examples.
* Switch to `FastGaussQuadrature` package for computing nodes, quadrature points, and quadrature weights.

Bugfixes:

Expand Down
2 changes: 1 addition & 1 deletion examples/ex011_advection_supg.jl
Expand Up @@ -63,7 +63,7 @@ supgmass = Operator(
supgmassweakform,
mesh,
[
OperatorField(basis, [EvaluationMode.interpolation], "u_t"),
OperatorField(basis, [EvaluationMode.interpolation], "uₜ"),
OperatorField(basis, [EvaluationMode.quadratureweights], "quadrature weights"),
],
[OperatorField(basis, [EvaluationMode.interpolation, EvaluationMode.gradient])],
Expand Down

0 comments on commit e1ca1fa

Please sign in to comment.