Skip to content

Commit 64cafac

Browse files
committed
update docs for new package structure
1 parent 0814b9f commit 64cafac

11 files changed

Lines changed: 67 additions & 109 deletions

File tree

docs/make.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ makedocs(;
1515
),
1616
pages=[
1717
"WavePropBase" => "index.md",
18-
"Utils module" => "utils.md",
19-
"Geometry module" => "geometry.md",
20-
"Interpolation module" => "interpolation.md",
21-
"Integration module" => "integration.md",
22-
"Mesh module" => "mesh.md",
23-
"Trees module" => "trees.md",
24-
"IO module" => "io.md",
18+
"Utils" => "utils.md",
19+
"Geometry" => "geometry.md",
20+
"Interpolation" => "interpolation.md",
21+
"Integration" => "integration.md",
22+
"Meshes" => "mesh.md",
23+
"Trees" => "trees.md",
24+
"IO" => "io.md",
2525
"References" => "references.md"
2626
],
2727
)

docs/src/geometry.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# [Geometry module](@id geometry-section)
1+
# [Geometry](@id geometry-section)
22

33
```@meta
4-
CurrentModule = WavePropBase.Geometry
4+
CurrentModule = WavePropBase
55
```
6-
76
## Overview
87

98
The `Geometry` module is of fundamental importance as it defines the interface
@@ -86,15 +85,9 @@ Furthremore, domains can be used to index parts of a mesh, as described in the
8685
The `AbstractReferenceShape{N}` type describes singleton types representing
8786
(fixed) geometrical shapes in `N` dimensions. Concrete subtypes include
8887
[`ReferenceLine`](@ref), [`ReferenceTriangle`](@ref), [`ReferenceSquare`](@ref),
89-
and the [`ReferenceTetrahedron`](@ref).
88+
and the [`ReferenceTetrahedron`](@ref).
9089

9190
Various interpolation and integration routines can then be efficiently defined
9291
on these singleton types, and more complex interpolation/integration over more
9392
complex elements can be carried out by combining the routines on the reference
9493
element with a parametrization of the complex element.
95-
96-
## Index
97-
98-
```@index
99-
Modules = [Geometry]
100-
```

docs/src/index.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,10 @@ quadratures, etc. It is essentially a factorization of code that was being
1414
duplicated across different packages. *Unless you are developing a package, there
1515
is little reason for you to depend directly on `WavePropBase`.*
1616

17-
## Interface
17+
## Package structure
1818

19-
The methods which are to be extended by other packages are defined at
20-
the top-level module (`WavePropBase`), and are grouped for convenience in the
21-
global variable [`INTERFACE`](@ref). You can automatically import/export all
22-
the interface methods using [`@import_interface`](@ref) and
23-
[`@export_interface`](@ref).
24-
25-
## Submodules
26-
27-
Most of the functionality has been organized inside the following sub-modules:
19+
The package consists of a single module, and has no exported structures. The
20+
code has been physically organized into the following subfolders:
2821

2922
- [Utils](@ref utils-section)
3023
- [Geometry](@ref geometry-section)
@@ -34,9 +27,6 @@ Most of the functionality has been organized inside the following sub-modules:
3427
- [Mesh](@ref mesh-section)
3528
- [IO](@ref io-section)
3629

37-
Refer to each module's documentation for further information on how to use them,
38-
as well as to an index of their methods/structures.
39-
4030
## Index
4131

4232
```@index

docs/src/integration.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
# [Integration module](@id integration-section)
22

3+
4+
```@meta
5+
CurrentModule = WavePropBase
6+
```
7+
38
## Overview
49

510
The `Integration` module provides various quadrature rules and routines for
6-
integrating functions defined over [`AbstractReferenceShape`](@ref
7-
Geometry.AbstractReferenceShape)s. Quadrature rules are expected to inherit from
11+
integrating functions defined over [`AbstractReferenceShape`](@ref AbstractReferenceShape)s. Quadrature rules are expected to inherit from
812
the `AbstractQuadratureRule{D}`, which describes a set of nodes and weights used
913
to integrate a function over a reference domain `D<:AbstractReferenceShape`.
1014
Subtypes of `AbstractQuadratureRule` should implement at least
1115
`(::AbstractQuadratureRule)()` returning the nodes and weights.
1216

13-
The
14-
`Integration` module defines various quadrature rules such as
15-
16-
```@index
17-
Modules = [WavePropBase.Integration]
18-
```
17+
The `Integration` module defines various quadrature rules such as ...
1918

2019
## Regular integration rules
2120

docs/src/interpolation.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [Interpolation module](@id interpolation-section)
1+
# [Interpolation](@id interpolation-section)
22

33
```@meta
44
CurrentModule = WavePropBase
@@ -8,15 +8,14 @@ CurrentModule = WavePropBase
88

