← Back to team overview

dolfin team mailing list archive

Re: [Branch ~dolfin-core/dolfin/main] Rev 4990: Allow setting constant values for boundary conditions without using Constant.

 

On Mon, Aug 16, 2010 at 11:09:06AM +0100, Garth N. Wells wrote:
> On Mon, 2010-08-16 at 10:03 +0000, noreply@xxxxxxxxxxxxx wrote:
> > ------------------------------------------------------------
> > revno: 4990
> > committer: Anders Logg <logg@xxxxxxxxx>
> > branch nick: dolfin-dev
> > timestamp: Mon 2010-08-16 12:00:01 +0200
> > message:
> >   Allow setting constant values for boundary conditions without using Constant.
> >   The following are equivalent:
> >
> >     c = Constant(foo)
> >     bc = DirichletBC(V, c, boundary)
> >
> >     bc = DirichletBC(V, foo, boundary)
> > modified:
> >   demo/pde/poisson/python/demo.py
> >   site-packages/dolfin/fem/bcs.py
> >
>
> I've been meaning to do this for a while on the C++ side. Shouldn't it
> be implemented in DirichetBC/.h/.cpp (some extra constructors)?

The Python version of Constant (implemented in constant.py) does some
tricks to convert input arguments to floats/arrays so I wanted to use
that.

But it would be nice to implement it in C++ too (separately), although
I'm not sure what the best way is (if there's an alternative to
implementing a bunch of extra constructors).

--
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups

References