firedrakeproject / firedrake

Firedrake is an automated system for the portable solution of partial differential equations using the finite element method (FEM)
https://firedrakeproject.org
Other
513 stars 160 forks source link

Allow assembly over `VertexOnlyMesh` and its parent mesh #2060

Open ReubenHill opened 3 years ago

ReubenHill commented 3 years ago

For E on a VertexOnlyMesh and R on its parent mesh, J = firedrake.assemble(E + R) does not work but J = firedrake.assemble(E) + firedrake.assemble(R) does

wence- commented 3 years ago

What are E and R in this context?

ReubenHill commented 3 years ago

Assemble-able expressions on suitable function spaces on the two meshes where, typically, the expression E contains an expression for interpolation from the parent mesh function space onto the VertexOnlyMesh function space.

Come to think of it, this might not make sense if everything inside an assemble should be an integral with the same domain and measure (they aren't here - one is the integral over the VertexOnlyMesh, the other the integral over the parent mesh).

Nevertheless, the fact that you can't do this is, according to @dham , a bug on my part.

danshapero commented 3 years ago

We probably discussed this at some point -- what are the arguments for why this is a bug? Granted it's nice to be able to write assemble(E + R) when the summands might be defined on two distinct domains. But you can still do everything you need to do (evaluate that functional, calculate derivatives, solve PDE-constrained optimization problems) by writing assemble(E) + assemble(R).