Creation of very big Mixed Element

Hi,

I would like to create a mixed element. I am quite new to fenics, so the only way I know to accomplish this is the following:

P1 = FiniteElement('Lagrange', interval, 1)
element = MixedElement([P1, P1, P1])

However I need a very big mixed element (possibly hundreds of P1’s), so I can’t follow the previous method. Can someone help me figure out how to do it?

Thanks in advance,
Marco

You can simply use python list comprehension feature:

from dolfin import FiniteElement, interval, MixedElement, UnitIntervalMesh, FunctionSpace

P1 = FiniteElement('Lagrange', interval, 1)
elements = [P1 for _ in range(100)]
element = MixedElement(elements)
mesh = UnitIntervalMesh(10)
V = FunctionSpace(mesh, element)

However, could you explain in some detail why you need hundreds of P1 spaces?
What kind of problem are you trying to solve?

2 Likes

Thank you very much for your reply. I am trying to solve the following system:
form

Where A_\nu is solely a function of frequency.

My initial idea was to discretize the integral and solve the resulting sistem for every u_\nu and v. I can imagine this method can be computationally taxing, furthermore I also had some difficulties in imposing separately the very many boundary conditions. If you have a more intelligent method I am open to suggestions.
Thanks again