help-octave
[Top][All Lists]

## Re: fem-fenics questions

 From: Marco Vassallo Subject: Re: fem-fenics questions Date: Tue, 4 Mar 2014 10:02:51 +0000

On Tue, Mar 4, 2014 at 9:29 AM, Daniel Kraft wrote:
Hi!

On 2014-03-04 09:59, Marco Vassallo wrote:
> On Tue, Mar 4, 2014 at 8:30 AM, Daniel Kraft <address@hidden
>     Looking at [1], it seems that they have the same syntax as you proposed.
>      I. e., feval(func, [x, y]) or feval(func, [x, y, z]).
>
>       [1]
>     http://fenicsproject.org/documentation/dolfin/1.3.0/python/programmers-reference/cpp/function/Function.html#dolfin.cpp.function.Function
>
>     My suggestion is still the following, which I find more natural:
>
>     * Allow feval(func, [coordinates]) as before for compatibility with the
>     Python version and the old version in fem-fenics.
>
>     * Implement feval(func, x, y) and feval(func, x, y, z), which is in my
>     opinion more natural.
>
>     * In the new version, allow x, y and z to be vectors or matrices so that
>     one can evaluate the function coordinate-wise for a bunch of points
>     at once.
>
>     I'll work on a patch.
>
> The main goal for fem-fenics in the next months is to be integrated in
> FEniCS,
>  and thus in my opinion it is important to have a syntax as close as
> possible to it.
> On the other side, feval() is also a function in Octave, where the syntax is
> [y1, y2, ...] = feval(fname, x1, ..., xn)
>
> as you proposed. I think that having the two different functions would
> be great, so that
> both FEniCS and Octave users have something close to what they are used to.

We can support both versions with "feval", since we can decide depending
on the number of arguments (2 arguments -> 2nd one is array und use
"Python" convention, 3 or 4 arguments -> use "Octave" convention).  Is
that what you mean by "two different functions"?  Or do you really
suggest to use different names for them?

If the former, I agree and can implement that.

Hi,

yes the former, sorry if it wasn't clear.

Marco
Yours,
Daniel

--
http://www.domob.eu/
OpenPGP: 901C 5216 0537 1D2A F071  5A0E 4D94 6EED 04F7 CF52
Namecoin: id/domob -> https://nameid.org/?name=domob
--
Done:  Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri