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

[blockMesh] Does blockMesh create mesh vertices in any particular order

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 5, 2005, 22:20
Default Does blockMesh create mesh vertices in any particular order
  #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!
  Reply With Quote

Old   December 6, 2005, 05:41
Default Yes, cells are always created
  #2
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
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
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,902
Rep Power: 33
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.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   December 12, 2005, 21:26
Default 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.)
  Reply With Quote

Reply

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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 06:38
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
[ICEM] how to create a 2d tri mesh with quad mesh in the boundary layer seal2013 ANSYS Meshing & Geometry 3 October 6, 2013 17:09
3D Hybrid Mesh Errors DarrenC ANSYS Meshing & Geometry 11 August 5, 2013 07:42
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


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