gmarkall / manycore_form_compiler

MCFC is deprecated. See https://code.launchpad.net/~grm08/ffc/pyop2
https://code.launchpad.net/~grm08/ffc/pyop2
GNU General Public License v3.0
3 stars 1 forks source link

Check that the field solved for is written back to state #8

Open kynan opened 13 years ago

kynan commented 13 years ago

When we have a UFL equation for a field Tracer we need to make sure

Suppose we have UFL input like this

t = state.scalar_fields["Tracer"]


v = TestFunction(t.element)

f = Coefficient(t.element)



A = dot(grad(v),grad(u))*dx

RHS = v*f*dx



state.scalar_fields["Tracer"]=solve(A, RHS)


we need to check that there is an assignment to state.scalar_fields["Tracer"] but not to any other field in state

gmarkall commented 13 years ago

I'm not sure I understand this issue - isn't this what happens anyway? For example, in the euler-advection.ufl test case, only the Tracer field is returned to the host, not the velocity.

gmarkall commented 13 years ago

Having started to read https://github.com/gmarkall/manycore_form_compiler/wiki/UFL-equations-for-Fluidity-fields , I now see that this applies to the UFL code for solving for a particular field in an flml, and is not a general code-generation issue where we were returning the wrong things back to state.

gmarkall commented 13 years ago

I think i see another issue with this. In tests/inputs/shallow-water.ufl, the final three lines are something like:

(Vnew, Hnew) = split(solve(A,RHS)
state.scalar_fields["Height"] = Hnew
state.scalar_fields["Velocity"] = Vnew

This is done because the pressure and velocity are coupled in this method - how does this fit into the idea that we have to check what the UFL returns when it is the code for a given field?

kynan commented 13 years ago

Good point, I hadn't thought of this case. Presumably, coupled fields will give us more headaches than this. However, I would assume that in the flml file for the shallow water model it would be indicated that these fields are coupled.

gmarkall commented 12 years ago

I'm not sure this is a valid issue, since we stalled the discussion 10 months ago after mentioning that this isn't that straightforward for coupled fields, and I don't think this is much of an important thing to check for anyway. Shall we close it?