Adaptive solve does not work with both cell domains and facet domains
Bug #872105 reported by
Johan Hake
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
Fix Released
|
High
|
Marie Rognes |
Bug Description
When I define both cell and facet domains in an equation I ship to adaptive solve I get a weird error:
#######
from dolfin import *
mesh = UnitSquare(2,2)
face_markers = FacetFunction(
cell_markers = CellFunction(
V = FunctionSpace(mesh, "CG", 1)
v = TestFunction(V)
u = TrialFunction(V)
dxx = dx[cell_markers]
dss = ds[face_markers]
a = u*v*dxx(1) + u*v*dss(1)
L = v*dss(1)
u = Function(V)
solve(a==L, u, tol=0.001, M=u*dxx(1))
#######
UFLException: Found two domain data objects for same domain type.
Changed in dolfin: | |
status: | New → Confirmed |
assignee: | nobody → Marie Rognes (meg-simula) |
importance: | Undecided → Medium |
importance: | Medium → High |
milestone: | none → 1.0-rc1 |
Changed in dolfin: | |
milestone: | 1.1.0 → trunk |
Changed in dolfin: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I'm not quite sure how to best resolve this. (BTW: it doesn't really
have anything to do with both cell domains and facet domains. Try
removing the facet domains)
For the error control, a bunch of forms are created, in particular, one
that looks more or less like
# u = Function(...)
# v = L's TestFunction
# R_T = Function(...)
L_dT = L - action(a, u) - inner(R_T, v)*dx
Here, the last term (let's call it 'L_R') is supposed to be an integral
over the entire domain. However, UFL complains (with good reason) since
the domain data in the cell integral in 'a' (cell_markers) and in 'L_R'
(None) doesn't match.
Possible solutions:
(1) Redesign error control generation so that all terms in automatically
created forms are stored and assembled separately and added on the
linear algebra level. For instance L_1 = L, L_2 = - action(a, u), L_3 =
-inner(R_T, v)*dx in the example above. (Will become a mess and involves
a significant amount of work, but is very robust)
(2) Hack the generation of 'L_R', so that -inner(R_T, v)*dx(i) is added values- used-in- a-and-or- L-to-indicate- subdomains
for i in range-of-
(3) Keep rethinking a more flexible way of specifying subdomains and
assembly over such.
(4) ... ?
--
Marie
On 10/11/11 06:00, Johan Hake wrote: ####### ####### ####### ####### "uint", mesh, 1) "uint", mesh, 1) ####### ####### ####### ###
> Public bug reported:
>
> When I define both cell and facet domains in an equation I ship to
> adaptive solve I get a weird error:
>
> #######
> from dolfin import *
>
> mesh = UnitSquare(2,2)
> face_markers = FacetFunction(
> cell_markers = CellFunction(
> V = FunctionSpace(mesh, "CG", 1)
> v = TestFunction(V)
> u = TrialFunction(V)
>
> dxx = dx[cell_markers]
> dss = ds[face_markers]
>
> a = u*v*dxx(1) + u*v*dss(1)
> L = v*dss(1)
>
> u = Function(V)
>
> solve(a==L, u, tol=0.001, M=u*dxx(1))
>
> #######
>
> UFLException: Found two domain data objects for same domain type.
>
> ** Affects: dolfin
> Importance: Undecided
> Status: New
>