.. _basic_meshing_algos_page:

************************
Basic meshing algorithms
************************

The MESH module contains a set of meshing algorithms, which are	used for meshing entities (1D, 2D, 3D sub-shapes) composing geometrical objects.

.. note:: Algorithms added to the module as plug-ins are described in documentation of the plug-ins (menu **Help / User's Guide / Mesh module / Plugins**).

An algorithm represents either an implementation of a certain meshing technique or an interface to the whole meshing program generating elements of several dimensions.

.. _a1d_algos_anchor:

* For meshing of 1D entities (**edges**):

  * **Wire Discretization** meshing algorithm - splits an edge into a number of mesh segments following an 1D hypothesis.
  * **Composite Side Discretization** algorithm - allows to apply a 1D hypothesis to a whole side of a geometrical face even if it is composed of several edges provided that they form C1 curve in all faces of the main shape.

* For meshing of 2D entities (**faces**):

  * **Triangle: Mefisto** meshing algorithm - splits faces into triangular elements.
  * :ref:`Quadrangle: Mapping <quad_ijk_algo_page>` meshing algorithm - splits faces into quadrangular elements.

		.. image:: ../images/image123.gif
			:align: center 

		.. centered::
			Example of a triangular 2D mesh

		.. image:: ../images/image124.gif 
			:align: center 

		.. centered::
			Example of a quadrangular 2D mesh

* For meshing of 3D entities (**solid objects**):

  * **Hexahedron (i,j,k)** meshing algorithm - solids are split into hexahedral elements thus forming a structured 3D mesh. The algorithm requires that 2D mesh generated on a solid could be considered as a mesh of a box, i.e. there should be eight nodes shared by three quadrangles and the rest nodes should be shared by four quadrangles.
			.. image:: ../images/hexa_ijk_mesh.png 
				:align: center 

    .. centered::
       Structured mesh generated by Hexahedron (i,j,k) on a solid bound by 16 faces

  * :ref:`Body Fitting <cartesian_algo_page>` meshing algorithm - solids are split into hexahedral elements forming a Cartesian grid; polyhedra and other types of elements are generated where the geometrical boundary intersects Cartesian cells.

  Some 3D meshing algorithms, such as Hexahedron(i,j,k) also can
  generate 3D meshes from 2D meshes, working without geometrical objects.

* There is also a number of more specific algorithms:

   * :ref:`Extrusion 3D <prism_3d_algo_page>` - for meshing prismatic 3D shapes with hexahedra and prisms.
   * :ref:`Quadrangle: Medial Axis Projection <quad_from_ma_algo_page>` - for quadrangle meshing of faces with sinuous borders and rings.
   * **Polygon per Face** meshing algorithm - generates one mesh face (either a triangle, a quadrangle or a polygon) per a geometrical face using all nodes from the face boundary.
   * :ref:`Projection algorithms <projection_algos_page>` - for meshing by projection of another mesh.
   * :ref:`Import algorithms <import_algos_page>` - for meshing by importing elements from another mesh.
   * :ref:`Radial Prism <radial_prism_algo_page>` - for meshing 3D geometrical objects with cavities with hexahedra and prisms.
   * :ref:`Radial Quadrangle 1D-2D <radial_quadrangle_1D2D_algo_page>` - for quadrangle meshing of disks and parts of disks.
   * :ref:`Use Faces/Edges to be Created Manually <use_existing_page>` - to create a 1D or a 2D mesh in a python script.
   * :ref:`Segments around Vertex <segments_around_vertex_algo_page>` - for defining the length of mesh segments around certain vertices.


:ref:`constructing_meshes_page` page describes in detail how to apply meshing algorithms.

**See Also** a sample TUI Script of a :ref:`tui_defining_meshing_algos` operation.  


.. toctree::
   :maxdepth: 2
   :hidden:

   quad_ijk_algo.rst
   cartesian_algo.rst
   prism_3d_algo.rst
   quad_from_ma_algo.rst
   projection_algos.rst
   use_existing_algos.rst
   radial_prism_algo.rst
   radial_quadrangle_1D2D_algo.rst
   define_mesh_by_script.rst
   segments_around_vertex_algo.rst

