[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fem-fenics questions
From: |
Daniel Kraft |
Subject: |
Re: fem-fenics questions |
Date: |
Tue, 4 Mar 2014 09:30:59 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Hi!
On 2014-03-03 13:01, Marco Vassallo wrote:
> On Mon, Mar 3, 2014 at 11:50 AM, Daniel Kraft <address@hidden
> <mailto:address@hidden>> wrote:
> > I think that we can do either a function with a different signature:
> >
> > feval ( function function_name, Array<double> x_coordinates,
> > Array<double> y_coordinates, Array<double> z_coordinates)
> >
> > or a function with a similar signature as the one we are using now but
> > receiving a matrix
> > of points and not an array. What do you think?
> > If you want to implement it or you have any better idea it would
> be great.
>
> I would probably go for this signature anyway -- it seems more intuitive
> to do "feval(func, x, y)" instead of "feval(func, [x, y])" since the
> former is closer to "func(x, y)".
>
> If it isn't a problem to make the old convention obsolete, I can work on
> a patch to change the feval semantics that way (and also to handle
> multiple points in a loop). If we want to keep supporting the old call
> (not sure how many users there are already out there), it should be easy
> enough to handle that in case feval has only two arguments, and I can
> also do that.
>
> What do you think?
>
>
> In my opinion the syntax should be as close as possible to the one from
> FEniCS python.
> You can give a look at what they do for the eval() function and try to
> reproduce it, even if it makes
> my old syntax obsolete.
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.
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
smime.p7s
Description: S/MIME Cryptographic Signature
- fem-fenics questions, Daniel Kraft, 2014/03/03
- Re: fem-fenics questions, Marco Vassallo, 2014/03/03
- Re: fem-fenics questions, Marco Vassallo, 2014/03/03
- Re: fem-fenics questions, Daniel Kraft, 2014/03/03
- Re: fem-fenics questions, Marco Vassallo, 2014/03/03
- Re: fem-fenics questions,
Daniel Kraft <=
- Re: fem-fenics questions, Marco Vassallo, 2014/03/04
- Re: fem-fenics questions, Daniel Kraft, 2014/03/04
- Re: fem-fenics questions, Marco Vassallo, 2014/03/04
- Re: fem-fenics questions, Marco Vassallo, 2014/03/04
- Re: fem-fenics questions, c., 2014/03/04