Skip to content

Commit

Permalink
update demos
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs committed Aug 7, 2023
1 parent bb076b8 commit 61fb50b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions demo/python/demo_custom_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import basix
import numpy as np
from basix import CellType, MapType, PolynomialType, LatticeType, SobolevSpace, PolysetType
from basix import CellType, MapType, PolynomialType, LatticeType, SobolevSpace

# Lagrange element with bubble
# ============================
Expand Down Expand Up @@ -67,7 +67,7 @@
# We compute these integrals using a degree 4 quadrature rule (this is the largest degree
# that the integrand will be, so these integrals will be exact).

pts, wts = basix.make_quadrature(CellType.quadrilateral, PolysetType.standard, 4)
pts, wts = basix.quadrature.make_quadrature(CellType.quadrilateral, 4)
poly = basix.tabulate_polynomials(PolynomialType.legendre, CellType.quadrilateral, 2, pts)
x = pts[:, 0]
y = pts[:, 1]
Expand Down Expand Up @@ -188,7 +188,7 @@
wcoeffs[0, 0] = 1
wcoeffs[1, 3] = 1

pts, wts = basix.make_quadrature(CellType.triangle, PolysetType.standard, 2)
pts, wts = basix.quadrature.make_quadrature(CellType.triangle, 2)
poly = basix.tabulate_polynomials(PolynomialType.legendre, CellType.triangle, 1, pts)
x = pts[:, 0]
y = pts[:, 1]
Expand All @@ -203,7 +203,7 @@
# the element are integrals. We begin by defining a degree 1 quadrature rule on an interval.
# This quadrature rule will be used to integrate on the edges of the triangle.

pts, wts = basix.make_quadrature(CellType.interval, PolysetType.standard, 1)
pts, wts = basix.quadrature.make_quadrature(CellType.interval, 1)

# The points associated with each edge are calculated by mapping the quadrature points to each edge.

Expand Down
2 changes: 1 addition & 1 deletion demo/python/demo_custom_element_conforming_cr.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def create_ccr_triangle(degree):
wcoeffs[dof_n, dof_n] = 1
dof_n += 1

pts, wts = basix.make_quadrature(CellType.triangle, PolysetType.standard, 2 * (degree + 1))
pts, wts = basix.quadrature.make_quadrature(CellType.triangle, 2 * (degree + 1))
poly = basix.tabulate_polynomials(PolynomialType.legendre, CellType.triangle, degree + 1, pts)
for i in range(1, degree):
x = pts[:, 0]
Expand Down
4 changes: 2 additions & 2 deletions demo/python/demo_facet_integral.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import basix
import numpy as np
from basix import ElementFamily, CellType, LagrangeVariant, PolysetType
from basix import ElementFamily, CellType, LagrangeVariant

# We define a degree 3 Lagrange space on a tetrahedron.

Expand All @@ -26,7 +26,7 @@
# rule on a triangle. We use an order 3 rule so that we can integrate the
# basis functions in our space exactly.

points, weights = basix.make_quadrature(CellType.triangle, PolysetType.standard, 3)
points, weights = basix.quadrature.make_quadrature(CellType.triangle, 3)

# Next, we must map the quadrature points to our facet. We use the function
# `geometry` to get the coordinates of the vertices of the tetrahedron, and
Expand Down
6 changes: 3 additions & 3 deletions demo/python/demo_quadrature.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
# `make_quadrature` returns two values: the points and the weights of the
# quadrature rule.

points, weights = basix.make_quadrature(CellType.triangle, PolysetType.standard, 4)
points, weights = basix.quadrature.make_quadrature(CellType.triangle, 4)

# If we want to control the type of quadrature used, we can pass in three
# inputs to `make_quadrautre`. For example, the following code would force basix
# to use a Gauss-Jacobi quadrature rule:

points, weights = basix.make_quadrature(
basix.QuadratureType.gauss_jacobi, CellType.triangle, PolysetType.standard, 4)
points, weights = basix.quadrature.make_quadrature(
CellType.triangle, 4, rule=basix.QuadratureType.gauss_jacobi)

# We now use this quadrature rule to integrate the functions :math:`f(x,y)=x^3y`
# and :math:`g(x,y)=x^3y^2` over the triangle. The exact values of these integrals
Expand Down

0 comments on commit 61fb50b

Please sign in to comment.