octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fem-fenics] interpolate


From: Marco Vassallo
Subject: Re: [fem-fenics] interpolate
Date: Sat, 17 May 2014 09:40:31 +0200




On Sat, May 17, 2014 at 9:30 AM, Eugenio Gianniti <address@hidden> wrote:
Dear Marco,

I am writing the post on the blog as you asked me, but meanwhile I have some doubts I would like to discuss. With the first draft I just focused on obtaining something that compiled and could be used without crashing Octave, but now I am thinking of its meaning from the user’s point of view.

In the first place, having forced a method thought for an object oriented language into Octave, now the interface that interpolate offers is quite counter-intuitive. To address the issue I would make it similar to the interpolate function of the Python version, which gets as input a Function and a FunctionSpace. For the future I believe this to be the best approach, do you agree?

As a general rule: Yes, in fact I think that the Fenics C++ interface is not very used. The python interface is instead much more comprehensible and used by a lot of users. I think that it is definitely a good idea to follow the Python version.
For this particular case, I think that also the option of having two functions as argument is not bad. 
Once that we are sure that your code works fine, we can easily extend it in such a way that it works either with two functions and also with a function and a functionspace. It should be enough to make a check of the type of the input parameter.

Marco
 

As a second point, dolfin takes as argument the dolfin::GenericFunction class, which is the base class dolfin::Function and dolfin::_expression_ derive from. Is there a way to check if an Octave value is in this hierarchy other than performing each check by hand? My first idea would be to create a small C++ function to do so, with calls such as
args(0).type_id () == function::static_type_id ()
and the one for coefficient, then it returns true if it finds one of the two. Anyway I would think that in Octave there is already something doing this job, may you tell me more about it?

Thank you and have a nice weekend,
Eugenio


reply via email to

[Prev in Thread] Current Thread [Next in Thread]