dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #13501
Re: About the code for python wrapper / writing a tcl wrapper
On Tuesday 12 May 2009 16:19:14 Kent Andre wrote:
> On ti., 2009-05-12 at 11:13 -0300, Maurício wrote:
> > Hi,
> >
> > I see in the source code that you use swig to write the interface
> > to python. Is all the code necessary to write that interface
> > inside the 'swig' directory?
>
> yes
>
> > If so, do you think I could have problems writing an interface
> > to tcl?
>
> there are some typemaps mapping arrays to numpy arrays. Otherwise
> I don't think there should be any problems. But it has been years
> since I used SWIG for anything but Python.
There are also some python specific stuff where we have extended the c++ proxy
classes. Look for %extend in for example dolfin_la_post.i. Here you also will
se quite a lot of %pythoncode which includes, ehhh, python code.
I think this can be a quite tricky task. If you deside to go into it I would
suggest you to start with the dolfin.i and outcomment more or less
all %include dolfin_foo_{pre,post}.i files, and start there.
We also have pure python extension of dolfin laying in
site-packages/dolfin/*
which has nothing to do with swig, but gives users of PyDOLFIN a better user
interface.
> > I'm cloning the repository and would like to try that, but would
> > like to know from you if there's a reason this would not work
> > before learning swig.
>
> have a go!
Indeed, but be prepared for some hassel!
Johan
References