|
[Sponsors] |
March 3, 2021, 05:49 |
Accessing the vertex index of a face
|
#1 |
New Member
Jérémy Chevalier
Join Date: Feb 2021
Posts: 10
Rep Power: 5 |
Hi,
I am currently coding a gradient calculation method. For this I need to access the coordinates of the vertices of the faces, which I could do thanks to : const pointField& points = mesh.points(); For the moment I already have access to the index of the faces for a cell thanks to : const label own = owner[cellI]; const labelList& faces = mesh.cells()[own]; But I can't find any function giving me the index of vertices for faces... If anyone has an idea, I'll take it! Thank you. |
|
March 3, 2021, 07:02 |
|
#2 |
New Member
Jérémy Chevalier
Join Date: Feb 2021
Posts: 10
Rep Power: 5 |
I think it's solved, sorry it took me a while and I didn't think I would solve my problem immediately after posting this topic.
If it helps, here is the solution Code:
forAll(owner, cellI) { const label own = owner[cellI]; const label nei = neighbour[cellI]; const faceList& faces = mesh.faces(); Info << "own" << endl; Info << own << endl; forAll(faces[own],I) { Info << "Ie vertice of the face" << endl; Info << faces[own][I] << endl; Info << "Coordinates of this vertice" << endl; Info << points[faces[own][I]] << endl; } thank you. |
|
Tags |
face, faces, index, vertice, vertices |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Invalid Normals for source face to target face while making AMI? | Sorabh | OpenFOAM Meshing & Mesh Conversion | 1 | August 3, 2021 07:35 |
[snappyHexMesh] snappyHexMesh Boundary Layer at Corner | panpanzhong | OpenFOAM Meshing & Mesh Conversion | 5 | July 3, 2018 06:53 |
[blockMesh] --> foam fatal error: | lillo763 | OpenFOAM Meshing & Mesh Conversion | 0 | March 5, 2014 11:27 |
[Netgen] Import netgen mesh to OpenFOAM | hsieh | OpenFOAM Meshing & Mesh Conversion | 32 | September 13, 2011 06:50 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 15:11 |