|
[Sponsors] |
July 6, 2009, 06:49 |
Problems with cellSets and their contents
|
#1 |
Member
Björn Fabritius
Join Date: Mar 2009
Location: Freiberg, Germany
Posts: 31
Rep Power: 17 |
Hi All,
I have a mesh generated with polyDualMesh and checkMesh identifies lots of wrongOrientedFaces. I got the impression that it has to do with the geometry of my domain. To prove this, I want to write all the owner cells of the wrongOrientedFaces into a cellSet and transform this to VTK. So far, so easy. I wrote the following code: Code:
faceSet woFaces(mesh, "wrongOrientedFaces", mesh.nFaces()/100 + 1); cellSet concaveCells(mesh, "concaveCells", mesh.nCells()/100 + 1); // more than enough if (mesh.checkFacePyramids(false, -SMALL, &woFaces)) { forAll(woFaces, faceI) { concaveCells.insert(mesh.faceOwner[faceI]); } concaveCells.write(); } I tried and added mesh.faceOwner[faceI] to a labelList instead of a cellSet and *magic* it worked there. So how do i insert values into a cellSet (or a labelHashSet to be specific)?? Help would be appreciated. Maybe you could try out the code snippet. Regards, Bjoern Last edited by bfa; July 6, 2009 at 11:56. |
|
July 6, 2009, 11:55 |
|
#2 |
Member
Björn Fabritius
Join Date: Mar 2009
Location: Freiberg, Germany
Posts: 31
Rep Power: 17 |
OK,
after browsing FOAM source code for some time I discovered the true functionality of a labelHashList. The correct version of above code uses no forAll loop, but a constant list iterator: Code:
for(faceSet::const_iterator faceI = woFaces.begin(); faceI != woFaces.end(); faceI++) { concaveCells.insert(mesh.faceOwner()[faceI.key()]); } concaveCells.write(); Bjoern |
|
Tags |
cellsets, checkmesh |
|
|