# Mesh structure of Open Foam.

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 Sponsored Links

 LinkBack Thread Tools Display Modes
 February 11, 2010, 02:22 Mesh structure of Open Foam. #1 New Member   Gopal Shinde Join Date: Sep 2009 Location: Pune, India Posts: 21 Rep Power: 9 Sponsored Links Hi Foamers, Can anybody explain me the underlying mesh connectivity of the mesh generated in OpenFoam by blockMesh. Or the reference where should I look for the same ? rgds, -Gopal
 Sponsored Links

 February 11, 2010, 10:46 #2 Senior Member   Elvis Join Date: Mar 2009 Location: Sindelfingen, Germany Posts: 596 Blog Entries: 5 Rep Power: 16 Hello i do not know if this information is still valid (i mean using -blockTopology argument to dump out a blockTopology.obj file)http://openfoamwiki.net/index.php/BlockMesh and can not try blockmesh right now. But try to visualise some blockmesh-examples with the help of VTK (for example visit http://www.llnl.gov/visit/ mayavi http://mayavi.sourceforge.net/ or paraview that comes with OF) just my 2 cents elvis

 February 12, 2010, 03:05 #3 Senior Member   Tomislav Maric Join Date: Mar 2009 Location: Darmstadt, Germany Posts: 281 Blog Entries: 5 Rep Power: 13 Check out the doxygen documentation: there you'll find the mesh classes. Doxygen is your friend. The basic idea is that you have a global pointField that holds all the mesh points. The position of the points in this pointField is your connection to all the upper topologies: face, cell, even the patches, sets and zones... their core is in this idea.. because the upper sets are just lists of the lower ones. like this: Code: ```pointField myLittleMeshPoints (3, point(0,0,0)); // let's make a triangle myLittleMeshPoints[0] = point (0,0,0); myLittleMeshPoints[1] = point (1,0,0); myLittleMeshPoints[2] = point (1,1,0); // create the label list for the face: // check out Foam::face constructor, and // you'll see that the constructor takes // a label list reference as an argument. // face (const labelList &) // NEVER PASS OBJECTS AS ARGUMENTS, // ALWAYS REFERENCES. // I'm just saying. :D labelList myLittleFaceLabels (3,0); // give the values of the label list // myLittleFaceLabels the position // of the points in the global mesh // pointField myLittleMesh forAll (myLittleFaceLabels, labelI) { myLittleFaceLabels[labelI] = labelI; } // call the constructor for the face. face myLittleFace (myLittleFaceLabels); // As the face is the list of point labels // in the global mesh pointField, so is // the cell a list of faces: a list of lists // of labels in the global mesh pointField. // This way you don't copy a bunch of // Foam::Vector or Vector // or point or vector (read: point) but instead // use the labels for the connectivity.``` Try creating 4 points for a tetrahedron. create 4 faces manually as I've described. Create a face list. That's your cell. Check out the primitiveMesh constructor. Create the mesh from two of these cells. And so on... practice makes headache. Just kidding....

 March 25, 2010, 12:31 #4 Senior Member   John Deas Join Date: Mar 2009 Posts: 160 Rep Power: 10 When defining a face from a list of point as per your example, does the ordering of the points matters ? Will it matter when computing surface flux latter, for example ? EDIT Just found my answer in the user guide

March 25, 2010, 12:37
#5
Senior Member

Sebastian Gatzka
Join Date: Mar 2009
Location: Frankfurt, Germany
Posts: 729
Rep Power: 13
Quote:
 Originally Posted by johndeas When defining a face from a list of point as per your example, does the ordering of the points matters ? Will it matter when computing surface flux latter, for example ?
Yes it matters: User Guide, 5.3.1.4

"The order in which the vertices are given must be such that, looking from inside the block and starting with any vertex, the face must be traversed in a clockwise direction to define the other vertices."
__________________
Schrödingers wife: "What did you do to the cat? It's half dead!"

March 25, 2010, 13:26
#6
Senior Member

Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 281
Blog Entries: 5
Rep Power: 13
Quote:
 Originally Posted by johndeas When defining a face from a list of point as per your example, does the ordering of the points matters ? Will it matter when computing surface flux latter, for example ? EDIT Just found my answer in the user guide
One interesting thing I found is that you may have multiple points appearing in the pointField that are connected to one face (face label list may have multiple global labels inside). If you are calculating the fluxes, and everything else that's Foam::mag dependent, it makes no difference. Still, I've managed to avoid multiple points so far.
I'm working on a 2D solver (gathering 3D cell centered data for the interpolation) so I just need to be careful to have the counter clockwise oriented polygons (that's what faces are) so that my area is calculated positively. Or, as the U-Guide states:
Code:
```if (inside and looking out)
{
clockwise orientation to get the outward pointing normal
}```
If for some reason you need the opposite orientation, use

