Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doc warnings and make docs build strict #1039

Merged
merged 12 commits into from
Aug 5, 2024
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ bibtex_plugin = CitationBibliography(
),
sitename = "Ferrite.jl",
doctest = false,
warnonly = true,
warnonly = is_ci ? false : [:cross_references], # Local build exception required for Literate's `@__NBVIEWER_ROOT_URL__`
draft = liveserver,
pages = Any[
"Home" => "index.md",
Expand Down
4 changes: 2 additions & 2 deletions docs/src/assets/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ @article{SimMie:1992:act
pages = {41-104},
year = {1992},
issn = {0045-7825},
doi = {https://doi.org/10.1016/0045-7825(92)90170-O},
doi = {10.1016/0045-7825(92)90170-O},
url = {https://www.sciencedirect.com/science/article/pii/004578259290170O},
author = {J.C. Simo and C. Miehe},
}
Expand Down Expand Up @@ -117,7 +117,7 @@ @article{Mu:2014:IP
pages = {432-440},
year = {2014},
issn = {0377-0427},
doi = {https://doi.org/10.1016/j.cam.2013.06.003},
doi = {10.1016/j.cam.2013.06.003},
url = {https://www.sciencedirect.com/science/article/pii/S0377042713002999},
author = {Lin Mu and Junping Wang and Yanqiu Wang and Xiu Ye},
keywords = {Discontinuous Galerkin, Finite element, Interior penalty, Second-order elliptic equations, Hybrid mesh},
Expand Down
2 changes: 1 addition & 1 deletion docs/src/devdocs/FEValues.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Custom FEValues, `fe_v::AbstractValues`, should normally implement the [`reinit!
* [`getnquadpoints`](@ref)
* [`getnbasefunctions`](@ref)
* [`spatial_coordinate`](@ref), requires
* [`geometric_value`](@ref)
* [`geometric_value`](@ref Ferrite.geometric_value)
* `getngeobasefunctions`
* [`getnquadpoints`](@ref)

Expand Down
11 changes: 6 additions & 5 deletions docs/src/devdocs/dofhandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
## Type definitions

Dof handlers are subtypes of `AbstractDofhandler{sdim}`, i.e. they are
parametrized by the spatial dimension. Internally a helper struct [`InterpolationInfo`](@ref) is utilized to enforce type stability during
dof distribution, because the interpolations are not available as concrete
types.
parametrized by the spatial dimension. Internally a helper struct
[`InterpolationInfo`](@ref Ferrite.InterpolationInfo) is utilized to enforce type stability
during dof distribution, because the interpolations are not available as concrete types.

```@docs
Ferrite.InterpolationInfo
Expand All @@ -16,12 +16,13 @@ Ferrite.SurfaceOrientationInfo

## Internal API

The main entry point for dof distribution is [`__close!`](@ref).
The main entry point for dof distribution is [`__close!`](@ref Ferrite.__close!).

```@docs
Ferrite.__close!
Ferrite.get_grid
Ferrite.find_field(dh::DofHandler, field_name::Symbol)
Ferrite.find_field
Ferrite._find_field
Ferrite._close_subdofhandler!
Ferrite._distribute_dofs_for_cell!
Ferrite.permute_and_push!
Expand Down
1 change: 0 additions & 1 deletion docs/src/devdocs/interpolations.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ parametrized by the reference element and its characteristic order.
### Fallback methods applicable for all subtypes of `Interpolation`

```@docs
Ferrite.getrefdim(::Interpolation)
Ferrite.getrefshape(::Interpolation)
Ferrite.getorder(::Interpolation)
Ferrite.reference_shape_gradient(::Interpolation, ::Vec, ::Int)
Expand Down
5 changes: 5 additions & 0 deletions docs/src/devdocs/reference_cells.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@ which automatically defines
```@docs
Ferrite.reference_facets(::Type{<:Ferrite.AbstractRefShape})
```

### Applicable methods to `AbstractRefShape`s
```@docs
Ferrite.getrefdim(::Type{<:Ferrite.AbstractRefShape})
```
2 changes: 1 addition & 1 deletion docs/src/literate-gallery/topology_optimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ end

#md # ## References
#md # ```@bibliography
#md # Pages = ["gallery/topology_optimization.md"]
#md # Pages = ["topology_optimization.md"]
#md # Canonical = false
#md # ```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/literate-tutorials/dg_heat_equation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ using Test #src

#md # ## References
#md # ```@bibliography
#md # Pages = ["tutorials/dg_heat_equation.md"]
#md # Pages = ["dg_heat_equation.md"]
#md # Canonical = false
#md # ```

Expand Down
2 changes: 1 addition & 1 deletion docs/src/reference/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ getcoordinates!
geometric_interpolation(::Ferrite.AbstractCell)
get_node_coordinate
Ferrite.getspatialdim(::Ferrite.AbstractGrid)
Ferrite.getrefdim
Ferrite.getrefdim(::Ferrite.AbstractCell)
```

### Topology
Expand Down
4 changes: 2 additions & 2 deletions docs/src/topics/assembly.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ into the sparse matrix `K` directly. Therefore we will instead use an
matrix and the global force vector. It is also often convenient to create the
sparse matrix just once, and reuse the allocated matrix. This is useful for
e.g. iterative solvers or time dependent problems where the sparse matrix
structure, or [Sparsity Pattern](@ref) will stay the same in every iteration/
time step.
structure, or [Sparsity Pattern](@ref "Sparsity pattern and sparse matrices")
will stay the same in every iteration/time step.

## `Assembler`

Expand Down
2 changes: 1 addition & 1 deletion docs/src/topics/boundary_conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ conditions, and they need to be handled in different ways. Below we discuss how
the most common ones, Dirichlet and Neumann boundary conditions, and how to do it `Ferrite`.

While boundary conditions can be applied directly to nodes, vertices, edges, or faces,
they are most commonly applied to [facets](@ref Reference shapes). Each facet is described
they are most commonly applied to [facets](@ref "Reference shapes"). Each facet is described
by a [`FacetIndex`](@ref).
When adding boundary conditions to points instead, vertices are preferred over nodes.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/topics/reference_shapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ Ferrite.reference_facets(RefQuadrilateral)
The functions `reference_vertices`, `reference_edges`, `reference_faces`, and `reference_facets`
are not public and only shown here to explain the numbering concept.
The specific ordering may also change, and is therefore only documented in the
[Developer documentation](../devdocs/reference_cells/).
[Developer documentation](@ref).
4 changes: 2 additions & 2 deletions docs/src/topics/sparse_matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ precision (`Float64`, 8 bytes) it would require 8 TB of memory. If instead the s
99.9973% (which is the case when solving the heat equation on a three dimensional hypercube
with linear Lagrange interpolation) this would be reduced to 216 MB.

[1]: Structurally nonzero means that there is a possibility of a nonzero value even though
[^1]: Structurally nonzero means that there is a possibility of a nonzero value even though
the computed value might become zero in the end for various reasons.

[2]: At least for most practical problems using low order interpolations.
[^2]: At least for most practical problems using low order interpolations.


!!! details "Sparsity pattern example"
Expand Down
2 changes: 1 addition & 1 deletion ext/FerriteMetis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ end
Fill-reducing permutation order from [Metis.jl](https://github.com/JuliaSparse/Metis.jl).

Since computing the permutation involves constructing the structural couplings between all
DoFs the field/component coupling can be provided; see [`create_sparsity_pattern`](@ref) for
DoFs the field/component coupling can be provided; see [`allocate_matrix`](@ref) for
details.
"""
function DofOrder.Ext{Metis}(;
Expand Down
2 changes: 1 addition & 1 deletion src/Dofs/DofHandler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ field was found and the 2nd entry is the index of the field within the `SubDofHa
Always finds the 1st occurrence of a field within `DofHandler`.

See also: [`find_field(sdh::SubDofHandler, field_name::Symbol)`](@ref),
[`_find_field(sdh::SubDofHandler, field_name::Symbol)`](@ref).
[`Ferrite._find_field(sdh::SubDofHandler, field_name::Symbol)`](@ref).
"""
function find_field(dh::DofHandler, field_name::Symbol)
for (sdh_idx, sdh) in pairs(dh.subdofhandlers)
Expand Down
2 changes: 1 addition & 1 deletion src/Dofs/sparsity_pattern.jl
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ allocate_matrix(MatrixType, sp)
````

Refer to [`allocate_matrix`](@ref allocate_matrix(::Type{<:Any}, ::SparsityPattern)) for
supported matrix types, and to [`create_sparsity_pattern`](@ref) for details about supported
supported matrix types, and to [`init_sparsity_pattern`](@ref) for details about supported
arguments `args` and keyword arguments `kwargs`.

!!! note
Expand Down
1 change: 1 addition & 0 deletions src/Ferrite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct RefPyramid <: AbstractRefShape{3} end

Get the dimension of the reference shape
"""
getrefdim(::Type{<:AbstractRefShape}) # To get correct doc filtering
getrefdim(::Type{<:AbstractRefShape{rdim}}) where rdim = rdim

abstract type AbstractCell{refshape <: AbstractRefShape} end
Expand Down
2 changes: 1 addition & 1 deletion src/Grid/coloring.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Two different algorithms are available, specified with the `alg` keyword argumen
- `alg = ColoringAlgorithm.Greedy`: greedy algorithm that works well for structured quadrilateral grids such as
e.g. quadrilateral grids from `generate_grid`.

The resulting colors can be visualized using [`vtk_cell_data_colors`](@ref).
The resulting colors can be visualized using [`Ferrite.write_cell_colors`](@ref).

!!! note "Cell to color mapping"
In a previous version of Ferrite this function returned a dictionary mapping
Expand Down
2 changes: 1 addition & 1 deletion src/L2_projection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Supported data types to project are `Number`s and `AbstractTensor`s.
!!! note
The order of the returned data correspond to the order of the `L2Projector`'s internal
`DofHandler`. The data can be further analyzed with [`evaluate_at_points`](@ref) and
[`evaluate_at_grid_nodes`](@ref). Use [`write_projected`](@ref) to export the result.
[`evaluate_at_grid_nodes`](@ref). Use [`write_projection`](@ref) to export the result.

"""
function project(proj::L2Projector, vars::Union{AbstractVector, AbstractDict})
Expand Down
2 changes: 1 addition & 1 deletion src/assembler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function _missing_sparsity_pattern_error(Krow::Int, Kcol::Int)
throw(ErrorException(
"You are trying to assemble values in to K[$(Krow), $(Kcol)], but K[$(Krow), " *
"$(Kcol)] is missing in the sparsity pattern. Make sure you have called `K = " *
"create_sparsity_pattern(dh)` or `K = create_sparsity_pattern(dh, ch)` if you " *
"allocate_matrix(dh)` or `K = allocate_matrix(dh, ch)` if you " *
"have affine constraints. This error might also happen if you are using " *
"`::AssemblerSparsityPattern` in a threaded assembly loop (you need to create an " *
"`assembler::AssemblerSparsityPattern` for each task)."
Expand Down
1 change: 1 addition & 0 deletions src/interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Base.copy(ip::Interpolation) = ip

Return the dimension of the reference element for a given interpolation.
"""
getrefdim(::Interpolation) # To make doc-filtering work
@inline getrefdim(::Interpolation{RefShape}) where RefShape = getrefdim(RefShape)

"""
Expand Down