CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion > OpenFOAM Native Meshers: blockMesh

Does blockMesh create mesh vertices in any particular order

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

LinkBack Thread Tools Display Modes
Old   December 5, 2005, 22:20
Default As I mentioned in a different
Posts: n/a
As I mentioned in a different thread ("Code to read in results on a BlockMesh-created mesh as structured arrays", under "Postprocessing"), I'm needing to read in some OpenFOAM data into another program that's expecting a structured mesh.

All my meshes are created with blockMesh, which creates a mesh that "looks like" a structured mesh, so I'm hoping I can use that fact to make it easier to read in my data.

Thus, my question: is there any particular order to how blockMesh creates the points in the pointList, and the cells in the cellList? Does it create them by nested loops in the three coordinate directions and number them in that order, or is it more complicated than that? Does it always do them in the same order?

(I know I could figure most of this out with some tests -- except for that last question! So that's why I'm asking.)

  Reply With Quote

Old   December 6, 2005, 05:41
Default Yes, cells are always created
Super Moderator
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 18
mattijs is on a distinguished road
Yes, cells are always created in i,j,k order. Don't know exactly which comes first though. Try on a simple case.

Don't know about multi-block meshes. Guess still it will do one block after the other. The shared points though will be treated differently.

You can always check the code ($FOAM_UTILITIES/mesh/generation/blockMesh)
mattijs is offline   Reply With Quote

Old   December 6, 2005, 05:55
Default The vertices are created block
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,810
Rep Power: 25
hjasak will become famous soon enough
The vertices are created block by block in the order of block definition. Once all the blocks are created, there is a multi-pass vertex merge algorithm which always keeps the vertex with the lowest label.

The vertices are created in the blockPoints.C:

for (label k = 0; k <= nk; k++)
for (label j = 0; j <= nj; j++)
for (label i = 0; i <= ni; i++)
label vertexNo = vtxLabel(i, j, k);

vector edgex1 = start*(1.0 - edgeWeights[0][i])
+ xEnd*edgeWeights[0][i];

vector edgex2 = yEnd*(1.0 - edgeWeights[1][i])
+ xyEnd*edgeWeights[1][i];

etc. etc.

In other words, the x (or i) index changes fastest, then j and then k.


Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting:
hjasak is offline   Reply With Quote

Old   December 12, 2005, 21:26
Default Thanks for the advice, both of
Posts: n/a
Thanks for the advice, both of you; it was quite helpful! (And thanks particularly to Hrv for posting the code and reminding me that the internals of blockMesh really aren't as scary as I thought they might be.)
  Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
FluentMeshToFoam Cannot find a single face in the mesh which uses vertices francesco_b OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 3 October 1, 2009 08:10
Help to create geometry using blockMesh nandiganavishal OpenFOAM Running, Solving & CFD 11 January 13, 2009 15:20
What is the best option for create a mesh not using blockmesh titio OpenFOAM Meshing Format & General Technical 4 January 17, 2008 03:37
Mesh generation without using blockMesh mamaly60 OpenFOAM Meshing & Mesh Conversion 1 November 1, 2007 03:45
BlockMesh error with growing mesh size kian OpenFOAM Native Meshers: blockMesh 4 September 24, 2007 16:00

All times are GMT -4. The time now is 22:31.