matrices are not aligned error

Asked by jhameed2@illinois.edu

Hello,

I am trying to compile the following ufl code:

vecElement = FiniteElement("Raviart-Thomas", tetrahedron, 0)
scalElement = FiniteElement("Lagrange", tetrahedron, 1)

mixed_element = vecElement + scalElement

(r, v) = TestFunctions(mixed_element)
(q, u) = TrialFunctions(mixed_element)

a = dot(q,r)*dx + u*v*dx
L = v*dx

However, I get the following error:

Compiler stage 2: Computing intermediate representation
-------------------------------------------------------
  Computing representation of 3 elements

*** FFC: matrices are not aligned

This worked in dolfin 0.9.4. Now I am trying to compile it with dolfin 0.9.7. Any ideas whats wrong?

Thanks,
-Jehanzeb

Question information

Language:
English Edit question
Status:
Solved
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Solved by:
jhameed2@illinois.edu
Solved:
Last query:
Last reply:
Revision history for this message
Kristian B. Ølgaard (k.b.oelgaard) said :
#1

On 26 July 2010 22:10, <email address hidden>
<email address hidden> wrote:
> New question #119047 on FEniCS Project:
> https://answers.launchpad.net/fenics/+question/119047
>
> Hello,
>
> I am trying to compile the following ufl code:

Then I don't understand what you mean about 'dolfin 0.9.4' or dolfin
0.9.7, since ufl form files are compiled with FFC or SFC.
Anyway, there has been some syntax changes, for the development
version of FFC (and I'm sure it will be the same thing in ffc 0.9.3)
you will have to do:

> vecElement = FiniteElement("Raviart-Thomas", tetrahedron, 0)

vecElement = FiniteElement("Raviart-Thomas", tetrahedron, 1)

There was a change in definition of the degree of RT elements (and I
think Nedelec elements too) so now 1 is the only supported degree.

> scalElement = FiniteElement("Lagrange", tetrahedron, 1)
>
> mixed_element = vecElement + scalElement

mixed_element = vecElement * scalElement

For mixed elements use ' * ', ' + ' will create an enriched element
which is something else.

Kristian

> (r, v) = TestFunctions(mixed_element)
> (q, u) = TrialFunctions(mixed_element)
>
> a =  dot(q,r)*dx  + u*v*dx
> L =  v*dx
>
> However, I get the following error:
>
> Compiler stage 2: Computing intermediate representation
> -------------------------------------------------------
>  Computing representation of 3 elements
>
> *** FFC: matrices are not aligned
>
> This worked in dolfin 0.9.4. Now  I am trying to compile it with dolfin 0.9.7. Any ideas whats wrong?
>
> Thanks,
> -Jehanzeb
>
> --
> You received this question notification because you are a member of
> FEniCS Team, which is an answer contact for FEniCS Project.
>

Revision history for this message
jhameed2@illinois.edu (jhameed2) said :
#2

> Then I don't understand what you mean about 'dolfin 0.9.4' or dolfin 0.9.7, since ufl form files are compiled with FFC or SFC.

I know that. By dolfin 0.9.4 or 0.9.7 I meant the ffc version that came with that particular dolfin version. Its easier for me to keep track of dolfin version, since I install it from ubuntu repository.

Thanks for pointing out that the definition of RT elements had changed. So, are the new RT1 = RT0 of old? I

> mixed_element = vecElement * scalElement
>For mixed elements use ' * ', ' + ' will create an enriched element which is something else.

This gives me the following error:
TypeError: unsupported operand type(s) for *: 'FiniteElement' and 'FiniteElement'

-Jehanzeb

Revision history for this message
Kristian B. Ølgaard (k.b.oelgaard) said :
#3

On 26 July 2010 22:37, <email address hidden>
<email address hidden> wrote:
> Question #119047 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/119047
>
>    Status: Answered => Open
>
> <email address hidden> is still having a problem:
>> Then I don't understand what you mean about 'dolfin 0.9.4' or dolfin
> 0.9.7, since ufl form files are compiled with FFC or SFC.
>
> I  know that. By dolfin 0.9.4 or 0.9.7 I meant the ffc version that came
> with that particular dolfin version. Its easier for me to keep track of
> dolfin version, since I install it from ubuntu repository.

OK.

> Thanks for pointing out that the definition of RT elements had changed.
> So, are the new RT1 = RT0 of old? I

Yes.

>> mixed_element = vecElement * scalElement
>>For mixed elements use ' * ', ' + ' will create an enriched element which is something else.
>
> This gives me the following error:
> TypeError: unsupported operand type(s) for *: 'FiniteElement' and 'FiniteElement'

The ChangeLog says that this change was not added until 07-2010, so
it's probably not in your 'dolfin' yet. So you should continue to use
' + ' until the next upgrade.

Kristian

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

Revision history for this message
jhameed2@illinois.edu (jhameed2) said :
#4

Thanks!

Revision history for this message
Marie Rognes (meg-simula) said :
#5

> Question #119047 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/119047

>>
>> vecElement = FiniteElement("Raviart-Thomas", tetrahedron, 0)
>
> vecElement = FiniteElement("Raviart-Thomas", tetrahedron, 1)
>
> There was a change in definition of the degree of RT elements (and I
> think Nedelec elements too) so now 1 is the only supported degree.

Yes, both the RTs and the Nedelecs start at 1 now. And just to avoid any
kind of misunderstanding: 1 is the lowest degree, not the only supported
degree.

--
Marie

Revision history for this message
Kristian B. Ølgaard (k.b.oelgaard) said :
#6

On 27 July 2010 12:30, Marie Rognes
<email address hidden> wrote:
> Question #119047 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/119047
>
> Marie Rognes posted a new comment:
>> Question #119047 on FEniCS Project changed:
>> https://answers.launchpad.net/fenics/+question/119047
>
>>>
>>> vecElement = FiniteElement("Raviart-Thomas", tetrahedron, 0)
>>
>> vecElement = FiniteElement("Raviart-Thomas", tetrahedron, 1)
>>
>> There was a change in definition of the degree of RT elements (and I
>> think Nedelec elements too) so now 1 is the only supported degree.
>
> Yes, both the RTs and the Nedelecs start at 1 now. And just to avoid any
> kind of misunderstanding: 1 is the lowest degree, not the only supported
> degree.

Yes, my bad I think I was thinking of the Crouzeix-Raviart element
(with degree range (1,1)).

Kristian

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