Generating nonuniform meshes with sizefunction
Posted April 18, 2012 at 22:57 by sunliming
Tags hyperbolic function, mesh
Generating nonuniform meshes with sizefunction
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
Quote:
Hello Ehsan,
the trick is exactly the one explained by Hrvoje in this thread.
Create a uniform mesh, with the number of nodes you need in the three directions. Then write a small utility which:
- Reads the mesh (see how this is done in all solvers or mesh manipulation utilities).
- Does
pointField newPoints = mesh.points();
forAll (newPoints, i)
{
// Your code here, calculate the point position
}
mesh.movePoints(newPoints);
mesh.write();
using an analytical expression to relate the position of a node in a uniform grid to the new position (this is commonly done to generate grids for channel flow simulations).
Regards,
Alberto
the trick is exactly the one explained by Hrvoje in this thread.
Create a uniform mesh, with the number of nodes you need in the three directions. Then write a small utility which:
- Reads the mesh (see how this is done in all solvers or mesh manipulation utilities).
- Does
pointField newPoints = mesh.points();
forAll (newPoints, i)
{
// Your code here, calculate the point position
}
mesh.movePoints(newPoints);
mesh.write();
using an analytical expression to relate the position of a node in a uniform grid to the new position (this is commonly done to generate grids for channel flow simulations).
Regards,
Alberto
Total Comments 0