# Does blockMesh create mesh vertices in any particular order

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

 December 5, 2005, 22:20 As I mentioned in a different #1 brooksmoses Guest   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.) Thanks!

 December 6, 2005, 05:41 Yes, cells are always created #2 Super Moderator   Mattijs Janssens Join Date: Mar 2009 Posts: 1,419 Rep Power: 18 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)

 December 6, 2005, 05:55 The vertices are created block #3 Senior Member   Hrvoje Jasak Join Date: Mar 2009 Location: London, England Posts: 1,810 Rep Power: 25 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. Enjoy, Hrv __________________ Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk

 December 12, 2005, 21:26 Thanks for the advice, both of #4 brooksmoses Guest   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.)

 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 francesco_b OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 3 October 1, 2009 08:10 nandiganavishal OpenFOAM Running, Solving & CFD 11 January 13, 2009 15:20 titio OpenFOAM Meshing Format & General Technical 4 January 17, 2008 03:37 mamaly60 OpenFOAM Meshing & Mesh Conversion 1 November 1, 2007 03:45 kian OpenFOAM Native Meshers: blockMesh 4 September 24, 2007 16:00

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