← Back to team overview

dolfin team mailing list archive

Re: [Question #153352]: project grad f to a VectorFunctionSpace

 

Question #153352 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/153352

    Status: Open => Answered

Anders Logg proposed the following answer:
On Mon, Apr 18, 2011 at 08:26:56PM -0000, Chaffra wrote:
> Question #153352 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/153352
>
>     Status: Answered => Open
>
> Chaffra is still having a problem:
> I tried that and I get this error. The error does not show up for 2D or
> 3D but for 1D it does. Thanks for you answer. Chaffra
>
> Calling FFC just-in-time (JIT) compiler, this may take some time.
> ---------------------------------------------------------------------------
> IndexError                                Traceback (most recent call last)
>
> /home/chaffra/Projects/Fenics/Semifem/test/znse_gaas_junction.py in <module>()
> ----> 1
>       2
>       3
>       4
>       5
>
> /usr/local/lib/python2.6/dist-packages/dolfin/function/functionspace.py in __init__(self, mesh, family, degree, dim, restriction)
>     322
>     323         # Initialize base class
>
> --> 324         MixedFunctionSpace.__init__(self, spaces)
>     325
>     326 # FIXME: Add this class:
>
>
> /usr/local/lib/python2.6/dist-packages/dolfin/function/functionspace.py in __init__(self, spaces)
>     298
>     299         # Initialize base class
>
> --> 300         FunctionSpaceBase.__init__(self, spaces[0].mesh(), element)
>     301
>     302 class VectorFunctionSpace(MixedFunctionSpace):
>
> /usr/local/lib/python2.6/dist-packages/dolfin/function/functionspace.py in __init__(self, mesh, element)
>      42
>      43         # JIT-compile element to get ufc_element and ufc_dofmap
>
> ---> 44         ufc_element, ufc_dofmap = jit(self._ufl_element)
>      45
>      46         # Instantiate DOLFIN FiniteElement and DofMap
>
>
> /usr/local/lib/python2.6/dist-packages/dolfin/compilemodules/jit.py in mpi_jit(*args, **kwargs)
>      45         # Just call JIT compiler when running in serial
>
>      46         if MPI.num_processes() == 1:
> ---> 47             return local_jit(*args, **kwargs)
>      48
>      49         # Compile first on process 0
>
>
> /usr/local/lib/python2.6/dist-packages/dolfin/compilemodules/jit.py in jit(form, form_compiler_parameters, common_cell)
>     122         raise RuntimeError, "Form compiler must implement the jit function."
>     123
> --> 124     return jit_compile(form, parameters=p, common_cell=common_cell)
>     125
>     126
>
> /usr/local/lib/python2.6/dist-packages/ffc/jitcompiler.pyc in jit(object, parameters, common_cell)
>      61     # Check if we get an element or a form
>
>      62     if isinstance(object, FiniteElementBase):
> ---> 63         return jit_element(object, parameters)
>      64     else:
>      65         return jit_form(object, parameters, common_cell)
>
> /usr/local/lib/python2.6/dist-packages/ffc/jitcompiler.pyc in jit_element(element, parameters)
>     186
>     187     # Compile form
>
> --> 188     (compiled_form, module, form_data) = jit_form(form, parameters)
>     189
>     190     # Pop cache for element form. Otherwise it might interfere with DOLFIN forms
>
>
> /usr/local/lib/python2.6/dist-packages/ffc/jitcompiler.pyc in jit_form(form, parameters, common_cell)
>     131
>     132         # Generate code
>
> --> 133         compile_form(preprocessed_form, prefix=jit_object.signature(), parameters=parameters)
>     134
>     135         # Build module using Instant (through UFC)
>
>
> /usr/local/lib/python2.6/dist-packages/ffc/compiler.pyc in compile_form(forms, object_names, prefix, parameters)
>     138     # Stage 2: intermediate representation
>
>     139     cpu_time = time()
> --> 140     ir = compute_ir(analysis, parameters)
>     141     _print_timing(2, time() - cpu_time)
>     142
>
> /usr/local/lib/python2.6/dist-packages/ffc/representation.pyc in compute_ir(analysis, parameters)
>      64     # Compute and flatten representation of integrals
>
>      65     info("Computing representation of integrals")
> ---> 66     irs = [_compute_integral_ir(f, i, parameters) for (i, f) in enumerate(forms)]
>      67     ir_integrals = [ir for ir in chain(*irs) if not ir is None]
>      68
>
> /usr/local/lib/python2.6/dist-packages/ffc/representation.pyc in _compute_integral_ir(form, form_id, parameters)
>     184                                    form.form_data(),
>     185                                    form_id,
> --> 186                                    parameters)
>     187
>     188         # Append representation
>
>
> /usr/local/lib/python2.6/dist-packages/ffc/tensor/tensorrepresentation.pyc in compute_integral_ir(domain_type, domain_id, integrals, metadata, form_data, form_id, parameters)
>      57
>      58         # Compute sum of tensor representations
>
> ---> 59         ir["AK"] = _compute_terms(monomial_form, None, None, domain_type, quadrature_degree)
>      60
>      61     elif domain_type == "exterior_facet":
>
> /usr/local/lib/python2.6/dist-packages/ffc/tensor/tensorrepresentation.pyc in _compute_terms(monomial_form, facet0, facet1, domain_type, quadrature_degree)
>      96                                  domain_type,
>      97                                  facet0, facet1,
> ---> 98                                  quadrature_degree)
>      99
>     100             # Compute geometry tensor
>
>
> /usr/local/lib/python2.6/dist-packages/ffc/tensor/referencetensor.pyc in __init__(self, monomial, domain_type, facet0, facet1, quadrature_order)
>      26
>      27         # Compute reference tensor
>
> ---> 28         self.A0 = integrate(monomial, domain_type, facet0, facet1, quadrature_order)
>      29
>      30         # Extract indices
>
>
> /usr/local/lib/python2.6/dist-packages/ffc/tensor/monomialintegration.pyc in integrate(monomial, domain_type, facet0, facet1, quadrature_degree)
>      48
>      49     # Compute table Psi for each factor
>
> ---> 50     psis = [_compute_psi(v, table, len(points), domain_type) for v in monomial.arguments]
>      51
>      52     # Compute product of all Psis
>
>
> /usr/local/lib/python2.6/dist-packages/ffc/tensor/monomialintegration.pyc in _compute_psi(v, table, num_points, domain_type)
>     167                 dtuple = _multiindex_to_tuple(dlist, cell_dimension)
>     168                 # Get values from table
>
> --> 169                 Psi[component][tuple(dlist)] = etable[dtuple][:, cindex[0].index_range[component], :]
>     170     else:
>     171         etable = table[(v.element, v.restriction)]
>
> IndexError: too many indices

Could be a bug in FFC. I will have to dig deeper to see what the cause
is.

--
Anders

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.