Dear Lawrence,

Thank you so much for the quick response.
So, the idea is to leave my code as it is and modify the following scripts according with the updates you made in the links:

ufl/algorithms/apply_function_pullbacks.py 
ufl/finiteelement/mixedelement.py
firedrake/functionspace.py

Is it right? Thanks a lot for your help.
Have a wonderful day.

Best regards,
Simone

On Tue, Jun 25, 2019 at 8:28 AM Lawrence Mitchell <wence@gmx.li> wrote:
Dear Simone,

> On 25 Jun 2019, at 14:12, Simone Puel <spuel@utexas.edu> wrote:
>
> Even though I use the approach similar to the mixed formulation in the online tutorial (Mixed formulation for the Poisson equation):
>
> BDM = VectorFunctionSpace(mesh, "BDM", 1)
> DGv = VectorFunctionSpace(mesh, "DG", 0)
> DGs = FunctionSpace(mesh, "DG", 0)
>
> Vh = BDM * DGv * DGs
>
[...]

(Matt's question was a bit of a distraction).

The problem here is that UFL applies a mapping from physical space to reference space before we perform numerical integration on the cell. Presently, UFL doesn't have the correct rules to do this for the

VectorFunctionSpace(mesh, "BDM", 1)

part.

I added these in a branch (you need changes in UFL and in Firedrake)

here:

https://github.com/firedrakeproject/ufl/pull/18

and here:

https://github.com/firedrakeproject/firedrake/pull/1466

I think if you use these branches (hopefully merged to master soon), then your model should work.

>
> On Tue, Jun 25, 2019 at 8:03 AM Simone Puel <spuel@utexas.edu> wrote:
> Dear Lawrence and Matt,
>
> Thank you so much for your emails. I am not sure I understood correctly. In my case BDM is used for the stress (tensor), DGv for displacement (vector) and DGs for rotation (vector).
> If I write something like this:
>
> BDM = TensorFunctionSpace(mesh, "BDM", 1)

Just as an aside, you probably (not sure) don't want to take a TensorFunctionSpace of a BDM element for mixed elasticity. Since BDM is intrinsically vector-valued, this gives you a rank-3 tensor for the stress, which I guess you don't want?

Thanks,

Lawrence


--
Simone Puel
Ph.D. student in Geological Sciences at the University of Texas at Austin
Jackson School of Geosciences & Institute for Geophysics (UTIG)
JGB 5.332 & ROC 2.116L
+1 (737)-230-6811