← Back to team overview

dolfin team mailing list archive

Further work on python interface

 

Hello.

I have added a function for compilation of single function, based on Martins 
previous work. It is now coupled to the Function class and should work. See 
poisson demo.

I got trouble with the dolfin::pow function that is defined for 
pow(double,uint) and pow(double,double). When we define a c++ function 
pow(x[0]-0.5,2) we get an ambigous overloading that do not compile, see e.g. 
in the poisson demo. 

I have fixed it with a hack in compile_function, by adding 'std::' infront of 
every pow statement. Any other way to solve it?

Next on the list whould be the assemble.py file. Here I think we need to do 
some work in the c++ interface. The Assembler.assemble function we previously 
used took an ufc::form, now we need to send in a dolfin::Form. This cannot be 
instantiated as dolfin::Form is an abstract base class.

We also need to make Data more attractive to python. The simple_array wrapping 
of x and v during function calls need to be reimplemented, or something 
similare.

Now the test and trial functions are only ffc functions. If we, as also 
previously discussed, let a dolfin.BaseFunction inherit ffc.BaseFunction, we 
could easier instantiate the dolfin::Form during assembly. What was the 
issues with this Martin?

Johan


Follow ups