99
The `Interpolation` module defines an interface for talking about polynomial
1010
spaces and interpolation. The central concept of this module is that of an
11-
[`AbstractElement{D,T}`](@ref Interpolation.AbstractElement), which maps points
12-
on a reference domain (of type [`<:AbstractReferenceShape`](@ref
13-
Geometry.AbstractReferenceShape)) to values of type `T`. The `AbstractElement`
11+
[`AbstractElement{D,T}`](@ref AbstractElement), which maps points
12+
on a reference domain (of type [`<:AbstractReferenceShape`](@ref AbstractReferenceShape)) to values of type `T`. The `AbstractElement`
1413
interface expects the methods `(el::AbstractElement)(u)`, which evaluates the
1514
underlying interpolant at the (reference) coordinate `u`, and `jacobian(el,u)`,
1615
which computes the jacobian at the (reference) coordinate `u`.
1716

1817
`AbstractElement`s are commonly used to describe functions over
19-
[`AbstractReferenceShape`](@ref Geometry.AbstractReferenceShape)s, and such
18+
[`AbstractReferenceShape`](@ref AbstractReferenceShape)s, and such
2019
functions can in turn be used to describe more complex geometrical shapes used
2120
e.g. in a mesh. By composing a function representation on a reference element
2221
with the representation of the element itself as a map from the reference
@@ -34,7 +33,7 @@ package).
3433

