Thread Previous • Date Previous • Date Next • Thread Next |
Question #157319 on DOLFIN changed: https://answers.launchpad.net/dolfin/+question/157319 Johan Hake posted a new comment: 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 -- You received this question notification because you are a member of DOLFIN Team, which is an answer contact for DOLFIN.
Thread Previous • Date Previous • Date Next • Thread Next |