← Back to team overview

dolfin team mailing list archive

Re: [Bug 745646] Re: Problem with assemble() with MixedFunctionSpace of symmetric TensorFunctionSpaces

 

On Wed, Mar 30, 2011 at 12:05:27PM -0000, Jørgen Myre wrote:
> NOTE:  I initially posted this as a Question, if that's wrong of me I
> can delete that thread.
>
> I am trying to solve for a system of equations with two symmetric
> tensors as unknowns, and encountering a number of errors with a
> MixedFunctionSpace consisting of two TensorFunctionSpaces with symmetry
> when assembling.
>
> I have written a short piece of code which creates the same error:
>
> What's going wrong here?

Looks like a bug in FFC. Try adding this to your code, somewhere at
the top:

parameters["form_compiler"]["representation"] = "quadrature"

--
Anders

-- 
You received this bug notification because you are a member of DOLFIN
Team, which is subscribed to DOLFIN.
https://bugs.launchpad.net/bugs/745646

Title:
  Problem with assemble() with MixedFunctionSpace of symmetric
  TensorFunctionSpaces

Status in DOLFIN:
  New

Bug description:
  from dolfin import *

  mesh = Rectangle(0,0,1,1,10,10)
  dim = 2 #assume 2D
  symm = dict(((i,j), (j,i))
              for i in range(dim) for j in range(dim) if i > j )

  T1 = TensorFunctionSpace(mesh, 'CG', 1, symmetry=symm)
  T2 = TensorFunctionSpace(mesh, 'CG', 1, symmetry=symm)

  TT = T1*T2

  R, S = TrialFunctions(TT)
  v_R, v_S = TestFunctions(TT)

  P = Function(T1)
  Q = Function(T2)

  Fr = inner(R,v_R)*dx+ inner(P,v_R)*dx

  Fs = inner( S, v_S )*dx + inner( Q, v_S )*dx

  F = Fr + Fs

  A = lhs(F)
  B = rhs(F)

  a = Matrix()
  a = assemble(A, tensor=a)
  b = Vector()
  b = assemble(B, tensor=b)

  I get the following error:

  Calling FFC just-in-time (JIT) compiler, this may take some time.
  Traceback (most recent call last):
    File "tensortest2.py", line 28, in <module>
      a = assemble(A, tensor=a)
    File "/usr/lib/python2.6/dist-packages/dolfin/fem/assemble.py", line 100, in assemble
      common_cell=common_cell)
    File "/usr/lib/python2.6/dist-packages/dolfin/fem/form.py", line 34, in __init__
      (self._compiled_form, module, self.form_data) = jit(form, form_compiler_parameters, common_cell)
    File "/usr/lib/python2.6/dist-packages/dolfin/compilemodules/jit.py", line 47, in mpi_jit
      return local_jit(*args, **kwargs)
    File "/usr/lib/python2.6/dist-packages/dolfin/compilemodules/jit.py", line 114, in jit
      return jit_compile(form, parameters=p, common_cell=common_cell)
    File "/usr/lib/python2.6/dist-packages/ffc/jitcompiler.py", line 64, in jit
      return jit_form(object, parameters, common_cell)
    File "/usr/lib/python2.6/dist-packages/ffc/jitcompiler.py", line 122, in jit_form
      compile_form(preprocessed_form, prefix=jit_object.signature(), parameters=parameters)
    File "/usr/lib/python2.6/dist-packages/ffc/compiler.py", line 140, in compile_form
      ir = compute_ir(analysis, parameters)
    File "/usr/lib/python2.6/dist-packages/ffc/representation.py", line 66, in compute_ir
      irs = [_compute_integral_ir(f, i, parameters) for (i, f) in enumerate(forms)]
    File "/usr/lib/python2.6/dist-packages/ffc/representation.py", line 186, in _compute_integral_ir
      parameters)
    File "/usr/lib/python2.6/dist-packages/ffc/tensor/tensorrepresentation.py", line 59, in compute_integral_ir
      ir["AK"] = _compute_terms(monomial_form, None, None, domain_type, quadrature_degree)
    File "/usr/lib/python2.6/dist-packages/ffc/tensor/tensorrepresentation.py", line 98, in _compute_terms
      quadrature_degree)
    File "/usr/lib/python2.6/dist-packages/ffc/tensor/referencetensor.py", line 28, in __init__
      self.A0 = integrate(monomial, domain_type, facet0, facet1, quadrature_order)
    File "/usr/lib/python2.6/dist-packages/ffc/tensor/monomialintegration.py", line 50, in integrate
      psis = [_compute_psi(v, table, len(points), domain_type) for v in monomial.arguments]
    File "/usr/lib/python2.6/dist-packages/ffc/tensor/monomialintegration.py", line 169, in _compute_psi
      Psi[component][tuple(dlist)] = etable[dtuple][:, cindex[0].index_range[component], :]



References