|
[Sponsors] |
December 9, 2010, 08:42 |
Some cells have disappeared
|
#1 |
Member
Markus Weinmann
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 77
Rep Power: 17 |
Hi all,
I have added two lines to pisoFoam to count the number of cells: const cellList& cells = mesh.cells(); Info << " no cells: " << cells.size() << endl; When I run it on a single processor it counts: 1278060 cells - which is correct. But when I decompose the case and run it on 16 processsors, the number reduces to: 79043 cells. This is approx. 1/16 of the total number of cells. Consequently, when I loop over all cells using "forAll(cells,cellI)" some cells are always missing Does anyone know why mesh.cells() does not include all cells when run in parallel and how can the missing cells be accessed? Thanks Markus |
|
December 9, 2010, 09:14 |
|
#2 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21 |
Hi Markus,
you must gather the information to the master: Code:
const cellList& cells = mesh.cells(); label nCells = 0; nCells = cells.size(); reduce(nCells, sumOp<label>()); Info << " no cells: " << nCells << endl; |
|
December 10, 2010, 11:37 |
|
#3 |
Member
Markus Weinmann
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 77
Rep Power: 17 |
Thank you Martin!
|
|
August 19, 2011, 08:48 |
field manipulation with parallel computations
|
#4 |
Member
Kim Yusik
Join Date: Dec 2009
Posts: 39
Rep Power: 16 |
Thanks for the thread on this subject first.
I've managed to get number of cells in parallel computing as Martin suggested but I still have a problem with modifying 'field' itself. here is the code I use const cellList& cells = mesh.cells(); label nCells = 0; nCells= cells.size(); reduce(nCells, sumOp<label>()); scalar i = 0; forAll(cells, celli){ i++; } Info<<"i= "<<i <<nl; Info<<"nCells= " <<nCells<<nl; with a single processor, it shows: i= 336000 nCells= 336000 with 4 processors, it shows: i= 84332 nCells= 336000 as you can see, nCells isn't affected by multi processing but the field loop number (i) is depending on the number of processors. So question is that is there any way that I can manipulate field (say velocity) with the parallel compuations ? What I want to do is imposing artificial fluctuations on one plane in the middle of domain. I also wrote same question in this forum but no response so far, http://www.cfd-online.com/Forums/ope...mputation.html Thanks in advance Yusik Last edited by impecca; August 19, 2011 at 09:07. Reason: na |
|
August 19, 2011, 08:58 |
|
#5 |
Senior Member
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21 |
Hi Yusik,
you can manipulate the field within the loop: forAll(cells, celli) { i++; // your manipulation here, each processor will manipulate // its part of the field. } Hmmhhh, not sure if I understand your problem correctly, maybe you can provide some code snippets of your intended algorithm... Martin |
|
August 21, 2011, 09:23 |
|
#6 |
Member
Kim Yusik
Join Date: Dec 2009
Posts: 39
Rep Power: 16 |
Yes, it works. you are right Martin. I was a different problem. I replied to other thread (link below). Thanks for your help.
http://www.cfd-online.com/Forums/ope...tml#post320892 |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Number of cells in mesh don't match with size of cellLevel | colinB | OpenFOAM Meshing & Mesh Conversion | 14 | December 12, 2018 08:07 |
[Netgen] Import netgen mesh to OpenFOAM | hsieh | OpenFOAM Meshing & Mesh Conversion | 32 | September 13, 2011 05:50 |
[snappyHexMesh] snappyHexMesh aborting | Tobi | OpenFOAM Meshing & Mesh Conversion | 0 | November 10, 2010 03:23 |
[snappyHexMesh] external flow with snappyHexMesh | chelvistero | OpenFOAM Meshing & Mesh Conversion | 11 | January 15, 2010 19:43 |
physical boundary error!! | kris | Siemens | 2 | August 3, 2005 00:32 |