|
[Sponsors] |
September 27, 2019, 12:43 |
Number of cells adjacent to a patch
|
#1 |
Member
Join Date: Feb 2018
Posts: 91
Rep Power: 8 |
Hi,
I would really appreciate it, if anyone can tell me how to find the number of cells adjacent to a patch. I would like to loop around the cells for my boundary condition. Thanks |
|
September 29, 2019, 21:50 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
You can probably use something like this :
Code:
Foam::label patchI = mesh.boundaryMesh().findPatchID("patch"); const Foam::fvPatch& currPatch = mesh.boundary()[patchI]; forAll(currPatch,facei){ face faceI = currPatch[facei]; //face } const labelUList& faceCells = currPatch.faceCells(); Info << "number of adjacent cells : " << faceCells.size(). //number of adjacent cells Caelan |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops | avinashjagdale | OpenFOAM Meshing & Mesh Conversion | 53 | March 8, 2019 10:42 |
parallel run OpenFoam | Srinath Reddy | OpenFOAM Running, Solving & CFD | 13 | February 27, 2019 10:15 |
[snappyHexMesh] SHM Layer Addition Phase | dickcruz | OpenFOAM Meshing & Mesh Conversion | 4 | November 1, 2018 08:05 |
[snappyHexMesh] SnappyHexMesh for internal Flow | vishwa | OpenFOAM Meshing & Mesh Conversion | 24 | June 27, 2016 09:54 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |