CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Accessing the vertex index of a face

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 3, 2021, 04:49
Default Accessing the vertex index of a face
  #1
New Member
 
Jérémy Chevalier
Join Date: Feb 2021
Posts: 10
Rep Power: 5
JeremyChvlr is on a distinguished road
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.
JeremyChvlr is offline   Reply With Quote

Old   March 3, 2021, 06:02
Default
  #2
New Member
 
Jérémy Chevalier
Join Date: Feb 2021
Posts: 10
Rep Power: 5
JeremyChvlr is on a distinguished road
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.
JeremyChvlr is offline   Reply With Quote

Reply

Tags
face, faces, index, vertice, vertices

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 06:35
[snappyHexMesh] snappyHexMesh Boundary Layer at Corner panpanzhong OpenFOAM Meshing & Mesh Conversion 5 July 3, 2018 05:53
[blockMesh] --> foam fatal error: lillo763 OpenFOAM Meshing & Mesh Conversion 0 March 5, 2014 10:27
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 05:50
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 14:11


All times are GMT -4. The time now is 00:30.