On Tuesday 20 January 2009 17:33:27 Harish Narayanan wrote:
> I'm running into some problems setting parameters for JIT-compiled
> functions. Here are a couple of brief examples to demonstrate what I mean:
>
> 1. Works fine:
>
> from dolfin import *
>
> mesh = UnitSquare(2, 2)
> S = FunctionSpace(mesh, "CG", 1)
> s1 = Function(S, 'A*x[0]', {'A': 2.0})
> plot(s1)
> s1.A # 2.0 -- Correct
>
>
> 2. Doesn't set values for parameter 'A' and hence gives me zeroes
> everywhere:
>
> from dolfin import *
>
> mesh = UnitSquare(2, 2)
> S = FunctionSpace(mesh, "CG", 1)
> s2 = Function(S, 'A*x[0]')
> s2.A = 2.0
> plot(s2)
> s2.A # 0.0 -- Incorrect
>
>
> I think (2) used to work. Does anyone see an obvious problem?Yes this has worked perfectly well before the shared_ptr "upgrade". It seems like public attributes are not accessible from python anymore. I have encountered the same problem and I am quite frustrated about it. As with other things, I am on to it. I hope it is a solvable bug, but I havn't been able to get through yet. I have wrapped some simple example code that use shared_ptr, which just work, so I do see some light! Stay tuned. Johan _______________________________________________ DOLFIN-dev mailing list [email protected] http://www.fenics.org/mailman/listinfo/dolfin-dev
