dmoroian |
November 18, 2014 14:41 |
Cells at the intersection between a plane and a patch
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++;
}
}
}
But it seems that I don't put the zeros where I actually want. Is there anyone that can identify the error?
Thanks,
Dragos
|