I'm trying to switch some code to the new syntax for associating
domains with measures, but I'm having trouble with the below code from
the unit tests in test/unit/fem/python/Assembler.py:
# Mark mesh functions
D = mesh.topology().dim()
cell_domains = MeshFunction("size_t", mesh, D)
exterior_facet_domains = MeshFunction("size_t", mesh, D - 1)
cell_domains.set_all(1)
exterior_facet_domains.set_all(1)
my_domain.mark(cell_domains, 0)
my_boundary.mark(exterior_facet_domains, 0)
# Define forms
c = Constant(1.0)
dxs = dx[cell_domains]
a0 = c*dxs(0)
dss = ds[exterior_facet_domains]
a1 = c*dss(0)
# Old syntax
self.assertAlmostEqual(assemble(a0, mesh=mesh), 0.25)
self.assertAlmostEqual(assemble(a1, mesh=mesh), 1.0)
# New syntax that I expected to work, but I get a DOLFIN error
self.assertAlmostEqual(assemble(a0), 0.25)
self.assertAlmostEqual(assemble(a1), 1.0)
I expected the last two lines to work, but I get the error:
assert form.domains(), "Expecting a completed form with domains at
this point."
AssertionError: Expecting a completed form with domains at this point.
Garth
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics