← Back to team overview

dolfin team mailing list archive

Re: Array<double> in SubDomain::inside()

 



On 09/03/10 17:57, Johan Hake wrote:
On Tuesday 09 March 2010 09:46:25 Garth N. Wells wrote:
On 09/03/10 16:02, Johan Hake wrote:
On Tuesday 09 March 2010 00:43:10 Garth N. Wells wrote:
Johan Hake wrote:
Hello!

I am trying to close the Array typemap Blueprint.

Is it worth changing the double* x/y arguments in SubDomain methods to
Array? The pros would be to have a consistent Python interface, but it
makes things more difficult in the C++ implementation.

What makes it difficult on the C++ side?

Well, difficult might not be the right word. My point was that we add
more lines in the C++ code to pass Array instead of double* than we
remove by making the python wrapper simpler.

We could maybe add an Array version of the different methods of
SubDomain

    inside, map, snap

Then can the double * version of the same methods call the Array
version by default. Then we only expose the Array version to Python.

I would prefer to have dolfin::Array versions only, if possible.

This is not a big deal as it is working fine as it is, but would be
good to get rid of most of the double * typemaps.

Yes. It would be good to remove all plain array arguments in the public
interface in favour of safer types.

Should we do this for the GenericFoo::{set,get,set_local} too?


We probably should. I think that we agreed on using more std::vector for this in the C++ side for safety, but Array will provide the safety and make the Python interface straightforward.

Ok, then I try to fix this. I assume we just change all double * to
Array?

Have you made a start on this on the C++ side? I can make the change for
SubDomain, but I don't want to get in your way.

I haven't, so please have a go!

Done, but not yet well tested.

Garth

Once the C++ stuff is in place, I can update
the Python part, if you have not got it to work. I think it is only to make
the director typemaps in array_typemap greedy (non argument specific).

Johan



References