Skip to content

Commit

Permalink
Doc update and unpin Sphinx version (#877)
Browse files Browse the repository at this point in the history
* Doc updates

* Unpin Sphinx version

* Doc fix
  • Loading branch information
garth-wells authored Nov 16, 2024
1 parent fc9ec6a commit 9227c35
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 30 deletions.
3 changes: 0 additions & 3 deletions cpp/basix/polyset.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ tabulate(cell::type celltype, polyset::type ptype, int d, int n,
/// @param[in,out] P Polynomial sets, for each derivative, tabulated at
/// points. The shape is `(number of derivatives computed, number of
/// points, basis index)`.
///
/// - The first index is the derivative. The first entry is the basis
/// itself. Derivatives are stored in triangular (2D) or tetrahedral
/// (3D) ordering, eg if `(p, q)` denotes `p` order derivative with
Expand All @@ -212,10 +211,8 @@ tabulate(cell::type celltype, polyset::type ptype, int d, int n,
/// [5] -> (0, 2), [6] -> (3, 0),...
/// The function basix::indexing::idx maps tuples `(p, q, r)` to the array
/// index.
///
/// - The second index is the point, with index `i` corresponding to the
/// point in row `i` of `x`.
///
/// - The third index is the basis function index.
/// @todo Does the order for the third index need to be documented?
/// @param[in] celltype Cell type
Expand Down
46 changes: 20 additions & 26 deletions cpp/basix/precompute.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "math.h"
#include "mdspan.hpp"
#include <concepts>
#include <cstdint>
#include <span>
#include <tuple>
#include <type_traits>
Expand Down Expand Up @@ -58,33 +59,28 @@ using scalar_value_type_t = typename scalar_value_type<T>::value_type;
/// than 0, so the 0th entry of the output is 1.
///
/// -# Next, we look at the 1st entry. `P[1]` is 4. This is greater than
/// 1, so the 1st entry of the output is 4.
///
/// 1, so the 1st entry of the output is 4.
/// -# Next, we look at the 2nd entry. `P[2]` is 0. This is less than 2,
/// so we look at `P[0]. `P[0]` is 1. This is less than 2, so we look at
/// `P[1]`. `P[1]` is 4. This is greater than 2, so the 2nd entry of the
/// output is 4.
///
/// so we look at `P[0]`. `P[0]` is 1. This is less than 2, so we look at
/// `P[1]`. `P[1]` is 4. This is greater than 2, so the 2nd entry of the
/// output is 4.
/// -# Next, we look at the 3rd entry. `P[3]` is 5. This is greater than 3,
/// so the 3rd entry of the output is 5.
///
/// so the 3rd entry of the output is 5.
/// -# Next, we look at the 4th entry. `P[4]` is 2. This is less than 4, so
/// we look at `P[2]`. `P[2]` is 0. This is less than 4, so we look at
/// `P[0]`. `P[0]` is 1. This is less than 4, so we look at `P[1]`.
/// `P[1]` is 4. This is greater than (or equal to) 4, so the 4th entry
/// of the output is 4.
///
/// we look at `P[2]`. `P[2]` is 0. This is less than 4, so we look at
/// `P[0]`. `P[0]` is 1. This is less than 4, so we look at `P[1]`.
/// `P[1]` is 4. This is greater than (or equal to) 4, so the 4th entry
/// of the output is 4.
/// -# Next, we look at the 5th entry. `P[5]` is 3. This is less than 5,
/// so we look at `P[3]`. `P[3]` is 5. This is greater than (or equal
/// to) 5, so the 5th entry of the output is 5.
/// so we look at `P[3]`. `P[3]` is 5. This is greater than (or equal
/// to) 5, so the 5th entry of the output is 5.
///
/// Hence, the output of this function in this case is `[1, 4, 4, 5, 4,
/// 5]`.
/// Hence, the output of this function in this case is `[1, 4, 4, 5, 4, 5]`.
///
/// For an example of how the permutation in this form is applied, see
/// apply_permutation().
///
/// @param[in,out] perm A permutation
/// @param[in,out] perm A permutation.
void prepare_permutation(std::span<std::size_t> perm);

/// @brief Apply a (precomputed) permutation \f$v = P u\f$.
Expand All @@ -110,17 +106,14 @@ void prepare_permutation(std::span<std::size_t> perm);
/// this example, we look at how this representation can be used to
/// apply this permutation to the array `A = [a, b, c, d, e, f]`.
///
/// - `P2[0]` is 1, so we swap `A[0]` and `A[1]`. After this, `A = [b,
/// a, c, d, e, f]`.
/// - `P2[0]` is 1, so we swap `A[0]` and `A[1]`. After this,
/// `A = [b, a, c, d, e, f]`.
///
/// - `P2[1]` is 4, so we swap `A[1]` and `A[4]`. After this, `A = [b,
/// e, c, d, a, f]`.
/// - `P2[1]` is 4, so we swap `A[1]` and `A[4]`. After this, `A = [b, e, c, d, a, f]`.
///
/// - `P2[2]` is 4, so we swap `A[2]` and `A[4]`. After this, `A = [b, e,
/// a, d, c, f]`.
/// - `P2[2]` is 4, so we swap `A[2]` and `A[4]`. After this, `A = [b, e, a, d, c, f]`.
///
/// - `P2[3]` is 5, so we swap `A[3]` and `A[5]`. After this, `A = [b,
/// e, a, f, c, d]`.
/// - `P2[3]` is 5, so we swap `A[3]` and `A[5]`. After this, `A = [b,e,a,f,c,d]`.
///
/// - `P2[4]` is 4, so we swap `A[4]` and `A[4]`. This changes nothing.
///
Expand Down Expand Up @@ -261,6 +254,7 @@ void apply_matrix(
+= static_cast<U>(M(i, j)) * data[n * (offset + j) + b];
}
}

for (std::size_t i = 1; i <= dim; ++i)
{
data[n * (offset + dim - i) + b] *= static_cast<U>(M(dim - i, dim - i));
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ authors = [
dependencies = ["numpy>=1.21"]

[project.optional-dependencies]
docs = ["markdown", "pylit3", "pyyaml", "sphinx==5.0.2", "sphinx_rtd_theme"]
docs = ["markdown", "pylit3", "pyyaml", "sphinx", "sphinx_rtd_theme"]
lint = ["ruff"]
optional = ["numba", "fenics-ufl@git+https://github.com/fenics/ufl"]
test = ["pytest", "sympy", "scipy", "matplotlib", "fenics-basix[optional]"]
Expand Down

0 comments on commit 9227c35

Please sign in to comment.