← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Fix handling of Constants in Python?interface to avoid repeated JIT compilation.

 

On Wed, Oct 28, 2009 at 06:36:24PM +0100, Johan Hake wrote:
> On Wednesday 28 October 2009 16:46:41 Anders Logg wrote:
> > On Wed, Oct 28, 2009 at 04:44:48PM +0100, DOLFIN wrote:
> > > One or more new changesets pushed to the primary dolfin repository.
> > > A short summary of the last three changesets is included below.
> > >
> > > changeset:   7402:05610eef6540
> > > tag:         tip
> > > user:        Anders Logg <logg@xxxxxxxxx>
> > > date:        Wed Oct 28 16:43:02 2009 +0100
> > > files:       ChangeLog site-packages/dolfin/constant.py
> > > description:
> > > Fix handling of Constants in Python interface to avoid repeated JIT
> > > compilation.
> >
> > This should take care of avoiding recompilation for example when
> > changing the time step.
> >
> > I didn't know how to make an appropriate typemap so I needed to make
> > an ugly fix. Johan might want to look at it some point.
>
> There is already a typemap for the shape (std::vector<uint>), I suppose you
> ask for a typemap for values: std::vector<double>. Then I also suppose we can
> hand all information to the cpp layer through the tensor constructor?
>
> I add the typemap for the values then you can change the Constant if you like.

Thanks. It seems to work. I still needed a little fix in the Python
code, the function _to_double() to allow sending in a list of ints.

Not sure if this should go into the typemaps or if the current
solution is ok.

--
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups

References