Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Jan 9, 2025
1 parent 6d8989a commit dc43bb1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
SpatialCoordinate,
TestFunction,
TrialFunction,
action,
derivative,
dot,
ds,
dx,
Expand Down Expand Up @@ -175,6 +177,7 @@ def test_formsum(mass):
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2,), identity_pullback, H1))
V = FunctionSpace(domain, element)
v = Cofunction(V.dual())
u = Coefficient(V)

assert v + mass
assert mass + v
Expand All @@ -195,3 +198,10 @@ def test_formsum(mass):
assert 2 * v
assert isinstance(2 * v, BaseForm)
assert (2 * v).weights()[0] == 2

f = action(-v, u)
df = derivative(9 * f, u)
assert isinstance(f, FormSum)
assert f.weights()[0] == -1
assert isinstance(df, FormSum)
assert df.weights()[0] == -9

0 comments on commit dc43bb1

Please sign in to comment.