On Monday May 30 2011 04:45:51 Torbjørn Bækø Ness wrote: > Question #157319 on DOLFIN changed: > https://answers.launchpad.net/dolfin/+question/157319 > > Torbjørn Bækø Ness posted a new comment: > Nevermind. I fixed it by exchanging > > MeshFunction<double>* c00; > MeshFunction<double>* c11; > MeshFunction<double>* c22; > > with > boost::shared_ptr<MeshFunction<double> > c00; > boost::shared_ptr<MeshFunction<double> > c11; > boost::shared_ptr<MeshFunction<double> > c22; > > Not that I know why it matters :-)
Because SWIG, which generates the Python wrappers for DOLFIN now treats all MeshFunctions<Foo> as boost::shared_ptr<MeshFunction<Foo> >. For method and function arguments typemaps are created (they more or less just grab the raw pointer and passes that instead of the shared_ptr version), but for public attributes such as the MeshFunctions above there are no such typemaps. Therefor you need to tell SWIG that you want the shared_ptr version. Johan _______________________________________________ Mailing list: https://launchpad.net/~dolfin Post to : dolfin@lists.launchpad.net Unsubscribe : https://launchpad.net/~dolfin More help : https://help.launchpad.net/ListHelp