3534
One of the simplest `AbstractElement`s is the `LagrangeElement{D,T,Np}`, which
3635
defines a polynomial mapping the `Np` reference nodes on `D` to `Np` values of
37-
type `T`. The [`reference_nodes`](@ref Interpolation.reference_nodes) depend
36+
type `T`. The [`reference_nodes`](@ref reference_nodes) depend
3837
only on `D` and `Np` (and therefore on the type of the element). We use the same
3938
convention as *Gmsh* to define the order of the reference nodes on the various
4039
reference shapes; see [node
@@ -49,7 +48,7 @@ be created using:
4948
using WavePropBase, Plots
5049
plotlyjs() # hide
5150
pts = (1,1),(2,2),(1.5,3)
52-
el = Interpolation.LagrangeTriangle(pts)
51+
el = WavePropBase.LagrangeTriangle(pts)
5352
plot(el)
5453
savefig("el1.png")
5554
```
@@ -61,27 +60,22 @@ parametrization and the jacobian at any point on the reference element (not just
6160
the reference nodes):
6261

6362
```@example triangle-element
64-
u = Geometry.Point2D(0.25,0.25)
65-
@show el(u), jacobian(el,u)
63+
u = WavePropBase.Point2D(0.25,0.25)
64+
@show el(u), WavePropBase.jacobian(el,u)
6665
```
6766

6867
If the triangle is instead in three dimensions, it suffices to pass
6968
three-dimensional points:
7069

7170
```@example triangle-element
7271
pts = (1,1,0),(2,2,1),(1.5,3,1)
73-
el = Interpolation.LagrangeTriangle(pts)
72+
el = WavePropBase.LagrangeTriangle(pts)
7473
plot(el)
7574
savefig("el2.png")
7675
```
7776

7877
![triangular element](el2.png)
7978

8079
Very similar constructs can be used to work higher order (curved) triangles, or
81-
with other `LagrangeElements` such as [`LagrangeSquare`](@ref
82-
Interpolation.LagrangeSquare) or [`LagrangeTetrahedron`](@ref
83-
Interpolation.LagrangeTetrahedron); see their docstrings for more details.
84-
85-
```@index
86-
Modules = [WavePropBase.Interpolation]
87-
```
80+
with other `LagrangeElements` such as [`LagrangeSquare`](@ref LagrangeSquare) or
81+
[`LagrangeTetrahedron`](@ref); see their docstrings for more details.

docs/src/io.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# [IO module](@id io-section)
22

3+
```@meta
4+
CurrentModule = WavePropBase
5+
```
6+
37
## Overview
48

59
The `IO` module provides various *recipes* for `Plots.jl`, as well functionality
610
to export meshes and solutions to `.vtk` format using `WriteVTK`. Note that the
711
`vtkIO.jl` file is only loaded if `WriteVTK` is available (i.e. you must type
812
`using WriteVTK` for the file to be loaded).
9-
10-
## Index
11-
12-
```@index
13-
Modules = [WavePropBase.IO]
14-
```

docs/src/mesh.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# [Mesh module](@id mesh-section)
1+
# [Mesh](@id mesh-section)
22

3-
## Overview
3+
```@meta
4+
CurrentModule = WavePropBase
5+
```
6+
7+
## Overview
48

59
## Mesh structures
610

@@ -20,7 +24,3 @@ using GmshSDK
2024
#msh = GmshSDK.meshgen(Ω)
2125
end
2226
```
23-
24-
```@index
25-
Modules = [WavePropBase.Mesh]
26-
```

docs/src/references.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# References
22

33
```@autodocs
4-
Modules = [ WavePropBase,
5-
WavePropBase.Utils,
6-
WavePropBase.Geometry,
7-
WavePropBase.Trees,
8-
WavePropBase.Interpolation,
9-
WavePropBase.Integration,
10-
WavePropBase.Mesh,
11-
WavePropBase.IO
12-
]
4+
Modules = [ WavePropBase ]
135
```

docs/src/trees.md

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,34 @@ tree-like data structures. It relies on
1111
[AbstractTrees.jl](https://github.com/JuliaCollections/AbstractTrees.jl) for
1212
various utilities related to traversing trees and tree iterators.
1313

14-
The module defines the concrete type [`ClusterTree`](@ref Trees.ClusterTree)
14+
The module defines the concrete type [`ClusterTree`](@ref ClusterTree)
1515
which can be used to partition elements of geometrical nature into a
1616
hierarchical structure according to an [`AbstractSplitter`](@ref
17-
Trees.AbstractSplitter). This structure is currently used by the
17+
AbstractSplitter). This structure is currently used by the
1818
[HMatrices.jl](https://github.com/WaveProp/HMatrices) and
1919
[IFGF.jl](https://github.com/WaveProp/IFGF).
2020

2121
Tree-like data structures should inherit from [`AbstractTree`](@ref
22-
Trees.AbstractTree), and are expected to implement the `children` and `parent`
22+
AbstractTree), and are expected to implement the `children` and `parent`
2323
methods. Currently, one concrete implementation of [`AbstracTree`](@ref
24-
Trees.AbstractTree) is provided by `WavePropBase`: the [`ClusterTree`](@ref
25-
Trees.ClusterTree).
24+
AbstractTree) is provided by `WavePropBase`: the [`ClusterTree`](@ref
25+
ClusterTree).
2626

2727
## `ClusterTree`
2828

29-
A [`ClusterTree{T,S,D}`](@ref Trees.ClusterTree) is a parametric type used to
29+
A [`ClusterTree{T,S,D}`](@ref ClusterTree) is a parametric type used to
3030
hierarchically cluster elements of type `T` into container of type `S`.
3131
Additionally, each node of the tree has a data field of type `D` (defaults to
32-
`Nothing`) that can be used to store additional node-specific information. The
32+
`Nothing`) that can be used to store additional node-specific information. The
3333
elements contained in a given node can be retrieved using `elements(node)`,
3434
which returns an iterable collection of elements of type `T`.
3535

