I'm implementing a boundary condition. I is basically a cylinder in which I need to set a fixedValue or fixedGradient profile.

Better saying, I need to get the faces of this cylinder and define a function for the faces values following the axial direction. I have an idea how to access my patch faces, but I don't know if I can get information among faces to check if they're neighbours in the axial direction.

Trying again: from top to bottom, my cylinder must have fixedValues following a cosinoidal function or a x^2 function.

Let me know if my point is not clear to try to explain in better words.

At the first line you get que ID of the patch of which I need to get the faces. Ok.

But in the second line, you directly access a position in the boundaryMesh() method (which give us a boundaryMesh) related to the patchID. I can imagine it works, but I could find no method to access on patch, only the patch() method which gives me a list of patches. I feel like using direct access ([]) to a structure I don't know quite unconfortable. Do you have any pointers about documentation on how can I use these datastructures?

I'm frozen in these lines by now. I ask more questions when I arrive to the faceI variable you mentioned in your code.

Thank you very much for the code example and all your help. I have to say is almost impossible to start program in OpenFOAM without help like yours.