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

error: Multiplying expressions with overlapping form argument number 1

+2 votes

Hello,
i hope this qustions was not asked yet, because i did not find it.
I try to run a incompressible Navier Stokes program. I tried different methods for the time discretization. Right now i deal with the Crank Nicolson scheme

    at = inner(u,v)*dx - 0.5*dt*nu*inner(grad(u),grad(v))*dx + 0.5*dt*inner(grad(u)*u,v)*dx
L2 = inner(Function(V,uold),v)*dx + 0.5*dt*nu*inner(grad(Function(V,uold)),grad(v))*dx - 0.5*dt*inner(grad(Function(V,uold))*Function(V,uold),v)*dx

But as I assemble the matrix

AA = block_assemble([[a11, a12],
                 [a21,  0 ]], bcs=bcs)

I get the following error, as I mentioned in topic:

Traceback (most recent call last):
File "ns_cylinder_crank_nicolson_BFB.py", line 163, in
[a21, 0 ]], bcs=bcs)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/block/block_assemble.py", line 55, in block_assemble
A.blocks.flat[:] = map(assemble_if_form,A.blocks.flat)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/block/block_assemble.py", line 53, in
assemble_if_form = lambda x: assemble(x) if _is_form(x) else x
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/dolfin/fem/assembling.py", line 193, in assemble
cell_domains, exterior_facet_domains, interior_facet_domains)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/dolfin/fem/assembling.py", line 75, in _create_dolfin_form
form_compiler_parameters=form_compiler_parameters)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/dolfin/fem/form.py", line 70, in init
mpi_comm=mesh.mpi_comm())
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/dolfin/compilemodules/jit.py", line 64, in mpi_jit
return local_jit(*args, **kwargs)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/dolfin/compilemodules/jit.py", line 128, in jit
return form_compiler.jit(form, parameters=p)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/ffc/jitcompiler.py", line 74, in jit
return jit_form(ufl_object, parameters)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/ffc/jitcompiler.py", line 130, in jit_form
parameters=parameters)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/ffc/compiler.py", line 151, in compile_form
analysis = analyze_forms(forms, parameters)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/ffc/analysis.py", line 59, in analyze_forms
parameters) for form in forms)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/ffc/analysis.py", line 59, in
parameters) for form in forms)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/ffc/analysis.py", line 132, in _analyze_form
form_data = compute_form_data(form)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/ufl/algorithms/compute_form_data.py", line 304, in compute_form_data
check_form_arity(preprocessed_form, form.arguments()) # Currently testing how fast this is
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/ufl/algorithms/check_arities.py", line 123, in check_form_arity
check_integrand_arity(itg.integrand(), arguments)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/ufl/algorithms/check_arities.py", line 117, in check_integrand_arity
args = map_expr_dag(rules, expr, compress=False)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/ufl/corealg/map_dag.py", line 67, in map_expr_dag
r = function(v, *rops)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/ufl/corealg/multifunction.py", line 72, in __call__
return self._handlers[o._ufl_typecode_](o, *args)
File "/afs/mpi-magdeburg.mpg.de/data/csc/software/64bit/fenics-1.5.0-ubuntu1204/lib/python2.7/site-packages/ufl/algorithms/check_arities.py", line 54, in product
raise ArityMismatch("Multiplying expressions with overlapping form argument number {0}, argument is {1}.".format(x.number(), x))
ufl.algorithms.check_arities.ArityMismatch: Multiplying expressions with overlapping form argument number 1, argument is v_1.

I hope someone can help me fix it.

Additionally I now the Crank Nicolson scheme is non linear, and i have to solve it with a Newton Solver. How can I add it?

I would be pleased to receive any kind of help!

asked Dec 1, 2015 by Farbdrucker FEniCS Novice (160 points)

1 Answer

+1 vote

Have you fix this problem, I am getting same error

answered Nov 11, 2016 by hirshikesh FEniCS User (1,890 points)
...