> On Apr 10, 2019, at 11:12 AM, Dario Panada wrote:
>
> In my case, as I just have only one dimension, using sourceGrid.value[i] or
> sourceGrid[...,i] should be equivalent though?
Yes
___
fipy mailing list
fipy@nist.gov
Thanks, makes sense.
In my case, as I just have only one dimension, using sourceGrid.value[i] or
sourceGrid[...,i] should be equivalent though?
On Tue, Apr 9, 2019 at 3:32 PM Guyer, Jonathan E. Dr. (Fed) via fipy <
fipy@nist.gov> wrote:
> > On Apr 8, 2019, at 6:38 PM, Dario Panada wrote:
>
> >
> On Apr 8, 2019, at 6:38 PM, Dario Panada wrote:
> DP: I guess what confuses me here is the [..., i] syntax on the CellVariable
> object thought.
FiPy is built on NumPy. `...` or Ellipsis means "all the indices except for the
one specified". FiPy stores cells in the last index of the
On Mon, Apr 8, 2019 at 11:22 PM Guyer, Jonathan E. Dr. (Fed) via fipy <
fipy@nist.gov> wrote:
>
>
> > On Apr 8, 2019, at 4:09 PM, Dario Panada wrote:
> >
> > DP: That would be diffusion of solubles from blood vessels (endothelial
> cells). Specifically, glucose or oxygen. It wouldn't change
> On Apr 8, 2019, at 4:09 PM, Dario Panada wrote:
>
> DP: That would be diffusion of solubles from blood vessels (endothelial
> cells). Specifically, glucose or oxygen. It wouldn't change significantly be
> increasing it to a 40x40x40 grid, you'd just be simulating a larger section
> of
Martin -
That's interesting that `u.value.reshape(Nz,Ny,Nx)` gives you a view on the
CellVariable's value. I'd say it's not 100% reliable that it always will, but
it probably will. The result is certainly easier to read than juggling around
with `ravel_multi_index`.
- Jon
> On Apr 8, 2019,
> On Apr 8, 2019, at 11:30 AM, Dario Panada wrote:
> I two initial numpy grids (n*n*n) where each value corresponds to a
> source/sink. Eg: Given my source grid and coordinates (1,2,3) having value 5,
> I want to set such value as a source in FiPy.
That wasn't my question. When you publish
Dear Martin,
Many thanks for your message.
I think your approach is not too dissimilar from mine, but you are
accessing *.value* of CellVariable whereas I am accessing *._array*. I have
no problem switching to that, I'd just like confirmation that we can
directly set the values by modifying the
Dear Dario,
I am currently using Fipy for a slightly different diffusion-reaction
problem.
I use a CellVariable on the same grid for the (spatially-dependent) rate
constant. One can set its values in a "numpy-vectorized" fashion by
accessing the "value" property of the CellVariable.
By
Hello,
Many thanks for your reply.
Yes, let me provide a bit more context.
I two initial numpy grids (n*n*n) where each value corresponds to a
source/sink. Eg: Given my source grid and coordinates (1,2,3) having value
5, I want to set such value as a source in FiPy. Currently I am dong that
by,
Iterating over a mesh with a Python `for` loop is, as you've found, an
incredibly inefficient way to do things. FiPy, like numpy it relies on, is
intended to be used with vectorized operations.
As far as your approach, things that start with `_` in Python are internal
implementation details
11 matches
Mail list logo