← Back to team overview

dolfin team mailing list archive

Re: STLVectorUInt in PyDOLFIN

 

On Wed, Mar 04, 2009 at 01:39:10PM +0100, Johan Hake wrote:
> On Wednesday 04 March 2009 13:34:17 Anders Logg wrote:
> > On Wed, Mar 04, 2009 at 01:28:10PM +0100, Johan Hake wrote:
> > > On Wednesday 04 March 2009 13:17:37 Garth N. Wells wrote:
> > > > When running demo/mesh/intersection/demo.py, I get
> > > >
> > > >      Traceback (most recent call last):
> > > >        File "demo.py", line 33, in <module>
> > > >          cells = STLVectorUInt()
> > > >      NameError: name 'STLVectorUInt' is not defined
> > > >
> > > > Any ideas?
> > >
> > > Should be fixed now
> >
> > How is the STL integration with Python lists? The optimal thing would
> > be if one could write
> >
> >   cells = omega0.intersection(boundary, False)
> >
> > instead of
> >
> >   cells = STLVectorUInt()
> >   omega0.intersection(boundary, cells, False)
> >
> > and cells would be a Python list.
> 
> Agree on this. 
> 
> Should be doable with the right typemaps.
> 
> I can fix it but not right now...

ok, nice.

> Is this the only place where we use STLVectorFoo?

Yes, at least in the demos. It (std::vector) appears in quite a few
places now in function calls in the C++ interface, but it's mostly
invisible from Python. For example, the Assembler uses this but it's
wrapped and handled from Python with standard Python lists or tuples.

> I feel that this type is a 
> bit too low level to be used in the python interface, and we should as you 
> suggest try to get rid of it.

Yes, it's a bit ugly.

-- 
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups

References