|
[Sponsors] |
Cells at the intersection between a plane and a patch |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 18, 2014, 15:41 |
Cells at the intersection between a plane and a patch
|
#1 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
Hello,
I would like to be able to access the cells at the intersection between a plane and a boundary. The snippet I'm trying is: Code:
word patchName = "surf_wall_exterior_wind_shield"; label patchID = mesh.boundaryMesh().findPatchID(patchName); const fvPatch& cPatch = mesh.boundary()[patchID]; const labelList& patchCells = cPatch.faceCells(); ... const point p0(2.099,-0.714,1.099); const point p1(2.050,-0.741,1.182); const point p2(2.768,-0.572,1.474); plane pl1(p0,(p1-p0)^(p2-p0)); cuttingPlane cutPlane(pl1,mesh,true); const labelList& cutCells = cutPlane.cutCells(); label found = 0; forAll(cutCells,cellI)//loop over the cells intersecting the plane { forAll(patchCells, pCelli)//loop over the cells adjacent to a patch { if(pCelli == cellI) { alpha1[cellI] = 0.0; found++; } } } Thanks, Dragos |
|
November 19, 2014, 15:13 |
|
#2 |
Senior Member
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20 |
Ok, I think the error is in the usage of the index. I will test if this is the right way:
Code:
word patchName = "surf_wall_exterior_wind_shield"; label patchID = mesh.boundaryMesh().findPatchID(patchName); const fvPatch& cPatch = mesh.boundary()[patchID]; const labelList& patchCells = cPatch.faceCells(); ... const point p0(2.099,-0.714,1.099); const point p1(2.050,-0.741,1.182); const point p2(2.768,-0.572,1.474); plane pl1(p0,(p1-p0)^(p2-p0)); cuttingPlane cutPlane(pl1,mesh,true); const labelList& cutCells = cutPlane.cutCells(); label found = 0; forAll(cutCells,cellI)//loop over the cells intersecting the plane { forAll(patchCells, pCelli)//loop over the cells adjacent to a patch { if(patchCells[pCelli] == cutCells[cellI]) { alpha1[cutCells[cellI]] = 0.0; found++; } } } Last edited by dmoroian; November 20, 2014 at 02:15. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Gmsh] Problem with Gmsh | nishant_hull | OpenFOAM Meshing & Mesh Conversion | 23 | August 5, 2015 03:09 |
[Gmsh] Conversion Error | nuovodna | OpenFOAM Meshing & Mesh Conversion | 14 | October 1, 2010 12:07 |
[Gmsh] boundaries with gmshToFoam | ouafa | OpenFOAM Meshing & Mesh Conversion | 7 | May 21, 2010 13:43 |
[Gmsh] Import problem | ARC | OpenFOAM Meshing & Mesh Conversion | 0 | February 27, 2010 11:56 |
Poor Residuals at Intersection Between Symmetry Plane and Airfoil Leading Edge | TWaung | CFX | 2 | February 16, 2010 09:11 |