I have checked both functions with 

Z0.function_space()
Z1.function_space()

and both results give

WithGeometry(FunctionSpace(<firedrake.mesh.ExtrudedMeshTopology object at 0x10a31e510>, <R0 on a TensorProductCell(interval, interval)>, name=None), <Mesh #4>)

so I don’t understand why

Z0.assign(Z1)

doesn’t work. This is the full error:

Traceback (most recent call last):
  File "buoy-swe.py", line 146, in <module>
    (phi0, eta0, W0, Z0, mu0_5) = solvers_SV(F_solver, phi_solver1, W_solver1, eta0, phi0, Z0, W0, eta1, phi1, Z1, W1);
  File "/Users/matak/Documents/Simulations/Firedrake/Ship/Modules/Mixed system/solvers.py", line 95, in solvers_SV
    Z0.assign(Z1)
  File "<decorator-gen-271>", line 2, in assign
  File "/Users/matak/firedrake/src/firedrake/firedrake/utils.py", line 62, in wrapper
    return f(*args, **kwargs)
  File "/Users/matak/firedrake/src/firedrake/firedrake/function.py", line 356, in assign
    assemble_expressions.Assign(self, expr), subset)
  File "<decorator-gen-276>", line 2, in evaluate_expression
  File "/Users/matak/firedrake/src/firedrake/firedrake/utils.py", line 59, in wrapper
    return f(*args, **kwargs)
  File "/Users/matak/firedrake/src/firedrake/firedrake/assemble_expressions.py", line 573, in evaluate_expression
    for tree in ExpressionSplitter().split(expr):
  File "/Users/matak/firedrake/src/firedrake/firedrake/assemble_expressions.py", line 290, in split
    return [expr._ufl_expr_reconstruct_(*ops) for ops in zip(*map(self.visit, (lhs, rhs)))]
  File "/Users/matak/firedrake/src/ufl/ufl/algorithms/transformer.py", line 108, in visit
    r = h(o)
  File "/Users/matak/firedrake/src/firedrake/firedrake/assemble_expressions.py", line 329, in terminal
    raise ValueError("Mismatching function spaces")
ValueError: Mismatching function spaces

On 20 Mar 2017, at 10:20, Miklós Homolya <m.homolya14@imperial.ac.uk> wrote:

split(f) yields values (UFL expressions to be precise) which remember that they are coming from a mixed space.

f.split() yields gives Firedrake Functions which aren't aware of being part of a mixed function.


Both work inside UFL expressions.

Methods specific to Firedrake Functions will not work with split(f).

f.split() only works on functions, but not applicable to arguments, while split(f) works for both.



On 19/02/17 23:09, Anna Kalogirou wrote:
Dear all,

I am trying to solve a set of PDEs and ODEs together as a mixed system. The ODE variables only depend on time, so I define them as functions from the real function space R.

First question: Is this a correct approach?
I'm not sure. Cannot you just use Constants? Are these constant-in-space values among your solution variables? Are you doing adjoint stuff?


On 20/03/17 08:02, Anna Kalogirou wrote:
Might have something to do with the real function space?
Pass.
Is there a way to inspect (by printing something on screen) in which function space each function belongs to?
Sure, Z0.function_space()


_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake