← Back to team overview

dolfin team mailing list archive

Re: Multi-type parameters?

 

On Wednesday July 6 2011 13:57:32 Anders Logg wrote:
> On Wed, Jul 06, 2011 at 10:05:34AM -0700, Johan Hake wrote:
> > On Wednesday July 6 2011 08:08:48 Garth N. Wells wrote:
> > > On 06/07/11 16:00, Johan Hake wrote:
> > > > On Jul 6, 2011, at 1:54, Anders Logg <logg@xxxxxxxxx> wrote:
> > > >> I'm thinking of how to handle this bug:
> > > >> 
> > > >> https://bugs.launchpad.net/ffc/+bug/787010
> > > >> 
> > > >> I see two solutions:
> > > >> 
> > > >> 1. Handle parameters with dynamical type in C++ (fairly easy to
> > > >> add).
> > > > 
> > > > Not sure I like this. It is nice to have a strongly typed regime
> > > > here.
> > > 
> > > We could store all parameters as strings and let the using perform any
> > > casts (boost::lexical_cast is good for this).
> > > 
> > > >> 2. Not use parameters that may change type in FFC (from "auto" to an
> > > >> int).
> > > > 
> > > > Is it possible to store the parameter As an int internally in FFC, -1
> > > > for auto, and then add logic to the parsing of this variable so
> > > > 'auto' becomes -1?
> 
> You mean from the command-line? Perhaps.

Yes.

Johan

> > > That should be fine, just not as pretty.
> > 
> > I do not care, I just think Parameter should be static wrt typing. If we
> > want to change that and introduce a set of new paramters that might be
> > fine. But it requires more work and I think it is overkill for this bug.
> 
> I think the best solution at this point is to avoid multi-type
> parameters in FFC. It should be possible to work around it. I'll try
> to find a good solution.
> 
> --
> Anders
> 
> > Johan
> > 
> > > Garth
> > > 
> > > > Did that make sense?
> > > > 
> > > > Johan
> > > > 
> > > > 
> > > > _______________________________________________
> > > > Mailing list: https://launchpad.net/~dolfin
> > > > Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> > > > Unsubscribe : https://launchpad.net/~dolfin
> > > > More help   : https://help.launchpad.net/ListHelp
> > > 
> > > _______________________________________________
> > > Mailing list: https://launchpad.net/~dolfin
> > > Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> > > Unsubscribe : https://launchpad.net/~dolfin
> > > More help   : https://help.launchpad.net/ListHelp
> > 
> > _______________________________________________
> > Mailing list: https://launchpad.net/~dolfin
> > Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~dolfin
> > More help   : https://help.launchpad.net/ListHelp


References