← Back to team overview

dolfin team mailing list archive

Re: Problem with Array typemape

 

On Wed, Aug 11, 2010 at 01:13:41PM -0700, Johan Hake wrote:
> On Wednesday August 11 2010 10:58:21 Anders Logg wrote:
> > Thanks! It works now.
> >
> > Yes, the copying is absolutely no problem here.
> >
> > Should we differentiate between return by value (Array) and return by
> > reference (Array&)?
> >
> > In the present case, we have return by value so then it should
> > naturally be copied, but perhaps there are other cases where we want
> > return by reference?
>
> I think we should avoid wrapping return values that are by reference. If it
> was just the Array, it might turn out good. But the point is that we wrap the
> Array into a NumPy array.
>
> It might not be any troubles but I think we do not have it for a reason...

I don't see a pressing need for it either. There are a few places
where we do this, but those are special cases like
mesh.coordinates(). Perhaps it's best to keep it that way.

--
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups

References