Hi Lawrence, Thank you so much for posting the code you used. I made an error by not initialising the solution function, and instead, I defined the trial function as the function itself. Thanks again. David
On 17 Dec 2015, at 16:13, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:
Hi David,
On 17/12/15 14:51, Angwenyi David wrote: ...
AttributeError: 'CoordinatelessFunction' object has no attribute '_M'
Hmm, the following works for me:
from firedrake import * m = IcosahedralSphereMesh(radius=3, refinement_level=3) mesh = ExtrudedMesh(m, 5, layer_height=0.1, extrusion_type='radial') horiz_elt = FiniteElement("CG", triangle, 1) vert_elt = FiniteElement("CG", interval, 1) elt = OuterProductElement(horiz_elt, vert_elt) V = FunctionSpace(mesh, elt) u = TrialFunction(V) v = TestFunction(V) f = Function(V) f.interpolate(Expression("(2*x[0])+(sin(3*x[1]))+(cos(0.5*x[2]))"))
a = (dot(grad(v), grad(u)) + v * u) * dx L = f * v * dx
u = Function(V) solve(a == L, u, solver_parameters={'ksp_type': 'cg'})
which I copy-pasted from your first email except for the addition of the u = Function(V) line before the solve.
If things still don't work for you, can you please report a github issue (at github.com/firedrakeproject/firedrake) with some code that we can run to reproduce it?
Thanks,
Lawrence
_______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake