|
[Sponsors] |
How to iterate over all cells in decomposed mesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 23, 2007, 07:08 |
Hi everybody,
Could someone
|
#1 |
Senior Member
Thomas Jung
Join Date: Mar 2009
Posts: 102
Rep Power: 17 |
Hi everybody,
Could someone give me a hint on how to iterate over all cells of a decomposed mesh? After naively using it for quite some time, I just found out that mesh.cells() gives me only the cells of one partition Thank you! Thomas |
|
October 23, 2007, 08:14 |
Hi Thomas!
That's the whole
|
#2 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Thomas!
That's the whole point of parallelizing: every processor is responsible for "his" cells. If one processor could loop over all cells it would no longer be parallel. What do you want to do? If it is something like counting cells with a specific property (that's one of the reasons why you might want to do this), then you should do it as usual and use something like reduce(cnt,sumOp<label>()); to calculate the sum over all processors and distribute it to all processors Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
October 23, 2007, 08:44 |
Hi Bernhard,
Actually, I wa
|
#3 |
Senior Member
Thomas Jung
Join Date: Mar 2009
Posts: 102
Rep Power: 17 |
Hi Bernhard,
Actually, I was looking for a cell at a specific location to set a reference value there (fvMatrix::setReference). I think I ran into a trap with that idea ... now apperently every processor is setting reference at a different cell.. Isn't there some way, even doing communication, to globally find a cell? Just tried findNearestCell(), but seems to work also ony within one processors cells... |
|
October 23, 2007, 10:26 |
Hi Thomas!
Something like t
|
#4 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Thomas!
Something like this? label cellI=mesh.findCell(location); if(cellI>=0) { matrix.setReference(cellI,value); } That'd set the reference only on the processor that has the cell in question, I guess. Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
October 23, 2007, 11:06 |
Thx a lot!
Thats it.
And s
|
#5 |
Senior Member
Thomas Jung
Join Date: Mar 2009
Posts: 102
Rep Power: 17 |
Thx a lot!
Thats it. And so easy.... shame on me |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Reconstruction of decomposed dynamic mesh cases | david | OpenFOAM Post-Processing | 2 | January 9, 2009 08:19 |
Empty cells in mesh | Nikolaos | FLOW-3D | 2 | October 22, 2008 00:17 |
RAM necessary for a 6 million cells hex mesh | Antoine | FLUENT | 2 | September 4, 2008 11:13 |
mesh with 804 cells.. | nicolas | FLUENT | 6 | September 24, 2007 07:14 |
[OpenFOAM] ParaFoam OF 14 decomposed cases | philippose | ParaView | 4 | April 18, 2007 06:17 |