This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Error - Missing Integration Domain at Solving Non-Linear Problem.

+1 vote

Hi guys.
I am having a little trouble finding my error in here. I have this working code that triggers no problem:

def F(mesh, boundary_parts, mu, u, z, lx, ly, Ao,p,moduleSimmetry2):
print "Entering SearchDirection"
parameters['allow_extrapolation' ] = True
n = FacetNormal(mesh)
V = VectorFunctionSpace(mesh,'Lagrange',1)
Q = FunctionSpace(mesh,'DG',1)
W= V * Q
ds = Measure('ds')[boundary_parts]
noslip = Constant((0,0))
bc0 = DirichletBC(W.sub(0), noslip, boundary_parts,3)
bc1 = DirichletBC(W.sub(0), noslip, boundary_parts,1)
bc2 = DirichletBC(W.sub(0), noslip, boundary_parts,2)
bcs = [bc0, bc1, bc2]
(w, p) = TrialFunctions(W)
(v, q) = TestFunctions(W)

g = assemble(Constant(1.0)*dx(mesh))-(lx*ly-Ao)
a = (inner(grad(w),grad(v))+inner(w,v))*dx+p*inner(v,n)*ds(0)+q*inner(w,n)*ds(0)
L = (2*mu*(inner(epsilon(u),epsilon(z))))*inner(n,v)*ds(0)-g*q*ds(0)

    ww = Function(W)
solve(a == L,ww,bcs)        
(w, p) = ww.split(True)

But I need to change the definition of g, hence typing:

    g = assemble(moduleSimmetry2*dx(mesh))
print g
a = (inner(grad(w),grad(v))+inner(w,v))*dx(mesh)+p*moduleSimmetry2*inner(v,n)*ds(0)+q*moduleSimmetry2*inner(w,n)*ds(0)
b = (2*mu*(inner(epsilon(u),epsilon(z))))*inner(n,v)*ds(0)

c=g*q*ds(0,subdomain_data=boundary_parts)
L=b-c

Then solving again a==L. However, the following error triggers:

Calling FFC just-in-time (JIT) compiler, this may take some time. Notation dx[meshfunction] is deprecated. Please use
dx(subdomain_data=meshfunction) instead.
0.0 This integral is missing an integration domain. Traceback (most recent call last): File "main.py", line 85, in
w,lam = funcs.F(mesh,boundary_parts,mu,u,z,lx,ly,Ao,p,moduleSymmetry2)
File "funcs.py", line 391, in F
c=g
qds(0,subdomain_data=boundary_parts) File "/usr/lib/python2.7/dist-packages/ufl/measure.py", line 398, in
rmul
error("This integral is missing an integration domain.") File "/usr/lib/python2.7/dist-packages/ufl/log.py", line 158, in error
raise self._exception_type(self._format_raw(
message)) ufl.log.UFLException: This integral is missing an integration domain.
Aborted (core dumped)*

I have already tried printing the value of g, which is 0.0. I have also thought that error is in the definition of moduleSymmetry2, but I discarded that possibility because if I remove the term g, the solver does not trigger any error (but, of course, fails to converge).

What am I missing?
If you need the full version of the code I can upload it, I have uploaded only this to be as brief as possible.

asked Feb 22, 2017 by Iha FEniCS Novice (260 points)

I am my self new to Fenics, so this is a guess:
your g has a dx in it and you multiply it by ds, therefore it has two integrals, I thnik this is not allowed.

how is moduleSymmetry2 defined?

The definition of moduleSimmetry2 is as shown below:

moduleSimmetry2=Symmetry(mesh)

def Symmetry(mesh):
V=VectorFunctionSpace(mesh,"Lagrange",1)
X = Function(V)
position=Expression( ("x[0]","x[1]") )
positionV = interpolate(position,V)
X.vector()[:]=positionV.vector().array()

L=len(X.vector().array())/2
M=X.vector().array().reshape(L,2)
N = X.vector().array().reshape(L,2)
for i in range(L):
    [Xpos,Ypos]=M[i,:]
    N[i,:]=([0,0])

    for c in cells(mesh):
        if (c.contains(Point(-Xpos, Ypos))):
            N[i,:]=([-Xpos,Ypos])

K=numpy.zeros_like(N)
for i in range(L):
    K[i,0]= M[i,0]+N[i,0]
    K[i,1]= M[i,1]-N[i,1]

Sym=Function(V)
Sym.vector()[:]=K.reshape(L*2,1)

Q=FunctionSpace(mesh, "Lagrange",1)
moduleSymmetry2= Function(Q)
array=numpy.zeros_like(moduleSimmetry2.vector().array())

for i in range(L):
    array[i]=Sym.vector().array()[2*i]**2 + Sym.vector().array()[2*i+1]**2
moduleSymmetry2.vector()[:]=array

return moduleSimmetry2

Although this definition is a little bit chaotic, it works (i.e., I have checked it assigns correctly the values at any point). In no case is there a derivative or what so ever.

1 Answer

+1 vote
 
Best answer

To avoid the error message try something like this:

g = Constant(assemble(moduleSimmetry2*dx))

However the error could be that you are defining wrongly the function spaces (maybe in the definition of moduleSymmetry2 you are calculating the second derivative of functions that lives in a function space of order 1, which vanishes over the whole domain)

answered Feb 23, 2017 by hernan_mella FEniCS Expert (19,460 points)
selected Feb 23, 2017 by Iha

Thank you very much, this works. However, it fails to converge, but that's an error in my formulation for sure, not something related to the usage of FEniCS.

Thank you all guys for your time and help.

...