← Back to team overview

dolfin team mailing list archive

[Question #135076]: assemble.py crashes with 'matrices not aligned' error

 

New question #135076 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/135076

A colleague of mine wrote some python code for a finite element project. It seems to run fine on his Mac, but I get the error below. I have been getting this error somewhat randomly at other times. Sometimes instant-clean will fix the problem, but not for everything. As is obvious from the traceback, this involves a lot of code that is not part of dolfin, but perhaps the error still makes sense?
I am running fenics under Ubuntu Maverick and installed it through a ppa repository.

Any help is appreciated.


ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (10, 0))

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

/home/martin/matlab/UAF-inverse/maxwell_inverse/python/experiments/plap_vs_ssa1d/invert_ssa1d_from_plap.py in <module>()
    164 params.forwardproblem.l2Weight = 1e-8
    165 params.forwardproblem.useH1=True # Use H1 norm for bed strength functions
--> 166 solver = InverseSolver(Vsurface,f,P,sigma,Bh,bcs=[bc],params=params)
    167 
    168 # Perform the inversion starting with initial guess gamma0


/home/martin/matlab/UAF-inverse/maxwell_inverse/python/inverseproblems/ssa1d.pyc in __init__(self, V, f, P, sigma, Bh, bcs, params)
    270     InvertIGN.__init__(self,params)
    271     self.V = V
--> 272     self.forward_problem = SSA1dForward(V,f,P,sigma,Bh,bcs=bcs,params=self.params.forwardproblem)
    273 
    274   def forwardProblem(self):

/home/martin/matlab/UAF-inverse/maxwell_inverse/python/inverseproblems/ssa1d.pyc in __init__(self, V, f, P, sigma, Bh, bcs, params)
     52         raise ValueError("Unsupported boundary condition")
     53 
---> 54     area = assemble(Constant(1)*dx,mesh=self.V.mesh())
     55     self.range_form = assemble(Constant(1/area)*self.uu*self.vv*dx)
     56     if self.params.useH1:

/usr/lib/python2.6/dist-packages/dolfin/fem/assemble.pyc in assemble(form, tensor, mesh, coefficients, function_spaces, cell_domains, exterior_facet_domains, interior_facet_domains, reset_sparsity, add_values, backend, form_compiler_parameters)
     98                        coefficients=coefficients,
     99                        form_compiler_parameters=form_compiler_parameters,
--> 100                        common_cell=common_cell)
    101 
    102     # Set mesh if specified (important for functionals without a function spaces)


/usr/lib/python2.6/dist-packages/dolfin/fem/form.pyc in __init__(self, form, function_spaces, coefficients, form_compiler_parameters, common_cell)
     32         # Compile form if necessary

     33         if not hasattr(form, "create_cell_integral"):
---> 34             (self._compiled_form, module, self.form_data) = jit(form, form_compiler_parameters, common_cell)
     35 
     36         else:

/usr/lib/python2.6/dist-packages/dolfin/compilemodules/jit.pyc 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/lib/python2.6/dist-packages/dolfin/compilemodules/jit.pyc in jit(form, form_compiler_parameters, common_cell)
    112         raise RuntimeError, "Form compiler must implement the jit function."
    113 
--> 114     return jit_compile(form, parameters=p, common_cell=common_cell)
    115 
    116 

/usr/lib/python2.6/dist-packages/ffc/jitcompiler.pyc in jit(object, parameters, common_cell)
     62         return jit_element(object, parameters)
     63     else:
---> 64         return jit_form(object, parameters, common_cell)
     65 
     66 def jit_form(form, parameters=None, common_cell=None):

/usr/lib/python2.6/dist-packages/ffc/jitcompiler.pyc in jit_form(form, parameters, common_cell)
    120 
    121     # Generate code

--> 122     compile_form(preprocessed_form, prefix=jit_object.signature(), parameters=parameters)
    123 
    124     # Build module using Instant (through UFC)


/usr/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/lib/python2.6/dist-packages/ffc/representation.pyc in compute_ir(analysis, parameters)
     56     # Compute representation of elements

     57     info("Computing representation of %d elements" % len(elements))
---> 58     ir_elements = [_compute_element_ir(e, i, element_map) for (i, e) in enumerate(elements)]
     59 
     60     # Compute representation of dofmaps


/usr/lib/python2.6/dist-packages/ffc/representation.pyc in _compute_element_ir(ufl_element, element_id, element_map)
     93     ir["evaluate_basis"] = _evaluate_basis(element, cell)
     94     ir["evaluate_dof"] = _evaluate_dof(element, cell)
---> 95     ir["interpolate_vertex_values"] = _interpolate_vertex_values(element, cell)
     96     ir["num_sub_elements"] = ufl_element.num_sub_elements()
     97     ir["create_sub_element"] = _create_sub_foo(ufl_element, element_map)

/usr/lib/python2.6/dist-packages/ffc/representation.pyc in _interpolate_vertex_values(element, cell)
    428                            "mapping": e.mapping()[0],
    429                            "space_dim": e.space_dimension()}
--> 430                           for e in all_elements(element)]
    431     return ir
    432 

/usr/lib/python2.6/dist-packages/FIAT/finite_element.pyc in tabulate(self, order, points)
    106         """Return tabulated values of derivatives up to given order of
    107         basis functions at given points."""
--> 108         return self.poly_set.tabulate(points, order)
    109 
    110     def value_shape(self):

/usr/lib/python2.6/dist-packages/FIAT/polynomial_set.pyc in tabulate(self, pts, jet_order)
     65         """Returns the values of the polynomial set."""
     66         result = {}
---> 67         base_vals = self.expansion_set.tabulate( self.embedded_degree , pts )
     68         for i in range( jet_order + 1 ):
     69             alphas = mis( self.ref_el.get_spatial_dimension() , i )

/usr/lib/python2.6/dist-packages/FIAT/expansions.pyc in tabulate(self, n, pts)
    100             return numpy.array( [] )
    101 
--> 102         ref_pts = [ self.mapping( pt ) for pt in pts ]
    103 
    104         def idx(p,q):

/usr/lib/python2.6/dist-packages/FIAT/expansions.pyc in <lambda>(x)
     90         v2 = self.base_ref_el.get_vertices()
     91         self.A,self.b = reference_element.make_affine_mapping( v1 , v2 )
---> 92         self.mapping = lambda x: numpy.dot( self.A , x ) + self.b
     93 #        self.scale = numpy.sqrt( numpy.linalg.det( self.A ) )

     94 

ValueError: matrices are not aligned


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