← Back to team overview

dolfin team mailing list archive

Re: DOLFIN_PI

 

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'.

Johan

> --
> Anders
> 
> > > Garth
> > > _______________________________________________
> > > DOLFIN-dev mailing list
> > > DOLFIN-dev@xxxxxxxxxx
> > > http://www.fenics.org/mailman/listinfo/dolfin-dev
> >
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/dolfin-dev
> 


Follow ups

References