← Back to team overview

dolfin team mailing list archive

Re: DOLFIN_PI

 

On Fri, Oct 16, 2009 at 08:06:28PM +0200, Johan Hake wrote:
> On Friday 16 October 2009 18:05:06 Anders Logg wrote:
> > On Fri, Oct 16, 2009 at 03:12:41PM +0100, Garth N. Wells wrote:
> > > Garth N. Wells wrote:
> > > > Can we expose DOLFIN_PI when generating code via JIT for an Expression?
> > >
> > > Is there some Python magic going on because
> > >
> > >   u = Expression("pi", V = V)
> > >
> > > compiles but
> > >
> > >    u = Expression("DOLFIN_PI", V = V)
> > >
> > > doesn't.
> > >
> > > Garth
> >
> > You don't need to expose DOLFIN_PI since pi is already defined in the
> > generated code, I've used it a lot (but don't know where it comes
> > from).
>
> Actually this is in the generated code:
>
>   const pi = DOLFIN_PI;
>
> When you use "DOLFIN_PI" in your expression it generates a public variable
> DOLFIN_PI and initiate it to 0.0. But DOLFIN_PI is already defined and an
> error is issued.
>
> This is of course not nice. Should we let DOLFIN_PI and DOLFIN_EPS be
> available for users in the eval string, that is to say we do not treat them as
> public variables. I still think we expose 'pi'.

That would be nice, and also to keep pi.

--
Anders

Attachment: signature.asc
Description: Digital signature


References