Skip to content

Commit

Permalink
More doctweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
tanderson92 committed Jun 24, 2024
1 parent c0f6a50 commit 375bea9
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 49 deletions.
16 changes: 8 additions & 8 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ efficiency, the package currently supports the following features:

## Installing Julia

Download of Julia from [julialang.org](https://julialang.org/downloads/), or use
Download Julia from [julialang.org](https://julialang.org/downloads/), or use
[juliaup](https://github.com/JuliaLang/juliaup) installer. We recommend using
the latest stable version of Julia, although `Inti.jl` should work with
`>=v1.9`.
Expand All @@ -44,13 +44,13 @@ launching a Julia REPL and typing the following command:
]add Inti
```

Alternatively, you can install the latest version of Inti.jl from the `main` branch using:
Alternatively, one can install the latest version of Inti.jl from the `main` branch using:

```julia
using Pkg; Pkg.add(;url = "https://github.com/IntegralEquations/Inti.jl", rev = "main")
```

Change `rev` if you need a different branch or a specific commit hash.
Change `rev` if a different branch or a specific commit hash is desired.

## Installing weak dependencies

Expand All @@ -66,8 +66,8 @@ Inti.stack_weakdeps_env!(; verbose = false, update = true)
```

Note that the first time you run this command, it may take a while to download
and compile the dependencies. Subsequent runs will be faster. If you prefer, you
can manually control which extensions to install by `Pkg.add`ing the desired
and compile the dependencies. Subsequent runs will be faster. If preferred,
extensions can be manually controlled by `Pkg.add`ing the desired
packages from the list above.

## Basic usage
Expand All @@ -86,8 +86,8 @@ problem consists of the following steps:
define a quadrature and discretize the boundary integral equation.
- **Solver**: With a mesh and an accompanying quadrature, Inti.jl's routines
provide ways to assemble and solve the system of equations arising from the
discretization of the integral operators. The core of the library lies in this
step.
discretization of the integral operators. The core of the library lies in
service of this step.
- **Visualization**: Visualize the solution using a plotting library such as
Makie.jl, or export it to a file for further analysis.

Expand Down Expand Up @@ -191,7 +191,7 @@ While the example above is a simple one, Inti.jl can handle significantly more
complex problems involving multiple domains, heterogeneous coefficients,
vector-valued PDEs, and three-dimensional geometries. The best way to dive
deeper into Inti.jl's capabilities is the [tutorials](@ref "Getting started")
section. You can also find more advanced usage in the [examples](@ref "Toy
section. More advanced usage can be found in the [examples](@ref "Toy
example") section.

## Contributing
Expand Down
10 changes: 5 additions & 5 deletions docs/src/tutorials/compression_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ the available hardware. Here is a rough guide on how to choose a compression:
matrix representation. It is the simplest and most straightforward method,
and does not require any additional packages. It is also the most accurate
since it does not introduce any approximation errors.
2. If the integral operator is supported by the `assemble_fmm`, and if you can
afford an iterative solver, use it. The FMM is a very efficient method for
certain types of kernels, and can handle problems with up to a few million
degrees of freedom on a laptop.
2. If the integral operator is supported by the `assemble_fmm`, and if an
iterative solver is acceptable, use it. The FMM is a very efficient method
for certain types of kernels, and can handle problems with up to a few
million degrees of freedom on a laptop.
3. If the kernel is not supported by `assemble_fmm`, if iterative solvers are
not an option, or if you need to solve your system for many right-hand sides,
not an option, or if the system needs solution for many right-hand sides,
use the `assemble_hmatrix` method. It is a very general method that can
handle a wide range of kernels, and although assembling the `HMatrix` can be
time and memory consuming (the complexity is still log-linear in the DOFs for
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/correction_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ following sections.
Note that the [`single_double_layer`](@ref),
[`adj_double_layer_hypersingular`](@ref), and [`volume_potential`](@ref)
functions have high-level API with a `correction` keyword argument that
allows you to specify the correction method to use when constructing the
allows one to specify the correction method to use when constructing the
integral operators; see the documentation of these functions for more
details.

Expand Down
19 changes: 10 additions & 9 deletions docs/src/tutorials/geo_and_meshes.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ Inti.element_types(msh)
```

Note that the `msh` object contains all entities used to construct the mesh,
usually defined in a `.geo` file, and you can extract them using the `entities`:
usually defined in a `.geo` file, which can be extracted using the `entities`:

```@example geo-and-meshes
ents = Inti.entities(msh)
nothing # hide
```

You can filter entities satisfying a certain condition, e.g., entities of a
given dimension or containing a certain label, in order to construct a domain:
Filtering of entities satisfying a certain condition, e.g., entities of a given
dimension or containing a certain label, can also be performed in order to
construct a domain:

```@example geo-and-meshes
filter = e -> Inti.geometric_dimension(e) == 3
Expand All @@ -75,7 +76,7 @@ or a [`SubMesh`](@ref) containing a view of the mesh:
Γ_msh = view(msh, Γ)
```

Finally, you can visualize the mesh using:
Finally, we can visualize the mesh using:

```@example geo-and-meshes
using Meshes, GLMakie
Expand Down Expand Up @@ -184,7 +185,7 @@ See [`GeometricEntity(shape::String)`](@ref) for a list of predefined geometries
!!! warning "Mesh quality"
The quality of the generated mesh created through `meshgen` depends
heavily on the quality of the underlying parametrization. For surfaces
containing a degenerate parametrization, or for complex shapes, you are
containing a degenerate parametrization, or for complex shapes, one is
better off using a suitable CAD (Computer-Aided Design) software in
conjunction with a mesh generator.

Expand Down Expand Up @@ -213,7 +214,7 @@ including the boundary segments:
Inti.entities(msh)
```

This allows you to probe the `msh` object to extract e.g. the boundary mesh:
This allows us to probe the `msh` object to extract e.g. the boundary mesh:

```@example geo-and-meshes
viz(msh[Inti.boundary(Ω)]; color = :red)
Expand Down Expand Up @@ -243,12 +244,12 @@ fig # hide
```

This example shows how to extract the centers of the tetrahedral elements in the
mesh; and of course you can perform any computation you like on the elements.
mesh; and of course we can perform any desired computation on the elements.

!!! tip "Type-stable iteration over elements"
Since a mesh in Inti.jl can contain elements of various types, the
`elements` function above is not type-stable. For a type-stable iterator
approach, you should first iterate over the element types using
approach, one should first iterate over the element types using
[`element_types`](@ref), and then use `elements(msh, E)` to iterate over a
specific element type `E`.

Expand All @@ -261,5 +262,5 @@ x̂ = SVector(1/3,1/3, 1/3)
el(x̂)
```

Likewise, you can compute the [`jacobian`](@ref) of the element, or its
Likewise, we can compute the [`jacobian`](@ref) of the element, or its
[`normal`](@ref) at a given parametric coordinate.
15 changes: 7 additions & 8 deletions docs/src/tutorials/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CurrentModule = Inti
- Solve a basic boundary integral equation
- Visualize the solution

This first tutorial will guide you through the basic steps of setting up a
This first tutorial will be a guided tour through the basic steps of setting up a
boundary integral equation and solving it using Inti.jl.

## Mathematical formulation
Expand Down Expand Up @@ -101,7 +101,7 @@ Q[1]

In the constructor above we specified a quadrature order of 5, and Inti.jl
internally picked a [`ReferenceQuadrature`](@ref) suitable for the specified
order; for finer control, you can also specify a quadrature rule directly.
order; for finer control, a quadrature rule can be specified directly.

## Integral operators

Expand Down Expand Up @@ -150,7 +150,7 @@ nothing # hide
Much of the complexity involved in the numerical computation is hidden in the
function above; later in the tutorials we will discuss in more details the
options available for the *compression* and *correction* methods, as well as how
to define your own kernels and operators. For now, it suffices to know that `S`
to define custom kernels and operators. For now, it suffices to know that `S`
and `D` are matrix-like objects that can be used to solve the boundary integral
equation. For that, we need to provide the boundary data ``g``.

Expand All @@ -167,10 +167,9 @@ equation. For that, we need to provide the boundary data ``g``.
We are interested in the scattered field ``u`` produced by an incident plane
wave ``u_i = e^{i k \boldsymbol{d} \cdot \boldsymbol{x}}``, where
``\boldsymbol{d}`` is a unit vector denoting the direction of the plane wave.
Assuming that the total field ``u_t = u_i + u``, unique up to a constant,
satisfies a homogenous Neumann condition on ``\Gamma``, and that the scattered
field ``u`` satisfies the Sommerfeld radiation condition, we can write the
boundary condition as:
Assuming that the total field ``u_t = u_i + u`` satisfies a homogenous Neumann
condition on ``\Gamma``, and that the scattered field ``u`` satisfies the
Sommerfeld radiation condition, we can write the boundary condition as:

```math
\partial_\nu u = -\partial_\nu u_i, \quad \boldsymbol{x} \in \Gamma.
Expand All @@ -196,7 +195,7 @@ nothing # hide
In computing `g` above, we used `map` to evaluate the incident field at
all quadrature nodes. When iterating over `Q`, the iterator returns a
[`QuadratureNode`](@ref QuadratureNode), and not simply the *coordinate*
of the quadrature node. This is so that you can access additional
of the quadrature node. This is so that we can access additional
information, such as the `normal` vector, at the quadrature node.

## Integral representation and visualization
Expand Down
18 changes: 9 additions & 9 deletions docs/src/tutorials/integral_operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ formulation with an operator preconditioner.
So far we have focused on problems for which Inti.jl provides predefined
kernels, and used the high-level syntax of e.g. `single_double_layer` to
construct the integral operators. We will now dig into the details of how to set
up your own kernel function, and how to build an integral operator from it.
up a custom kernel function, and how to build an integral operator from it.

!!! note "Integral operators coming from PDEs"
If your integral operator arises from a PDE, it is recommended to define a
new [`AbstractPDE`](@ref) type, and implement the required methods for
[`SingleLayerKernel`](@ref), [`DoubleLayerKernel`](@ref),
If the integral operator of interest arises from a PDE, it is recommended
to define a new [`AbstractPDE`](@ref) type, and implement the required
methods for [`SingleLayerKernel`](@ref), [`DoubleLayerKernel`](@ref),
[`AdjointDoubleLayerKernel`](@ref), and [`HyperSingularKernel`](@ref). This
will enable the use of the high-level syntax for constructing boundary
integral operators, as well as the use of the compression and correction
Expand Down Expand Up @@ -250,28 +250,28 @@ The correction matrix `δS` will be constructed using [`adaptive_correction`](@r
δS = Inti.adaptive_correction(Sop; tol = 1e-4, maxdist = 5*meshsize)
```

How exactly you add `S₀` and `δS` to get the final operator depends on the usage
that you have in mind. For instance, you can use the `LinearMap` type to simply
How exactly one adds `S₀` and `δS` to get the final operator depends on the intended
usage. For instance, one can use the `LinearMap` type to simply
add them lazily:

```@example integral_operators
using LinearMaps
S = LinearMap(S₀) + LinearMap(δS)
```

You can add `δS` to `S₀` to create a new object:
Or, one can add `δS` to `S₀` to create a new object:

```@example integral_operators
S = S₀ + δS
```

or if performance/memory is a concern, you may want to directly add `δS` to `S₀` in-place:
or if performance/memory is a concern, one may want to directly add `δS` to `S₀` in-place:

```@example integral_operators
axpy!(1.0, δS, S₀)
```

All of these should give an identical matrix-vector product, but the later two
All of these should give an identical matrix-vector product, but the latter two
allow e.g. for the use of direct solvers though an LU factorization.

!!! warning "Limitations"
Expand Down
18 changes: 9 additions & 9 deletions docs/src/tutorials/layer_potentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CurrentModule = Inti
In this tutorial we focus on **evaluating** the layer potentials given a source
density. This is a common post-processing task in boundary integral equation
methods, and while most of it is straightforward, some subtleties arise when the
target points are close to the boundary (nearly-singular integrals).
target points are close to the boundary (nearly-singular integrals).

## Integral potentials

Expand Down Expand Up @@ -89,7 +89,7 @@ kite using splines:

```@example layer_potentials
gmsh.initialize()
meshsize = 2π / k / 4
meshsize = 2π / k / 4
kite = Inti.gmsh_curve(0, 1; meshsize) do s
SVector(0.25, 0.0) + SVector(cos(2π * s) + 0.65 * cos(4π * s[1]) - 0.65, 1.5 * sin(2π * s))
end
Expand Down Expand Up @@ -163,7 +163,7 @@ fig, ax, pl = viz(Ω_msh;
color = er_log10,
colormap = :viridis,
colorrange,
axis = (aspect = DataAspect(),),
axis = (aspect = DataAspect(),),
interpolate=true
)
Colorbar(fig[1, 2]; label = "log₁₀(error)", colorrange)
Expand All @@ -182,14 +182,14 @@ There are two cases where the direct evaluation of layer potentials is not
recommended:

1. When the target point is close to the boundary (nearly-singular integrals).
2. When you wish to evaluate the layer potential at many target points and take
advantage of an acceleration routine.
2. When evaluation at many target points is desired (computationally
burdensome)and take advantage of an acceleration routine.

In such cases, it is recommended to use the `single_double_layer` function
In such contexts, it is recommended to use the `single_double_layer` function
(alternately, one can directly assemble an `IntegralOperator`) with a
correction and/or compression method as appropriate. Here is an example of how
to use the FMM acceleration with a near-field correction to evaluate the layer
potentials::
correction, for the first case, and/or a compression (acceleration) method, for
the latter case, as appropriate. Here is an example of how to use the FMM
acceleration with a near-field correction to evaluate the layer potentials::

```@example layer_potentials
using FMM2D
Expand Down

0 comments on commit 375bea9

Please sign in to comment.