Skip to content

Commit 61fb50b

Browse files
committed
update demos
1 parent bb076b8 commit 61fb50b

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

demo/python/demo_custom_element.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import basix
1111
import numpy as np
12-
from basix import CellType, MapType, PolynomialType, LatticeType, SobolevSpace, PolysetType
12+
from basix import CellType, MapType, PolynomialType, LatticeType, SobolevSpace
1313

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

70-
pts, wts = basix.make_quadrature(CellType.quadrilateral, PolysetType.standard, 4)
70+
pts, wts = basix.quadrature.make_quadrature(CellType.quadrilateral, 4)
7171
poly = basix.tabulate_polynomials(PolynomialType.legendre, CellType.quadrilateral, 2, pts)
7272
x = pts[:, 0]
7373
y = pts[:, 1]
@@ -188,7 +188,7 @@
188188
wcoeffs[0, 0] = 1
189189
wcoeffs[1, 3] = 1
190190

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

206-
pts, wts = basix.make_quadrature(CellType.interval, PolysetType.standard, 1)
206+
pts, wts = basix.quadrature.make_quadrature(CellType.interval, 1)
207207

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

demo/python/demo_custom_element_conforming_cr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def create_ccr_triangle(degree):
6262
wcoeffs[dof_n, dof_n] = 1
6363
dof_n += 1
6464

65-
pts, wts = basix.make_quadrature(CellType.triangle, PolysetType.standard, 2 * (degree + 1))
65+
pts, wts = basix.quadrature.make_quadrature(CellType.triangle, 2 * (degree + 1))
6666
poly = basix.tabulate_polynomials(PolynomialType.legendre, CellType.triangle, degree + 1, pts)
6767
for i in range(1, degree):
6868
x = pts[:, 0]

demo/python/demo_facet_integral.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import basix
1717
import numpy as np
18-
from basix import ElementFamily, CellType, LagrangeVariant, PolysetType
18+
from basix import ElementFamily, CellType, LagrangeVariant
1919

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

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

29-
points, weights = basix.make_quadrature(CellType.triangle, PolysetType.standard, 3)
29+
points, weights = basix.quadrature.make_quadrature(CellType.triangle, 3)
3030

3131
# Next, we must map the quadrature points to our facet. We use the function
3232
# `geometry` to get the coordinates of the vertices of the tetrahedron, and

demo/python/demo_quadrature.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
# `make_quadrature` returns two values: the points and the weights of the
2929
# quadrature rule.
3030

31-
points, weights = basix.make_quadrature(CellType.triangle, PolysetType.standard, 4)
31+
points, weights = basix.quadrature.make_quadrature(CellType.triangle, 4)
3232

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

37-
points, weights = basix.make_quadrature(
38-
basix.QuadratureType.gauss_jacobi, CellType.triangle, PolysetType.standard, 4)
37+
points, weights = basix.quadrature.make_quadrature(
38+
CellType.triangle, 4, rule=basix.QuadratureType.gauss_jacobi)
3939

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

0 commit comments

Comments
 (0)