help-octave
[Top][All Lists]
Advanced

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

Re: fem-fenics questions


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




On Tue, Mar 4, 2014 at 10:02 AM, Marco Vassallo <address@hidden> wrote:



On Tue, Mar 4, 2014 at 9:29 AM, Daniel Kraft <address@hidden> 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.
>
>     Please let me know what you think about this proposal -- if it is ok,
>     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.

Sorry I didn't read Carlo suggestion.

"the approach with multiple coordinates collected into a matrix is more convenient,
for example, for computing the value of the function at all the nodes of a mesh using
the p field of the mesh structure."

I don't really know which one is more useful and intuitive. As far as I'm concerned, if the FEniCS
syntax is supported and extended to receive also an array for each coordinate I'm ok.
If you want to add something else and the syntax is still clear for the user i think that it is fine.

Marco
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




reply via email to

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