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

UFL state should contain Coefficients rather than FiniteElements #6

Closed gmarkall closed 13 years ago

gmarkall commented 13 years ago

Change semantics of state.scalar_fields[] etc. to return a coefficient instead of an element. If you want the element, use T.element() (where T is the field from state) instead. That way, you can use T in a form.

kynan commented 13 years ago

I see a potential problem here:

Have I got this right?

gmarkall commented 13 years ago

I think the idea is that it should be used like this (for a Poisson's equation example):

F = state.scalar_fields["SourceTerm"] # T is a Coefficient instance E = F.element() v = TestFunction(E) u = TrialFunction(E)

a = dot(grad(v),grad(u))_dx L = v_F*dx

soln = solve(a,L) state.scalar_fields["Solution"] = soln

I think this avoids the issue of whether it is a TrialFunction or a Coefficient, by explicitly getting the element of the field and using that to define Test and Trial Functions.