Salome HOME
Revert "Adding Multinode method for smesh parallelism + cleanup and doc"
[modules/smesh.git] / doc / gui / input / cartesian_algo.rst
1 .. _cartesian_algo_page:
2
3 *********************************
4 Body Fitting 3D meshing algorithm
5 *********************************
6
7 Body Fitting algorithm generates hexahedrons of a Cartesian grid in
8 the internal part of geometry and polyhedrons and other types of
9 elements at the intersection of Cartesian cells with the geometrical
10 boundary. The algorithm supports construction of 
11 :ref:`viscous boundary layers<cartesian_VL_anchor>` (use 
12 :ref:`Viscous Layers hypothesis <viscous_layers_anchor>` to define them).
13
14 .. image:: ../images/cartesian3D_sphere.png 
15         :align: center
16
17 .. centered::
18         A sphere meshed by Body Fitting algorithm
19
20 The meshing algorithm is as follows.
21
22 #. Lines of a Cartesian structured grid defined by :ref:`Body Fitting Parameters <cartesian_hyp_anchor>` hypothesis are intersected with the geometry boundary, thus nodes lying on the boundary are found. This step also allows finding out for each node of the Cartesian grid if it is inside or outside the geometry. 
23 #. For each cell of the grid, check how many of its nodes are outside of the geometry boundary. Depending on a result of this check
24
25    * skip a cell, if all its nodes are outside 
26    * skip a cell, if it is too small according to **Size Threshold** parameter
27    * add a hexahedron in the mesh, if all nodes are inside 
28    * add a polyhedron or another cell type in the mesh, if some nodes are inside and some outside.  
29
30 .. _cartesian_VL_anchor:
31
32 **Viscous boundary layers** are constructed as follows:
33
34    * create an offset geometry with offset value equal to full layers thickness by using BRepOffset_MakeOffset OCCT class;
35    * mesh the offset geometry with the Body Fitting algorithm;
36    * create prisms of the layers by projecting boundary nodes of offset geometry onto the boundary of initial geometry.
37
38 .. note:: Viscous layers can't be constructed on geometry with **shared/internal** faces.
39
40 To apply the algorithm when you define your mesh, select **Body Fitting** in the list of 3D algorithms and add **Body Fitting  Parameters** hypothesis. The following dialog will appear:
41
42 .. _cartesian_hyp_anchor:
43
44 Body Fitting Parameters hypothesis
45 ##################################
46
47 .. image:: ../images/cartesian3D_hyp.png 
48         :align: center
49
50 .. centered::
51         Body Fitting Parameters hypothesis dialog
52
53 This dialog allows to define
54
55 * **Name** of the algorithm. 
56 * Minimal size of a cell truncated by the geometry boundary. If the size of a truncated grid cell is **Threshold** times less than a initial cell size, then a mesh element is not created. 
57 * **Implement Edges** check-box activates incorporation of geometrical edges in the mesh.
58   
59         .. image:: ../images/cartesian_implement_edge.png 
60                 :align: center
61
62         .. centered::
63                 Implement Edges switched off to the left and on to the right
64
65 * **Create Faces** check-box activates creation on mesh faces.
66 * **Consider Shared and Internal Faces** check-box activates treatment of faces shared by solids and internal. By default the algorithm considers only outer boundaries of the geometry.
67 * **Apply Threshold to Shared / Internal Faces** check-box activates application of **Threshold** to cells cut by shared and internal faces, that can cause appearance of holes inside the mesh.
68 * **Definition mode** allows choosing how Cartesian structured grid is defined. Location of nodes along each grid axis is defined individually:
69     
70         * You can specify the **Coordinates** of grid nodes. **Insert** button inserts a node at **Step** distance (negative or positive) from the selected node. **Delete** button removes the selected node. Double click on a coordinate in the list enables its edition. **Note** that node coordinates are measured along directions of axes that can differ from the directions of the Global Coordinate System.
71         * You can define the **Spacing** of a grid as an algebraic formula *f(t)* where *t* is a position along a grid axis normalized at [0.0,1.0]. *f(t)* must be non-negative at 0. <= *t* <= 1. The whole extent of geometry can be divided into ranges with their own spacing formulas to apply; a t varies between 0.0 and 1.0 within each **Range**. **Insert** button divides a selected range into two. **Delete** button adds the selected sub-range to the previous one. Double click on a range in the list enables edition of its right boundary. Double click on a function in the list enables its edition.
72
73 .. note:: The actual grid spacing can slightly differ from the defined one. This is done for the best fitting of polyhedrons and for a better mesh quality on the interval boundaries. For example, if a constant **Spacing** is defined along an axis, the actual grid will fill the shape's dimension L along this axis with round number of equal cells: Spacing_actual = L / round( L / Spacing_defined ).
74   
75 * **Fixed Point** group allows defining an exact location of a grid node in the direction defined by spacing. The following cases are possible:
76    
77         * If all three directions are defined by spacing, there will be a mesh node at the **Fixed Point**. 
78         * If two directions are defined by spacing, there will be at least a link between mesh nodes passing through the **Fixed Point**. 
79         * If only one direction is defined by spacing, there will be at least an element facet passing through the **Fixed Point**.
80         * If no directions are defined by spacing, **Fixed Point** is disabled.
81         
82 * **Directions of Axes** group allows setting the directions of grid axes.
83    
84         * If **Orthogonal Axes** check-box is activated the axes remain orthogonal during their modification. 
85         * Selection buttons enable snapping corresponding axes to direction of a geometrical edge selected in the Object Browser. Edge direction is defined by coordinates of its end points.
86         * **Optimal Axes** button runs an algorithm that tries to set the axes to maximize the number of generated hexahedra.
87         * **Reset** button returns the axes in a default position parallel to the axes of the Global Coordinate System. 
88   
89   
90  
91
92 **See Also** a sample TUI Script of a :ref:`tui_cartesian_algo`.
93