From: Paul RASCLE Date: Wed, 12 Jul 2017 14:42:00 +0000 (+0200) Subject: correction de la documentation : utilisation des groupes de mailles pour les interpol... X-Git-Tag: Salome_8_3_Hydro_1_1rc1~1^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fpre%2FV8_3_BR_izf;p=modules%2Fhydro.git correction de la documentation : utilisation des groupes de mailles pour les interpolations Z --- diff --git a/doc/salome/tutorial/english/english_interpolationZ.rst b/doc/salome/tutorial/english/english_interpolationZ.rst index 1b88e0fb..0470ed4f 100644 --- a/doc/salome/tutorial/english/english_interpolationZ.rst +++ b/doc/salome/tutorial/english/english_interpolationZ.rst @@ -50,7 +50,7 @@ Calculation of the Z interpolation at the mesh nodes The altitude field is constituted by means of the following Python script that must be generated and then run. -In the script, the regions of the HYDRO calculation case are associated to the corrresponding nodes group of the mesh. +In the script, the regions of the HYDRO calculation case are associated to the corrresponding faces group of the mesh. A specific command in HYDROSOLVER module helps to build this association. The HYDROSOLVER module is activated with a selection in the module list (combo box) or its icon in the toolbar: |HYDROSolver|. @@ -71,8 +71,8 @@ For very dense point clouds, it suffices to take the altitude of the closest poi If the mesh is denser than the cloud, it is better to use linearised interpolation, obtained by previous triangulation of the point cloud. This last method is more accurate but slightly more costly, computationally. -The region names must be selected in correspondance of their group nodes (representing the same geometric face), -and, for the other node groups, the selection should be *None*. +The region names must be selected in correspondance of their group of faces (representing the same geometric face), +and, for the other groups, the selection should be *None*. |genereInterpolz| @@ -80,10 +80,11 @@ The script produces several files, whose names are derived from the original fil which are stored in the original file's directory: * garonne_1.med: original file (z coordinate = 0) - * garonne_1.xyz: xyz file (ASCII) of the altitudes at the nodes - * garonne_1Z.med: intermediate step of the script + * garonne_1.xyz: xyz file (ASCII) of the altitudes at the nodes *(optional)* * garonne_1F.med: calculated value of the Z coordinate and “BOTTOM” field with the Z-value at each node +**Remark** : The Z coordinate on mesh nodes is not used by TELEMAC, but is useful for visual control in SMESH. + To run the script, the HYDRO module for the study must be active. If resuming work on a study that was previously saved, the HYDRO module must be activated before running the script (simply select HYDRO at least once in order for the data stored in the study file to be read). @@ -94,7 +95,7 @@ It displays an execution trace in the Python console that is displayed by defaul It is also possible to edit the following script: -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. +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 faces. .. literalinclude:: ../interpolZ.py :lines: 1- diff --git a/doc/salome/tutorial/interpolStrickler.py b/doc/salome/tutorial/interpolStrickler.py index 80fc6cb4..d313577e 100644 --- a/doc/salome/tutorial/interpolStrickler.py +++ b/doc/salome/tutorial/interpolStrickler.py @@ -6,9 +6,18 @@ # --- nom du cas dans HYDRO nomCas = 'garonne_1' -# --- fichier med 2D(x,y) du cas, produit par SMESH -fichierMaillage = '/tmp/garonne_1F.med' +# --- fichier en entrée :fichier med après interpolation en Z, complété par défaut avec le champ 'BOTTOM FRICTION' +fichierMaillage_in = '/tmp/garonne_1F.med' from salome.hydrotools.interpolS import assignStrickler -assignStrickler(nomCas, fichierMaillage, '/tmp/garonne_1F.med', 'BOTTOM FRICTION') +assignStrickler(nomCas, fichierMaillage_in) + +""" +# --- il est possible de mettre un fichier différent en sortie, un nom de champ différent du défaut ('BOTTOM FRICTION') +# --- output_file_name : optionnel, fichier en sortie : le même (par défaut) ou différent +fichierMaillage_out = fichierMaillage_in +# --- med_field_name : optionnel, nom du champ des coefficients de Strickler, défaut = 'BOTTOM FRICTION' +nomChamp = 'BOTTOM FRICTION' +assignStrickler(nomCas, fichierMaillage_in, output_file_name=fichierMaillage_out, med_field_name=nomChamp) +""" \ No newline at end of file diff --git a/doc/salome/tutorial/interpolZ.py b/doc/salome/tutorial/interpolZ.py index cbee01a1..728286bb 100644 --- a/doc/salome/tutorial/interpolZ.py +++ b/doc/salome/tutorial/interpolZ.py @@ -34,10 +34,7 @@ salome.salome_init() theStudy = salome.myStudy theStudyId = salome.myStudyId -from salome.hydrotools.interpolZ import interpolZ, createZfield2 +from salome.hydrotools.interpolZ import interpolZ # --- Z interpolation Z sur la bathymetrie/altimetrie aux noeuds du maillage statz = interpolZ(nomCas, fichierMaillage, dicoGroupeRegion, zUndef, interpolMethod) - -# --- ajout d'un champ aux noeud, de nom "BOTTOM", content les valeurs Z -createZfield2(fichierMaillage) diff --git a/doc/salome/tutorial/interpolationZ.rst b/doc/salome/tutorial/interpolationZ.rst index 3813afc3..faaf79ad 100644 --- a/doc/salome/tutorial/interpolationZ.rst +++ b/doc/salome/tutorial/interpolationZ.rst @@ -53,7 +53,7 @@ Calcul de l'interpolation en Z aux noeuds du maillage La constitution du champ d'altitude se fait au moyen d'un script Python, qu'il faut préparer, puis exécuter. -Le script utilise une association des régions du cas de calcul HYDRO aux groupes de noeuds correspondants dans le maillage. +Le script utilise une association des régions du cas de calcul HYDRO aux groupes de faces correspondants dans le maillage. Une commande du module HYDROSOLVER facilite la définition de cette association. Il faut maintenant activer le module HYDROSOLVER, via la liste défilante des modules, ou son icône dans le bandeau : |HYDROSolver|. @@ -76,7 +76,7 @@ Quand le maillage est plus dense que le nuage, il vaut mieux prendre l'altitude une triangulation préalable du nuage de points. Cette dernière méthode est plus précise mais un peu plus coûteuse. -Il faut sélectionner les bons noms de régions en correspondance avec les noms des groupes de noeuds des faces, +Il faut sélectionner les bons noms de régions en correspondance avec les noms des groupes de faces, en laissant la sélection à *None* pour les autres groupes. |genereInterpolz| @@ -85,10 +85,12 @@ Le script produit plusieurs fichiers dont le nom se déduit du nom du fichier ma avec des suffixes différents, rangés dans le répertoire du fichier d'origine : * garonne_1.med : fichier d'origine (coordonnée z = 0) -* garonne_1.xyz : fichier xyz (ASCII) des altitudes aux noeuds -* garonne_1Z.med : étape intermédiaire du script +* garonne_1.xyz : fichier xyz (ASCII) des altitudes aux noeuds *(optionnel)* * garonne_1F.med : coordonnée Z à sa valeur calculée, et champ "BOTTOM" avec la valeur Z aux noeuds +**Remarque** : La modification de la coordonnée Z des noeuds du maillage n'est pas nécessaire à TELEMAC, +mais utile pour une visualisation de contrôle du maillage. + Pour exécuter le script, il faut que le module HYDRO soit bien actif dans l'étude. **Si l'on reprend une étude précédemment sauvegardée, il faut avoir activé le module HYDRO avant de lancer le script** (il suffit de sélectionner HYDRO au moins une fois, @@ -101,7 +103,7 @@ Python qui est affichée par défaut dans les modules GEOM et SMESH. Il est aussi possible d'adapter manuellement le script ci-dessous : Il faut recopier le script et l'adapter en fonction des noms de régions utilisés dans le cas de calcul -et des noms de groupes de noeuds dans le maillage. +et des noms de groupes de faces dans le maillage. .. literalinclude:: interpolZ.py :lines: 1-