octave-maintainers
[Top][All Lists]
Advanced

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

Re: [Patch] fem-fenics patches


From: Daniel Kraft
Subject: Re: [Patch] fem-fenics patches
Date: Wed, 5 Mar 2014 09:35:46 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Hi!

On 2014-03-05 09:10, c. wrote:
> On 4 Mar 2014, at 13:22, Marco Vassallo <address@hidden> wrote:
> Even if that costs  the effort of giving a little more thought on a change 
> before 
> pushing it.
> 
> In this particular case, a change that would preserve the compatibility AND 
> allow
> the convenience of vectorization, is to allow the syntax:
> 
>  eval (FUNC, P) 
> 
> where, if P is a matrix, evaluation is done by iterating through its columns.

Note that the patches *do* preserve compatibility.  All that is added is
another, *optional* way of calling feval.  The new calling convention is
IMHO much more natural and also consistent with how feval works for the
rest of Octave, and thus I think it helps to simplify usage and learning
for new users (who may not be familiar with the Python version of FEniCS
at all, like me, and expect feval to work like it does with the rest of
Octave).

> This would also allow, for example, interpolating to the nodes of a new mesh
> by simply doing:
> 
>  f = eval (FUNC, new_mesh.p);

We can actually extend feval even further to also support your
suggestion here, and I believe that both versions can co-exist since it
is clear from the number of arguments, which one is used.

Also note that the feval(FUNC, X, Y, Z) syntax allows X, Y and Z to be
of *any* shape, so that a function can be evaluated just like built-in
element-wise functions on vectors, matrices and any other arrays.  This
is not possible with your proposed syntax, which would require reshaping
before and after calling feval.  Thus if there are no strong reasons why
the new (and optional!) syntax is harmful, I would really prefer to have
it also available.

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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

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