← Back to team overview

dolfin team mailing list archive

Re: Parameters for JIT-compiled functions

 

On Wed, Jan 21, 2009 at 8:08 PM, Johan Hake <hake@xxxxxxxxx> wrote:

> On Wednesday 21 January 2009 15:33:37 Ola Skavhaug wrote:
> > On Wed, Jan 21, 2009 at 2:27 PM, Johan Hake <hake@xxxxxxxxx> wrote:
> > > On Wednesday 21 January 2009 00:40:02 Ola Skavhaug wrote:
> > > > This might be a swig bug. There used to be a problem related to the
> > > > way swig resolved new-style classes in the proxy layer. I tracked it
> > > > down once but could not fix it.
> > >
> > > Ok, you can be right here, but why did it work before the shared_ptr
> > > upgrade?
> >
> > Did you upgrade swig as well?
>
> I am running swig from svn ;)
>
> But I think I have found the bug! There was a bug in the automatic code
> generation wich will soon be fixed, _and_ this is probably the most
> crucial,
> I had to turn off optimization of swig generated code(!?).


Yes, the bug in swig that I talked about only appears when running swig with
the -O option to produce more efficient wrapper code.


>
>
> The problem is that I can't reproduce the error using a small test case. If
> I
> could I could commit a bug report.
>
> What ever it should work soon.
>
> Johan
>
> > Ola
> >
> > > Johan
> > >
> > > > Ola
> > > >
> > > > 2009/1/20, Johan Hake <hake@xxxxxxxxx>:
> > > > > 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
> > > > > DOLFIN-dev@xxxxxxxxxx
> > > > > http://www.fenics.org/mailman/listinfo/dolfin-dev<
> https://www.fenics.
> > > > >org/mailman/listinfo/dolfin-dev>
>
>
>


-- 
Ola Skavhaug

References