]> SALOME platform Git repositories - modules/hydro.git/blob - doc/salome/tutorial/english/english_interpolationZ.rst
Salome HOME
Merge branch 'BR_PORTING_OCCT_7' into pre/V8_3_BR
[modules/hydro.git] / doc / salome / tutorial / english / english_interpolationZ.rst
1 ..
2    Copyright (C) 2015-2016 EDF
3
4    This file is part of SALOME HYDRO module.
5
6    SALOME HYDRO module is free software: you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation, either version 3 of the License, or
9    (at your option) any later version.
10
11    SALOME HYDRO module is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with SALOME HYDRO module.  If not, see <http://www.gnu.org/licenses/>.
18
19 #########################################
20 Z Interpolation
21 #########################################
22
23 .. |HYDROSolver| image:: /../_static/HYDROSolver.png
24    :align: middle
25    :width: 16pt
26    :height: 16pt
27
28 .. |genereInterpolz| image:: /../_static/genereInterpolz.png
29    :align: middle
30    
31 .. |Bottom| image:: /../_static/Bottom.png
32    :align: middle
33
34 .. |Capture_meshZ| image:: /../_static/Capture_meshZ.png
35    :align: middle
36
37
38 .. |occ_view_scaling| image:: /../_static/occ_view_scaling.png
39    :align: middle
40    :width: 16pt
41    :height: 16pt
42
43 The mesh generated in the previous step does not contain any information on the altitude. 
44 To supply the TELEMAC code with this data, a field containing the Z-coordinate of the nodes must be added to the mesh. 
45
46 The method for calculating the Z coordinate was described zone by zone in the calculation case set-up section of the HYDRO module. 
47
48 Calculation of the Z interpolation at the mesh nodes
49 ====================================================
50
51 The altitude field is constituted by means of the following Python script that must be generated and then run.
52
53 Le script utilise une association des régions du cas de calcul HYDRO aux groupes de noeuds correspondants dans le maillage.
54 Une commande du module HYDROSOLVER facilite la définition de cette association.
55
56 Il faut maintenant activer le module HYDROSOLVER, via la liste défilante des modules, ou son icône dans le bandeau : |HYDROSolver|.
57 Nous utilisons la commande *Generate interpolz.py* du menu *Hydro*.
58
59 Il faut sélectionner le cas de calcul dans la rubrique *HYDRO / CALCULATION CASE* de l'arbre d'étude.
60 Son nom apparaît dans la première ligne *Calculation cas* du dialogue.
61
62 Le chemin complet du script à créer doit être renseigné dans la rubrique *Output path* (le nom du script doit se terminer par .py).
63
64 Il faut désigner le fichier du maillage de départ construit à l'étape précédente dans rubrique *MED file*.
65
66 La valeur *Undefined Z* est utilisée quand le module HYDRO ne sait pas calculer l'altitude en un point.
67 C'est utilisé a postériori pour détecter d'éventuels problèmes de définition des zones de calcul dans le cas de calcul.
68
69 The interpolation of point clouds can be done in two ways, depending on whether the clouds are denser than the mesh, or vice versa.
70 For very dense point clouds, it suffices to take the altitude of the closest point in the cloud.
71 If the mesh is denser than the cloud, it is better to use linearised interpolation, obtained by previous triangulation of the point cloud. 
72 This last method is more accurate but slightly more costly, computationally. 
73
74 Il faut sélectionner les bons noms de régions en correspondance avec les noms des groupes de noeuds des faces,
75 en laissant la sélection à *None* pour les autres groupes.
76
77   |genereInterpolz|
78
79 The script produces several files, whose names are derived from the original file name of the mesh, with different suffixes, 
80 which are stored in the original file's directory: 
81
82  * garonne_1.med: original file (z coordinate = 0) 
83  * garonne_1.xyz: xyz file (ASCII) of the altitudes at the nodes 
84  * garonne_1Z.med: intermediate step of the script 
85  * garonne_1F.med: calculated value of the Z coordinate and “BOTTOM” field with the Z-value at each node 
86
87 To run the script, the HYDRO module for the study must be active. If resuming work on a study that was previously saved, 
88 the HYDRO module must be activated before running the script 
89 (simply select HYDRO at least once in order for the data stored in the study file to be read). 
90
91 The script is executed manually with the File / Load Script... menu command.
92 The script blocks the graphic interface during execution. 
93 It displays an execution trace in the Python console that is displayed by default in the GEOM and SMESH modules. 
94
95 It is also possible to edit the following script:
96
97 The script needs to be copied and modified as needed for the region names used in the calculation case and for the named groups of mesh nodes.
98
99 .. literalinclude:: ../interpolZ.py
100     :lines: 1-
101
102 Visualisation of the Z interpolation at the mesh nodes
103 ======================================================
104
105 Visualisation with the MED module
106 ---------------------------------
107
108 The MED module offers a simple field view of a MED mesh. 
109 The MED module must first be activated, then use the *File/Add Data Source* menu or the equivalent icon and find the *garonne_1F.med* file.
110 Expanding the *garonne_1F.med* object in the study tree will reveal the *HYDRO_Garonne_1* mesh and the *BOTTOM* field.
111
112 Select the field and click on the *scalar map* icon.
113
114 The field is displayed in 3D view. The 3D-view context menu contains the *Representation / Surface with Edges* command 
115
116   |Bottom|
117
118 Visualisation in the SMESH module
119 ---------------------------------
120
121 When the interpolation script finishes running, the *HYDRO_Garonne_1* mesh should appear a second time, with a different icon,
122 underneath the first instance in the study tree. If it is not visible, use the *Refresh* command in the study tree context menu
123 to update the file list.
124
125 The second mesh is displayed in the SMESH module using the *show* command. For a better relief view, the Z scale needs to be modified 
126 with the 3D view icon |occ_view_scaling| . In this case, scaling the Z-axis by a factor of 3 is sufficient.
127
128 *Remember*: objects are manipulated in 3D view using the <CTRL> key and the mouse buttons or the mouse wheel for zooming.
129
130 The following is a group view corresponding to the study regions:
131
132   |Capture_meshZ|
133
134 .. only:: html
135
136    :ref:`ref_exempleInondation`