What is Mesh?
A connected 2D, 3D, or multi-dimension structure that is made up of points, lines, and curves is called mesh. In real-world meshes are made up of many different materials such as metals, fibers, and ductile materials. For example, the image is shown below:
3D mesh:
Methods:
Method | Parameter |
Description
|
---|---|---|
initialize() | None | Initialize the gmsh |
add_point () | x, y, z, lc | Create a point at (x, y, z) with the target mesh size (lc) close to point |
add_line() | pointA, pointB | Create a line from pointA, to pointB |
add_curve_loop() | list of lines | Create a face that is formed by lines |
add_plane_suface() | list of faces | Create a surface on the face and connect face surfaces |
synchronize() | None | Create the relevant Gmsh data structures from the Gmsh model. Synchronizations can be called at any time, but to reduce processing time it’s better to call after adding points, lines, curves, surfaces etc. |
generate() | None | Generate the mesh |
write() | Model name | Create a mesh of given model name for example “GFG.msh” |
run() | None | Creates graphical user interface |
finalize() | None | It finalizes the Gmsh API |
After understanding mesh and functions it’s time to create the above mesh. So without further delay, let’s jump right in.
How to Generate mesh in Python with Gmsh module?
In this article, we will cover how to Generate meshes using Gmsh module in Python.
Contact Us