Skip to content

Commit

Permalink
test: add test for 0**{min_value, max_value} (#3855)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksagiyam authored Nov 22, 2024
1 parent 76d8daa commit 7dcfa52
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/regression/test_assemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,13 @@ def test_assemble_sparsity_diagonal_entries_for_bc():
A = assemble(inner(u[1], v[0]) * dx, bcs=[bc], mat_type="nest")
# Make sure that diagonals are allocated.
assert np.all(A.M.sparsity[1][1].nnz == np.ones(4, dtype=IntType))


@pytest.mark.skipcomplex
def test_assemble_power_zero_minmax():
mesh = UnitSquareMesh(1, 1)
V = FunctionSpace(mesh, "CG", 1)
f = Function(V).assign(1.)
g = Function(V).assign(2.)
assert assemble(zero()**min_value(f, g) * dx) == 0.0
assert assemble(zero()**max_value(f, g) * dx) == 0.0

0 comments on commit 7dcfa52

Please sign in to comment.