freepooma-devel
[Top][All Lists]
Advanced

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

Re: [Freepooma-devel] [PATCH] Fix Field/Array mixed expressions


From: Roman Krylov
Subject: Re: [Freepooma-devel] [PATCH] Fix Field/Array mixed expressions
Date: Thu, 21 Apr 2005 19:07:04 +0400
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

For now the only workaround is to convert needed Array to Field and then use it. For instance:

Field_t tmp = sin(iota(...));    // RHS is convertable to Array<>
Field_t res = tmp*smth;    //smth is of Field_t

is not rewritable as

Field_t res = tmp*sin(iota(...));

Because RHS is of Field x Array type.
By the way we have in <pooma>/examples/Particles/PIC2d/PIC2d.cpp

  phi = phi0 * sin(2.0*pi*iota(phi.physicalDomain()).comp(0)/nx)
             * cos(4.0*pi*iota(phi.physicalDomain()).comp(1)/ny);

but RHS is pure Array<> without Fields. And it works.
Am I understanding it right?
And concerning the design, why Field is not a subclass of Array ?

Thanks.
Roman.

Richard Guenther wrote:

Sure - it only helps for some cases.  It's not possible to do it
in general without implicitly instantiating all combination of
types for these classes.  The bug is that we have Array _and_ Field
at all.  Instead we should have a more modular Array (or Field)
which can optionally provide meshes and relations (and multiple
centerings/materials through custom engines).

Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/



_______________________________________________
Freepooma-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/freepooma-devel







reply via email to

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