3636
To construct a `ClusterTree`, you must pass the elements and an
37-
[`AbstractSplitter`](@ref Trees.AbstractSplitter) implementing the desired
37+
[`AbstractSplitter`](@ref AbstractSplitter) implementing the desired
3838
splitting strategy and stopping criterion: concrete subtypes of
3939
`AbstractSplitter` should implement the
40-
[`should_split(clt,spl::AbstractSplitter)`](@ref Trees.should_split) and
41-
[`split!(clt,splt::AbstractSplitter)`](@ref Trees.split!) methods. Refer to the documentation
40+
[`should_split(clt,spl::AbstractSplitter)`](@ref should_split) and
41+
[`split!(clt,splt::AbstractSplitter)`](@ref split!) methods. Refer to the documentation
4242
of each concrete subtype of `AbstractSplitter` (you can type
4343
`subtypes(AbstractSplitter)` to see what they are) for more information about
4444
the available splitting strategies and parameters.
@@ -47,9 +47,9 @@ An example of how to construct a `ClusterTree` is shown below:
4747

4848
```@example cluster-tree
4949
using WavePropBase
50-
pts = rand(Geometry.Point2D,100)
51-
splitter = Trees.GeometricMinimalSplitter(nmax=5)
52-
clt = Trees.ClusterTree(pts,splitter)
50+
pts = rand(WavePropBase.Point2D,100)
51+
splitter = WavePropBase.CardinalitySplitter(nmax=5)
52+
clt = WavePropBase.ClusterTree(pts,splitter)
5353
```
5454

5555
`clt` now represents the root of the tree. To visualize `clt` as a node, you can
@@ -59,7 +59,7 @@ of `clt`, you can do:
5959
```@example cluster-tree
6060
using Plots
6161
plotlyjs() # hide
62-
plot(WavePropBase.IO.PlotTree(),clt;predicate=Trees.isleaf)
62+
plot(WavePropBase.PlotTree(),clt;predicate=WavePropBase.isleaf)
6363
savefig("clt1.png")
6464
```
6565

@@ -68,16 +68,16 @@ savefig("clt1.png")
6868
Changing the clustering strategy is as simple as:
6969

7070
```@example cluster-tree
71-
splitter = Trees.DyadicSplitter(nmax=5)
72-
clt = Trees.ClusterTree(pts,splitter)
73-
plot(WavePropBase.IO.PlotTree(),clt)
71+
splitter = WavePropBase.DyadicSplitter(nmax=5)
72+
clt = WavePropBase.ClusterTree(pts,splitter)
73+
plot(WavePropBase.PlotTree(),clt)
7474
savefig("clt2.png")
7575
```
7676

7777
![cluster tree](clt2.png)
7878

7979
In the example above the elements were simply points, which were sorted into
80-
container of [`HyperRectangle`](@ref Interpolation.HyperRectangle) type according to
80+
container of [`HyperRectangle`](@ref HyperRectangle) type according to
8181
their coordinates. You can sort elements of other types as long as they
8282
implement the `center` method; for instance, you may build a `ClusterTree` of
8383
triangle elements as long as you extend the method `center` from `WavePropBase`
@@ -89,10 +89,5 @@ permuted internally so each node of the tree stores a contiguous subset of
8989
`ClusterTree` object. Passing the keyword argument `copy_elements=false` will
9090
skip the `deepcopy`, and mutate instead the `els` argument passed. The
9191
permutation of `els` performed during the tree construction can be recovered
92-
using [`loc2glob`](@ref Trees.loc2glob).
92+
using [`loc2glob`](@ref loc2glob).
9393

94-
## Index
95-
96-
```@index
97-
Modules = [WavePropBase.Trees]
98-
```

docs/src/utils.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
# [Utils module](@id utils-section)
22

3-
The `Utils` module provides a place to define auxiliary/convenience
4-
functions and structures that do not naturally fit into the other modules. These
5-
functions/structures are indexed below:
6-
7-
## Index
3+
```@meta
4+
CurrentModule = WavePropBase
5+
```
86

9-
```@index
10-
Modules = [WavePropBase.Utils]
11-
```
7+
The `Utils` module provides a place to define auxiliary/convenience
8+
functions and structures that do not naturally fit into the other modules.

0 commit comments

Comments
 (0)