dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #08606
Re: Parameter
On Wed, Jul 09, 2008 at 12:03:08PM +0200, Ola Skavhaug wrote:
> Anders Logg skrev den 09/07-2008 følgende:
> > On Tue, Jul 08, 2008 at 10:07:10PM +0200, Ola Skavhaug wrote:
> > > Anders Logg skrev den 08/07-2008 følgende:
> > > > On Tue, Jul 08, 2008 at 09:35:15AM +0200, Ola Skavhaug wrote:
> > > > > Could we add a default constructor to Parameter, e.g., letting it default to
> > > > > int or similar? This will make it possible to wrap it with SWIG. The current
> > > > > state of SWIG will declare variables like this (depending on where
> > > > > Parameter lives in the argument list):
> > > > >
> > > > > Parameter arg3;
> > > > >
> > > > > This fails due to the lack of default constructor for Parameter. I don't know
> > > > > how to get around this silly SWIG behaviour.
> > > > >
> > > > > Ola
> > > >
> > > > We could add a default constructor for an int parameter named
> > > > "undefined" with value 0 or similar. Parameter is never used directly
> > > > by a user anyway (since it will be cast automatically to the
> > > > underlying type).
> > >
> > > I don't see how naming the parameter "undefined" would help, since 0 should be
> > > a valid interger option. Except from that, I follow.
> >
> > I'm just saying if there's a default constructor, then there must be a
> > default name for that Parameter. We need to pick something, like
> > "undefined" or "none".
>
> I still don't get it. The constructors of Parameter does not take a name, only
> value:
>
> /// Create int-valued parameter
> Parameter(int value);
>
> /// Create int-valued parameter
> Parameter(uint value);
>
> /// Create real-valued parameter
> Parameter(real value);
>
> /// Create bool-valued parameter
> Parameter(bool value);
>
> /// Create string-valued parameter
> Parameter(std::string value);
>
> /// Create string-valued parameter
> Parameter(const char* value);
>
>
> Where does the name of the Parameter come into play?
>
> Ola
Aha! Good. I forgot that the parameter name is not tied to the
Parameter. The parameter name is stored as a key in the ParameterList
"dictionary" so no need to specify anything for the name.
--
Anders
Attachment:
signature.asc
Description: Digital signature
References