This functions gives the position of the vertices that form segments. The position is computed to insure a geometrical increase of the distance between a vertex and its next.
if symmetricalMesh is true, the mesh is symmetrical on both sides of the middle of the domain. In that case, one of the two different processes are run depending on whether the number of nodes (segments) N is even or not.
The distance between vertices derives for odd number of segments:
The distance between vertices derives for even number of segments:if symmetricalMesh is false, the mesh grows from the start to the end of the domain. The distance between vertices derives:
Where :
A mesh divided into N segments contains N+1 vertices. That is why the size of x is N+1.
function geometricalGrowthGrid input Modelica.SIunits.Length L "Length of the domain to mesh"; input Integer N "number of segments"; input Real q "Growth rate"; input Boolean symmetricalMesh = true "Axial symmetry mesh where the axis is the middle of the domain"; output Modelica.SIunits.Position x[N + 1] "Vector of vertice position"; end geometricalGrowthGrid;