Step 1 — From nominal size to divisions
For the base family, the dimensions are exact multiples of the three sizes:
div_x=beam_l/mesh_h
div_y=beam_h/mesh_h
div_z=beam_b/mesh_h
We don't call nx, ny and nz to these parameters:
MAPDL reserves those names for intrinsic nodal coordinate functions.
mesh_h | nx × ny × nz | Elements | Nodes |
|---|---|---|---|
| 0.0500m | 20 × 2 × 1 | 40 | 126 |
| 0.0250m | 40 × 4 × 2 | 320 | 615 |
| 0.0125m | 80 × 8 × 4 | 2560 | 3645 |
For a structured block, the theoretical counts are:
n_elements = div_x*div_y*div_z
n_nodes = (div_x+1)*(div_y+1)*(div_z+1)These equations provide a strong check: if they do not match, the resulting mesh does not have the structure that the script claimed to build.
L×H; convergence is decided with CSV, not visual smoothness.
Step 2 — ESIZE vs LESIZE
ESIZE,mesh_size(i)
ESIZE declares the default global size. MAPDL calculates divisions from
of that value, rounding them when necessary. However, a global control does not express
alone how we want to distribute elements in each direction.
LSEL,S,LENGTH,,beam_l
LESIZE,ALL,,,div_x(i),,1
LSEL,S,LENGTH,,beam_h
LESIZE,ALL,,,div_y(i),,1
LSEL,S,LENGTH,,beam_b
LESIZE,ALL,,,div_z(i),,1
ALLSEL,ALL
LSEL groups lines by geometric meaning, not by ID.
LESIZE,ALL applies integer divisions to selected lines. The argument
KFORC=1 forces you to replace any previous division, something necessary after
to clean one mesh and prepare the next.
Step 3 — Require mapped hexahedrons
MSHAPE,0,3D
MSHKEY,1
VMESH,ALL
MSHAPE,0,3D requests hexahedrons and MSHKEY,1 requires mapped meshing.
We do not use MSHKEY,2, because allowing a free mesh as an alternative could
hide a flaw in our preparation. The rectangular block is mappable and the edges
opposites receive the same number of divisions.
A free mesh is not "bad." Here we use a regular structure to isolate the effect of the size. In an industrial geometry, the strategy must adapt to the form.