Got a question on finding the boundary value with a known boundary face label
Just got a question on finding the boundary value with a known boundary face label, it seems quite straight forward but somehow confused me.
I can do the following to find a boundary face label:
label faceLabel = ms.findNearestBoundaryFace(X);
and trying to get the corresponding value on the boundary:
"vf.boundaryField()[ ? ][faceLabel]"
Now in the question mark [?], unlike internalField, boundaryField contains more than one patches, thus I will need to know the patch label in front of the face label. One way I can do is just make a loop for all patches and check which is the one the face belongs to, but it seems stupid. I just wondering if there's any simple ways to solve it.
Found something useful, I can use
label patchId=mesh().boundaryMesh().whichPatch(myFaceLab el);
to identify the patch index with given face label.
|All times are GMT -4. The time now is 18:07.|