Sample test case:
class FormOperations(unittest.TestCase):
def test_lhs_rhs_simple(self): # Test taking lhs/rhs of forms involving constants. Most else # should be testable in UFL itself.
mesh = UnitSquare(2, 2) V = FunctionSpace(mesh, "CG", 1) f = Constant(1.0) v = TestFunction(V) u = TrialFunction(V)
F = inner(grad(f*v), grad(u))*dx + f*v*dx a, L = system(F)
assert(len(a._integrals) == 1) assert(len(L._integrals) == 1)
Sample test case:
class FormOperations( unittest. TestCase) :
def test_lhs_ rhs_simple( self):
# Test taking lhs/rhs of forms involving constants. Most else
# should be testable in UFL itself.
mesh = UnitSquare(2, 2)
V = FunctionSpace(mesh, "CG", 1)
f = Constant(1.0)
v = TestFunction(V)
u = TrialFunction(V)
F = inner(grad(f*v), grad(u))*dx + f*v*dx
a, L = system(F)