|
[Sponsors] |
[Other] Cell Numbering (cellIDs) of cellZones |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 8, 2019, 05:10 |
Cell Numbering (cellIDs) of cellZones
|
#1 |
Member
Ashish Magar
Join Date: Jul 2016
Location: Mumbai, India
Posts: 81
Rep Power: 9 |
Hello,
Is there any specific way OF orders/numbers the cells in different cellZones. Are there any exceptions made while numbering? I could not find any doc explaining this stuff. Thanks |
|
April 30, 2019, 05:49 |
|
#2 |
Member
Ashish Magar
Join Date: Jul 2016
Location: Mumbai, India
Posts: 81
Rep Power: 9 |
Okay.. so decided to answer this myself.
I don't know how the cell ordering takes place, but anyway I needed it in the code for doing some consistent operations using the cellIds. Using some information from other threads, I found out a method to get the list of cellIds (of any set or zone) is: Code:
cellSet test(mesh, name); labelList cellIds = test.toc(); Well, in case of averaging (or weighted averaging) the order does not matter. But in my case, I needed them in the order. I could not solve it, rather I found a workaround, by reading the cellIds from sets/ and use them for the purpose I intended. If anyone has a better method, please feel free to post here. Thanks, Ashish Magar |
|
May 7, 2019, 07:28 |
|
#3 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,686
Rep Power: 40 |
The cell Ids of the cellZone depend on how the zone was defined. It is generally good practice to have this in sorted order, but any order is allowed provided that there are no duplicate ids.
If you want to create a sorted set of ids from a cellSet (which is inherently unordered), just specify the appropriate method: Code:
cellSet test(mesh, name); labelList cellIds(test.sortedToc()); Code:
Foam::sort(cellIds); |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Neighboring cells in tetrahedral mesh | vishwesh | OpenFOAM Programming & Development | 9 | November 10, 2017 07:06 |
Doubt about parallel processing | vishwesh | OpenFOAM Programming & Development | 0 | November 10, 2017 06:20 |
Journal file error | magicalmarshmallow | FLUENT | 3 | April 4, 2014 12:25 |
[General] 2 datas on one plot | Akuji | ParaView | 46 | December 1, 2013 14:06 |
cell to cell relation | CMB | Siemens | 1 | December 4, 2003 04:05 |