]> SALOME platform Git repositories - modules/hexablock.git/blob - doc/tui_cartgrid.rst
Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/hexablock.git] / doc / tui_cartgrid.rst
1 :tocdepth: 3
2
3
4 .. _tuicartgrid:
5
6 ====================
7 Make cartesian grids
8 ====================
9
10 To add a cartesian grid to the model, the following data are required:
11
12 - the vertex of the initial hexahedron: *pt*
13 - the vectors corresponding to the diametrically opposite vertices to the initial vertex: *vx, vy, vz*
14 - the number of repetition of this hexahedra along the three axes: *ni, nj, nk*
15
16 Make a Cartesian grid::
17
18     elts = doc.makeCartesian(pt, vx, vy, vz, ni, nj, nk)
19
20 or::
21
22     elts = doc.makeCartesian1(pt, vec1, px, py, pz, mx, my, mz)
23
24
25 Access to the number of elements of the grid::
26
27     vn = elts.countVertex()
28     en = elts.countEdge()
29     qn = elts.countQuad()
30     hn = elts.countHexa()
31
32 Access to all elements of the grid::
33
34     vi = elts.getVertex(i)
35     ej = elts.getEdge(j)
36     qk = elts.getQuad(k)
37     hl = elts.getHexa(l)
38
39 Specialized access to all vertices of the grid::
40
41     ve_xyz = elts.getVertexIJK(i, j, k)
42     
43     with:
44         0 <= i < ni+1
45         0 <= j < nj+1
46         0 <= k < nk+1
47
48 Specialized access to all edges // vx axis of the grid::
49
50     ed_a = elts.getEdgeI(i, j, k)
51     
52     with:
53         0 <= i < ni
54         0 <= j < nj+1
55         0 <= k < nk+1
56
57 Specialized access to all edges // vy axis of the grid::
58
59     ed_b = elts.getEdgeJ(i, j, k)
60     
61     with:
62         0 <= i < ni+1
63         0 <= j < nj
64         0 <= k < nk+1
65
66 Specialized access to all edges // vz axis of the grid::
67
68     ed_c = elts.getEdgeK(i, j, k)
69     
70     with:
71         0 <= i < ni+1
72         0 <= j < nj+1
73         0 <= k < nk
74
75 Specialized access to all quadrangles // on plane vx, vy::
76
77     qu_a = elts.getQuadIJ(i, j, k)
78
79     with:
80         0 <= i < ni
81         0 <= j < nj
82         0 <= k < nk+1
83
84 Specialized access to all quadrangles // on plane vx, vz::
85
86     qu_b = elts.getQuadIK(i, j, k)
87     
88     with:
89         0 <= i < ni
90         0 <= j < nj+1
91         0 <= k < nk
92
93 Specialized access to all quadrangles // on plane vy, vz::
94
95     qu_c = elts.getQuadJK(i, j, k)
96     
97     with:
98         0 <= i < ni+1
99         0 <= j < nj
100         0 <= k < nk
101
102 Specialized access to all hexahedra of the grid::
103
104     he_xyz = elts.getHexaIJK(i, j, k)
105     
106     with:
107         0 <= i < ni
108         0 <= j < nj
109         0 <= k < nk
110
111 Example
112 -------
113
114 ::
115     
116     import hexablock
117     doc = hexablock.addDocument()
118
119     orig = doc.addVertex(0, 0, 0)
120
121     dx = doc.addVector(1, 0, 0)
122     dy = doc.addVector(0, 1, 0)
123     dz = doc.addVector(0, 0, 1)
124
125     ni = 15 
126     nj = 12
127     nk = 8
128
129     grid = doc.makeCartesian(orig, dx, dy, dz, ni, nj, nk)
130
131
132 .. image:: _static/cartgrid3.png
133    :align: center
134
135 .. centered::
136    Cartesian Grid
137
138
139 GUI command: :ref:`guicartgrid`