Code:
`Foam::face Foam::face::reverseFace()`
but this won't give you the handle on the points.

May 29, 2012, 16:33
#7
New Member

Join Date: Feb 2012
Posts: 4
Rep Power: 7
Quote:
 Originally Posted by tomislav_maric Check out the doxygen documentation: there you'll find the mesh classes. Doxygen is your friend. The basic idea is that you have a global pointField that holds all the mesh points. The position of the points in this pointField is your connection to all the upper topologies: face, cell, even the patches, sets and zones... their core is in this idea.. because the upper sets are just lists of the lower ones. like this: Code: ```pointField myLittleMeshPoints (3, point(0,0,0)); // let's make a triangle myLittleMeshPoints[0] = point (0,0,0); myLittleMeshPoints[1] = point (1,0,0); myLittleMeshPoints[2] = point (1,1,0); // create the label list for the face: // check out Foam::face constructor, and // you'll see that the constructor takes // a label list reference as an argument. // face (const labelList &) // NEVER PASS OBJECTS AS ARGUMENTS, // ALWAYS REFERENCES. // I'm just saying. :D labelList myLittleFaceLabels (3,0); // give the values of the label list // myLittleFaceLabels the position // of the points in the global mesh // pointField myLittleMesh forAll (myLittleFaceLabels, labelI) { myLittleFaceLabels[labelI] = labelI; } // call the constructor for the face. face myLittleFace (myLittleFaceLabels); // As the face is the list of point labels // in the global mesh pointField, so is // the cell a list of faces: a list of lists // of labels in the global mesh pointField. // This way you don't copy a bunch of // Foam::Vector or Vector // or point or vector (read: point) but instead // use the labels for the connectivity.``` Try creating 4 points for a tetrahedron. create 4 faces manually as I've described. Create a face list. That's your cell. Check out the primitiveMesh constructor. Create the mesh from two of these cells. And so on... practice makes headache. Just kidding....
can you tell exactly how this type of tetrahedron can be created

July 7, 2015, 09:18
#8
Member

Join Date: Jun 2011
Posts: 77
Rep Power: 8
Quote:
 Originally Posted by tomislav_maric Check out the doxygen documentation: there you'll find the mesh classes. Doxygen is your friend. The basic idea is that you have a global pointField that holds all the mesh points. The position of the points in this pointField is your connection to all the upper topologies: face, cell, even the patches, sets and zones... their core is in this idea.. because the upper sets are just lists of the lower ones. like this: Code: ```pointField myLittleMeshPoints (3, point(0,0,0)); // let's make a triangle myLittleMeshPoints[0] = point (0,0,0); myLittleMeshPoints[1] = point (1,0,0); myLittleMeshPoints[2] = point (1,1,0); // create the label list for the face: // check out Foam::face constructor, and // you'll see that the constructor takes // a label list reference as an argument. // face (const labelList &) // NEVER PASS OBJECTS AS ARGUMENTS, // ALWAYS REFERENCES. // I'm just saying. :D labelList myLittleFaceLabels (3,0); // give the values of the label list // myLittleFaceLabels the position // of the points in the global mesh // pointField myLittleMesh forAll (myLittleFaceLabels, labelI) { myLittleFaceLabels[labelI] = labelI; } // call the constructor for the face. face myLittleFace (myLittleFaceLabels); // As the face is the list of point labels // in the global mesh pointField, so is // the cell a list of faces: a list of lists // of labels in the global mesh pointField. // This way you don't copy a bunch of // Foam::Vector or Vector // or point or vector (read: point) but instead // use the labels for the connectivity.``` Try creating 4 points for a tetrahedron. create 4 faces manually as I've described. Create a face list. That's your cell. Check out the primitiveMesh constructor. Create the mesh from two of these cells. And so on... practice makes headache. Just kidding....

Hi Tomislav!

I'm trying to build a cylinder made of points by using pointField. If you have a look at the pointField class, you'll see that the write function is missing, so can I write and read this list of points in file? Up to the moment I've been able of writing them by using:

OFstream cylinderPoints("cylinderPoints");

but I'm sure that something better can be done...

Regards,
--
Antonio

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Althea FLUENT 22 January 4, 2017 04:19 evrikon OpenFOAM Meshing & Mesh Conversion 1 March 14, 2012 11:13 sarajags_89 OpenFOAM 0 November 24, 2009 23:50 matthias OpenFOAM Installation 20 March 25, 2008 03:36 Joe CFX 2 March 26, 2007 18:10

 Sponsored Links

All times are GMT -4. The time now is 03:01.

 Contact Us - CFD Online - Top