From 8cf146f115f6cf952e0bfcff51b3a7ff6a9f0acf Mon Sep 17 00:00:00 2001 From: ksagiyam Date: Mon, 11 Nov 2024 14:30:50 +0000 Subject: [PATCH] test: add test for 0**{min_value, max_value} --- tests/regression/test_assemble.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/regression/test_assemble.py b/tests/regression/test_assemble.py index a80b46d5f0..5be8e837d0 100644 --- a/tests/regression/test_assemble.py +++ b/tests/regression/test_assemble.py @@ -316,3 +316,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