As I mentioned in a different
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.)
Yes, cells are always created
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)
The vertices are created block
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[i])
vector edgex2 = yEnd*(1.0 - edgeWeights[i])
In other words, the x (or i) index changes fastest, then j and then k.
Thanks for the advice, both of
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.)
|All times are GMT -4. The time now is 00:39.|