Skip to content

Commit

Permalink
raise ValueError for Gauss order out of the range
Browse files Browse the repository at this point in the history
  • Loading branch information
pescap committed Oct 13, 2024
1 parent d7d4e83 commit 54f7970
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bempp/api/integration/gauss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,10 @@ def rule(order):
Orders between 1 and 30 are supported.
"""
if order < 1 or order > 30:
raise ValueError(
f"Gauss quadrature order must be between 1 and 30. Provided: {order}"
)
npoints = order
address = (npoints * (npoints - 1)) // 2
return (
Expand Down
4 changes: 4 additions & 0 deletions bempp/api/integration/triangle_gauss.py
Original file line number Diff line number Diff line change
Expand Up @@ -2931,6 +2931,10 @@ def rule(order):
The order must be between 1 and 20.
"""
if order < 1 or order > 20:
raise ValueError(
f"Symmetric Gauss quadrature order must be between 1 and 20. Provided: {order}"
)
npoints = points_per_order[order - 1]
address = points_address[npoints - 1]
bary_coords = coords[3 * address : 3 * (address + npoints)].reshape(
Expand Down

0 comments on commit 54f7970

Please sign in to comment.