← Back to team overview

dolfin team mailing list archive

Re: [Branch ~dolfin-core/dolfin/main] Rev 4787: Add attempt at a SWIG std::pair typemap. Not working.

 

On Wednesday June 2 2010 10:12:01 Garth N. Wells wrote:
> On 02/06/10 18:08, Johan Hake wrote:
> > You are almost there!
> > 
> > You just need to use some Python C-Api functions together with some swig
> > macros to convert the python objects to C++ equivalents. The Float is
> > straight forward, but the dolfin::Function is not... You can look at the
> > nasty typemap in std_vector.i to get some hints.
> 
> I can't quite get Float to work, so help would be greatly appreciated!

Sure I can have a look at it, but:

  PyFloat_Check and PyFloat_AsDouble

would be enough to convert from Float to double. 

Johan
 
> Garth
> 
> > I can take a look at it.
> > 
> > Johan
> > 
> > On Wednesday June 2 2010 09:20:29 noreply@xxxxxxxxxxxxx wrote:
> >> ------------------------------------------------------------
> >> revno: 4787
> >> committer: Garth N. Wells<gnw20@xxxxxxxxx>
> >> branch nick: dolfin-all
> >> timestamp: Wed 2010-06-02 17:18:13 +0100
> >> 
> >> message:
> >>    Add attempt at a SWIG std::pair typemap. Not working.
> >> 
> >> modified:
> >>    demo/pde/advection-diffusion/python/demo.py
> >>    dolfin/swig/typemaps.i
> >> 
> >> --
> >> lp:dolfin
> >> https://code.launchpad.net/~dolfin-core/dolfin/main
> >> 
> >> Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
> >> To unsubscribe from this branch go to
> >> https://code.launchpad.net/~dolfin-core/dolfin/main/+edit-subscription
> > 
> > _______________________________________________
> > Mailing list: https://launchpad.net/~dolfin
> > Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~dolfin
> > More help   : https://help.launchpad.net/ListHelp



References