← Back to team overview

yade-users team mailing list archive

Re: [Question #243019]: loop over cells in PFV using id

 

Question #243019 on Yade changed:
https://answers.launchpad.net/yade/+question/243019

    Status: Open => Answered

Bruno Chareyre proposed the following answer:

> Hi,
>
> How can I loop over all cells in PFV method?
> I noticed there is an id of each cell, but how can I find out all ids?
>

We added recently flow.nCells(), exactly for this purpose, yet it will
need more functions to be really useful. We discover what is missing
from users feedback.

One (the only) thing you can do a.t.m is:
for i in range(flow.nCells()):
   print flow.getVertices(i)

There is no python wrapping of the cell objects, hence we need one
getter per variable.
You could add additional functions depending on what you need
(getPosition, getPressure, etc.), very easy to do if you look how
getVertices work.
I suspect Thomas may have add getPressure() already (uncommited). If so,
we better include your version Thomas to not end up with multiple
implementations of the same feature (which would lead to git conflicts).

Bruno



-- 
_______________
Bruno Chareyre
Associate Professor
ENSE³ - Grenoble INP
Lab. 3SR
BP 53
38041 Grenoble cedex 9
Tél : +33 4 56 52 86 21
Fax : +33 4 76 82 70 43
________________

You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.