1 # -*- coding: utf-8 -*-
2 # --------------------------------------------------
3 # Copyright (C) 2007-2021 EDF R&D
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # --------------------------------------------------
27 from decimal import Decimal
28 # repertoire ou sont stockés le catalogue carmel3d
29 # et les fichiers de donnees des materiaux de reference
30 from prefs_CARMEL3D import repIni
33 def __init__(self,ntuple):
36 def __convert__(self,valeur):
37 if type(valeur) == types.StringType:
39 if len(valeur) != self.ntuple:
44 return "Tuple de %s elements" % self.ntuple
48 #print "catalogue carmel"
49 #print "repIni = ", repIni
51 # Version du catalogue
52 VERSION_CATA = "Code_Carmel3D 2.4.0 for harmonic problems"
53 # --------------------------------------------------
54 # definition d une classe pour les materiaux
55 # definition d une classe pour les sources
56 # definition d une classe pour les groupes de mailles
57 # --------------------------------------------------
58 class material ( ASSD ) : pass
59 class source ( ASSD ) : pass
60 class grmaille ( ASSD ) : pass
61 class stranded_inductor_geometry ( ASSD ) : pass
62 class macro_groupe ( ASSD ) : pass
65 # --------------------------------------------------
66 # déclaration du jeu de commandes : 1ere instruction du catalogue obligatoire
67 #---------------------------------------------------
69 ##=========================================================
70 JdC = JDC_CATA ( code = 'CARMEL3D',
73 AU_MOINS_UN ('PARAMETERS'),
74 AU_PLUS_UN ('PARAMETERS'),
75 AU_MOINS_UN ('SOLVEUR'),
76 AU_PLUS_UN ('SOLVEUR'),
77 AU_MOINS_UN ('POST_COMMANDS'),
78 AU_PLUS_UN ('POST_COMMANDS'),
79 AU_MOINS_UN ('MATERIAL','INCLUDE'),
80 AU_MOINS_UN ('SOURCE','INCLUDE'),
81 AU_MOINS_UN ('MESHGROUP'),
87 #======================================================================
88 # 1er bloc : bloc VERSION
89 # ce bloc est volontairement cache dans l IHM
90 #===================================================
92 VERSION = PROC ( nom = "VERSION",
95 UIinfo= {"groupes":("CACHE",)},
96 ang= "version block definition",
98 #----------------------
99 # Liste des parametres
100 #----------------------
102 NUM = SIMP (statut="o",
105 ang="version number of the physical model",
108 FILETYPE = SIMP (statut="o",
117 PARAMETERS= PROC ( nom = "PARAMETERS",
120 UIinfo = { "groupes" : ( "1) Parametres", ) },
121 ang= "General parameters for this study",
122 fr= u"Paramètres généraux de l'étude",
123 #----------------------
124 # Liste des parametres
125 #----------------------
126 RepCarmel=SIMP(typ='Repertoire', statut='o',
127 ang= "Code_Carmel3D executables directory",
128 fr= u"Répertoire contenant les programmes de Code_Carmel3D",
130 Fichier_maillage = SIMP (statut="o", typ=("FichierNoAbs",'All Files (*)',), # l'existence du fichier n'est pas vérifiée
131 ang="Mesh file path (relative, aka file name, or absolute path).",
132 fr =u"Emplacement du fichier contenant le maillage (relatif, i.e., nom du fichier, ou absolu, i.e., chemin complet).",
135 Echelle_du_maillage = SIMP (statut='o', typ="TXM", defaut= "Millimetre", into = ("Metre", "Millimetre"),
136 ang="Mesh geometry units.",
137 fr =u"Unités géométriques du maillage.",
140 Formulation=SIMP(statut='o', typ='TXM', into=("TOMEGA","APHI"),
141 ang="Problem formulation.",
142 fr =u"Formulation du problème.",
145 FREQUENCY = SIMP (statut="o",
148 ang = "enter the source frequency value, in Hz units",
149 fr = u"saisir la valeur de la fréquence de la source, en Hz",
153 Realiser_topologie_gendof = SIMP (statut='o', typ="TXM", defaut="TRUE", into=("TRUE", "FALSE"),
154 ang="Build topology (.car file) using gendof.exe.",
155 fr =u"Construction de la topologie (fichier .car) en éxécutant gendof.exe.",
157 Resoudre_probleme = SIMP (statut='o', typ="TXM", defaut="TRUE", into=("TRUE", "FALSE"),
158 ang="Solve the problem using fcarmel.exe.",
159 fr =u"Résolution du problème en éxécutant fcarmel.exe.",
162 Realiser_post_traitement_aposteriori = SIMP (statut='o', typ="TXM", defaut="TRUE", into=("TRUE", "FALSE"),
163 ang="Make post-processing using postprocess.exe.",
164 fr =u"Réalisation du post-traitement en éxécutant postprocess.exe.",
166 ) # Fin PROC PARAMETERS
168 SOLVEUR = PROC ( nom ="SOLVEUR",
171 UIinfo= {"groupes":("1) Parametres",)},
172 ang= "Solver parameters for this study",
173 fr= u"Paramètres liés au solveur de l'étude",
175 Type= SIMP (statut="o",
177 into=("Solveur_lineaire"),
178 defaut='Solveur_lineaire',
179 ang="Linear solver only for harmonic problems.",
180 fr =u"Solveur linéaire seulement pour les problèmes fréquentiels.",
183 Solveur_lineaire=BLOC(condition="Type=='Solveur_lineaire'",
184 ang="This block contains whole linear solver properties.",
185 fr =u"Ce bloc contient toutes les propriétés du solveur linéaire.",
186 Methode_lineaire=SIMP(statut='o', typ='TXM', into=("Methode iterative BICGCR", "Methode directe MUMPS"),
187 ang="Algorithm used for this linear solver.",
188 fr =u"Méthode (algorithme) utilisée par ce solveur linéaire.",
191 Parametres_methode_iterative_BICGCR=BLOC(condition="Methode_lineaire=='Methode iterative BICGCR'",
192 ang="This block contains whole BICGCR algorithm properties used for the linear solver.",
193 fr =u"Ce bloc contient toutes les propriétés de la méthode BICGCR utilisée par le solveur linéaire.",
194 Precision=SIMP(statut='o', typ='R', defaut=1e-9,
195 ang="Accuracy on linear computations.",
196 fr =u"Précision du calcul linéaire.",
198 Nombre_iterations_max=SIMP(statut='o', typ='I',defaut=10000,
199 ang="Maximal number of iterations.",
200 fr =u"Nombre maximal d'itérations.",
202 Preconditionneur=SIMP(statut='f', typ='TXM', into=("Jacobi"), defaut='Jacobi',
203 ang="Preconditioner choice. Jacobi only.",
204 fr =u"Choix du préconditioneur. Jacobi disponible seulement.",
208 Parametres_methode_directe_MUMPS=BLOC(condition="Methode_lineaire=='Methode directe MUMPS'",
209 ang="This block contains whole MUMPS properties used for the linear solver.",
210 fr =u"Ce bloc contient toutes les propriétés de la méthode MUMPS utilisée par le solveur linéaire.",
211 Type_de_matrice=SIMP(statut='o', typ='I', defaut=2,
212 ang="Matrix type (symetry). 2: symetric. Please refer to MUMPS documentation.",
213 fr =u"Type de matrice (symétrie). Choisir 2 pour une matrice symétrique. Expliqué dans la documentation MUMPS.",
215 ICNTL_Control_Parameters=SIMP(statut='o', typ='I', defaut=7,
216 ang="ICNTL control parameter. Please refer to MUMPS documentation.",
217 fr =u"Paramètre de contrôle ICNTL. Expliqué dans la documentation MUMPS.",
219 CNTL_Control_Parameters=SIMP(statut='o', typ='I', defaut=5,
220 ang="CNTL control parameter. Please refer to MUMPS documentation.",
221 fr =u"Paramètre de contrôle CNTL. Expliqué dans la documentation MUMPS.",
227 POST_COMMANDS = PROC ( nom = "POST_COMMANDS",
230 UIinfo = { "groupes" : ( "1) Parametres", ) },
231 ang= "post-processing commands .cmd or .post file",
232 fr= u"fichiers .cmd ou .post de commandes de post-traitement",
233 # Sous-parties, moins indentées pour améliorer la lisibilité
235 GLOBAL = FACT ( statut="f",
236 ang ="Post-processing of global quantities",
237 fr =u"Post-traitement des grandeurs globales",
239 # Carte de tous les champs possibles
240 VISU = FACT ( statut="f",
241 ang ="Post-processing of field maps",
242 fr =u"Post-traitement des cartes de champ",
243 VISU_Format=SIMP(statut='o', typ='TXM', into=("MED", "VTK"), defaut="MED"),
244 VISU_Type=SIMP(statut='o', typ='TXM', into=("ELEMENT", "NOEUD"), defaut="ELEMENT"),
247 CUTLINE = FACT ( statut="f",
248 ang = "Post-processing of one cutline",
249 fr = u"Post-traitement d'une ligne de coupe",
250 first_point = SIMP(statut='o',
251 typ = Tuple(3),validators = VerifTypeTuple(('R','R','R')),
252 ang="First point of the cutline (cartesian coordinates).",
253 fr=u"Point de départ (premier point) de la ligne de coupe (coordonnées cartésiennes).",
256 last_point = SIMP(statut='o', typ='R', min=3, max=3,
257 ang="Last point of the cutline (cartesian coordinates).",
258 fr=u"Point d'arrivée (dernier point) de la ligne de coupe (coordonnées cartésiennes)."
260 number_of_points = SIMP(statut='o', typ='I',
261 ang="Number of points of the cutline.",
262 fr=u"Nombre de points de la ligne de coupe."
264 name = SIMP(statut='o', typ='TXM',
265 ang="Name of the cutline, used in the output filename.",
266 fr=u"Nom de la ligne de coupe, utilisé dans le nom du fichier de sortie."
268 field = SIMP(statut='o', typ='TXM', into=("H", "B", "J", "E"),
269 ang="Field on which the cutline is applied.",
270 fr=u"Champ pour lequel la ligne de coupe est définie."
274 CUTPLANE = FACT ( statut="f",
275 ang = "Post-processing of one cutplane",
276 fr = u"Post-traitement d'un plan de coupe",
277 normal_vector = SIMP(statut='o', typ='TXM', into=("Ox", "Oy", "Oz"),
278 ang="Cutplane normal vector, i.e., perpendicular axis, 3 possible cartesian values: Ox, Oy, Oz.",
279 fr=u"Vecteur normal au plan de coupe, i.e., son axe perpendiculaire, parmi les 3 valeurs cartésiennes Ox, Oy et Oz."
281 plane_position = SIMP(statut='o', typ='R',
282 ang="Cutplane position, i.e., its coordinate along the normal vector axis.",
283 fr=u"Position du plan de coupe, i.e., coordonnée le long de l'axe de vecteur normal."
285 number_of_points = SIMP(statut='o', typ='I', min=2, max=2,
286 ang="Number of points on the cutplane, which define a cartesian grid along its canonical directions, e.g., Ox and Oy if plane normal to Oz.",
287 fr=u"Nombre de points sur le plan de coupe dans les deux directions (grille cartésienne), e.g., Ox et Oy si le plan est normal à Oz."
289 name = SIMP(statut='o', typ='TXM',
290 ang="Name of the cutplane, used in the output filename.",
291 fr=u"Nom du plan de coupe, utilisé dans le nom du fichier de sortie."
293 field = SIMP(statut='o', typ='TXM', into=("H", "B", "J", "E"),
294 ang="Field on which the cutplane is applied.",
295 fr=u"Champ pour lequel le plan de coupe est défini."
299 ) # Fin PROC POST_COMMANDS
302 #======================================================================
303 # le fichier .PHYS contient 3 blocs et jusqu'a 3 niveaux de sous-blocs
305 #======================================================================
307 #===================================================================
308 # 2eme bloc : bloc MATERIALS
309 #===================================================================
310 # definition des matériaux utilisateurs
311 # a partir des materiaux de reference ou de materiaux generiques
312 #-------------------------------------------------------------------
314 MATERIAL = OPER (nom = "MATERIAL",
317 UIinfo = { "groupes" : ( "2) Proprietes", ) },
318 ang= "real material block definition",
319 fr= u"définition d'un matériau réel",
321 # regles=EXCLUS('PERMITTIVITY','CONDUCTIVITY'),
323 #---------------------------------------------------------------------
324 # liste des matériaux de reference fournis par THEMIS et des
325 # materiaux generiques (les materiaux generiques peuvent etre utilises
326 # si aucun materiau de reference ne convient)
327 #---------------------------------------------------------------------
328 TYPE = SIMP(statut='o',
331 # matériaux génériques
334 "ZINSULATOR","ZSURFACIC",
335 "NILMAT","EM_ISOTROPIC","EM_ANISOTROPIC",
337 ang = "generic materials list",
338 fr = u"liste des matériaux génériques",
341 ##############################################################################
342 # Remarque generale a tous les materiaux :
343 # pour conserver l'affichage scientifique le nombre derriere l'exposant doit
344 # etre strictement superieur au nombre de decimales
347 ##----------------------------------------------------------------------------------------------
348 # Données de perméabilité, utilisée pour les diélectriques, conducteurs et impédances de surface
349 #-----------------------------------------------------------------------------------------------
350 #HAS_PERMEABILITY = BLOC(condition="TYPE in ('DIELECTRIC','CONDUCTOR','ZSURFACIC')",
352 #------------------------------------------------
353 # sous bloc niveau 2 : PERMEABILITY
354 #------------------------------------------------
356 PERMEABILITY_properties = BLOC (condition="TYPE=='DIELECTRIC' or TYPE=='CONDUCTOR'",
357 PERMEABILITY = FACT ( statut="o",
358 ang ="Permeability properties",
359 fr =u"propriétés de perméabilité du matériau",
360 HOMOGENEOUS = SIMP (statut="o",
363 into = ("TRUE","FALSE"),
364 ang = "the material is homogeneous or not",
365 fr = u"le matériau est homogène ou non",
367 ISOTROPIC = SIMP (statut="o",
370 into = ("TRUE","FALSE"),
371 ang = "the material is isotropic or not",
372 fr = u"le matériau est isotrope ou non",
374 HOMOGENEOUS_ISOTROPIC_PROPERTIES = BLOC (condition="HOMOGENEOUS=='TRUE' and ISOTROPIC=='TRUE'",
375 LAW = SIMP (statut="o",
378 into = ("LINEAR","NONLINEAR"),
379 ang = "harmonic or time-domain linear or nonlinear law only for homogeneous and isotropic materials",
380 fr = u"loi linéaire (fréquentielle ou temporelle) ou non (homogène et isotrope seulement)",
382 VALUE = SIMP (statut="o",
385 ang = "Relative linear permeability value, also used at first nonlinear iteration",
386 fr = u"Valeur de la perméabilité relative à l'air utilisée pour une loi linéaire ou pour la première itération non-linéaire",
389 NONLINEAR_LAW_PROPERTIES = BLOC (condition="LAW=='NONLINEAR'",
390 NATURE = SIMP (statut="o",
393 into = ("SPLINE","MARROCCO","MARROCCO+SATURATION"),
395 fr = u"nature de la loi",
397 SPLINE_LAW_PROPERTIES = BLOC (condition="NATURE=='SPLINE'",
398 FILENAME = SIMP (statut="o",
399 typ=("FichierNoAbs",'All Files (*)',), # l'existence du fichier n'est pas vérifiée
400 ang="data file name",
401 fr =u"nom du fichier contenant les mesures expérimentales B(H)",
403 ), # Fin BLOC SPLINE_PROPERTIES
404 MARROCCO_LAW_PROPERTIES = BLOC (condition="NATURE in ('MARROCCO','MARROCCO+SATURATION')",
405 ALPHA = SIMP (statut="o",
409 ang="alpha parameter",
410 fr =u"paramètre alpha de la loi de Marrocco" ,
412 TAU = SIMP (statut="o",
417 fr =u"paramètre tau de la loi de Marrocco" ,
419 C = SIMP (statut="o",
424 fr =u"paramètre c de la loi de Marrocco" ,
426 EPSILON = SIMP (statut="o",
430 ang="epsilon parameter",
431 fr =u"paramètre epsilon de la loi de Marrocco" ,
433 ), # Fin BLOC MARROCCO_LAW_PROPERTIES
434 SATURATION_LAW_PROPERTIES = BLOC (condition="NATURE=='MARROCCO+SATURATION'",
435 BMAX = SIMP (statut="o",
439 ang="intersection B",
440 fr = u"valeur de B marquant la fin de la loi de Marrocco et le début du raccord à la loi de saturation",
442 HSAT = SIMP (statut="o",
447 fr = u"valeur de H définissant la loi de saturation",
449 BSAT = SIMP (statut="o",
454 fr = u"valeur de B définissant la loi de saturation",
456 JOIN = SIMP (statut="o",
459 into= ("SPLINE","PARABOLIC","LINEAR"),
460 ang="type of join between laws",
461 fr =u"type de raccord entre la loi choisie et la loi de saturation" ,
463 ), # Fin BLOC SATURATION_LAW_PROPERTIES
464 APPLIEDTO = SIMP (statut="o",
466 into=("B(H)&H(B)","B(H)","H(B)"),
468 ang="join applied to",
469 fr =u"Le raccord tel que défini est appliqué à la courbe B(H) seulement, à la courbe H(B) seulement ou aux deux courbes à la fois. Dans les deux premiers cas, le raccord de la courbe H(B) est inversé numériquement à partir du raccord défini pour la courbe B(H), et vice-versa.",
471 ), # Fin BLOC NONLINEAR_LAW_PROPERTIES
472 ), # Fin BLOC HOMOGENEOUS_ISOTROPIC_PROPERTIES
474 ),# fin FACT PERMEABILITY
477 ##----------------------------------------------------------------------------------------------
478 # Données de conductivité, utilisée pour les conducteurs et impédances de surface
479 #-----------------------------------------------------------------------------------------------
480 #HAS_CONDUCTIVITY = BLOC(condition="TYPE in ('CONDUCTOR','ZSURFACIC')",
481 #------------------------------------------------
482 # sous bloc niveau 2 : CONDUCTIVITY
483 #------------------------------------------------
485 CONDUCTIVITY_properties= BLOC (condition="TYPE=='CONDUCTOR'",
486 CONDUCTIVITY = FACT ( statut="o",
487 ang ="Permittivity properties",
488 fr = u"propriétés de permittivité du matériau",
489 HOMOGENEOUS = SIMP (statut="o",
492 into = ("TRUE","FALSE"),
493 ang = "the material is homogeneous or not",
494 fr = u"le matériau est homogène ou non",
496 ISOTROPIC = SIMP (statut="o",
499 into = ("TRUE","FALSE"),
500 ang = "the material is isotropic or not",
501 fr = u"le matériau est isotrope ou non",
503 HOMOGENEOUS_ISOTROPIC_PROPERTIES = BLOC (condition="HOMOGENEOUS=='TRUE' and ISOTROPIC=='TRUE'",
504 LAW = SIMP (statut="o",
509 fr = u"loi linéaire",
511 VALUE = SIMP (statut="o",
514 ang = "enter a complex relative value",
515 fr = u"saisir une valeur complexe relative",
517 ), # Fin BLOC HOMOGENEOUS_ISOTROPIC_PROPERTIES
523 # fin FACT CONDUCTIVITY
527 ###################################################################################################
528 #---------------------------------------------
530 #---------------------------------------
531 # matériau generique de type ZINSULATOR
532 #---------------------------------------
534 # aucun parametre a saisir pour ce materiau
537 ###################################################################################################
538 #---------------------------------------------
540 #---------------------------------------------
541 # matériau generique de type NILMAT (fictif)
542 #---------------------------------------------
544 # aucun parametre a saisir pour ce materiau
547 ###################################################################################################
548 #----------------------------------------------------------
549 # sous bloc niveau 1 : EM_ISOTROPIC_FILES
550 #-------------------------------------------------
551 # matériau isotropique non homogene generique
552 #-------------------------------------------------
553 EM_ISOTROPIC_properties=BLOC(condition="TYPE=='EM_ISOTROPIC'",
555 AU_MOINS_UN ('CONDUCTIVITY_File','PERMEABILITY_File'),
557 CONDUCTIVITY_File = SIMP (statut="f",
558 typ=("FichierNoAbs",'MED Files (*.med)',),
559 ang="CONDUCTIVITY MED data file name",
560 fr = u"nom du fichier MED CONDUCTIVITY",
562 PERMEABILITY_File = SIMP (statut="f",
563 typ=("FichierNoAbs",'MED Files (*.med)',),
564 ang="PERMEABILITY MED data file name",
565 fr = u"nom du fichier MED PERMEABILITY",
567 ), # fin bloc EM_ISOTROPIC_properties
570 #---------------------------------------------------
571 # matériau anisotropique non homogene generique
572 #---------------------------------------------------
573 EM_ANISOTROPIC_properties=BLOC(condition="TYPE=='EM_ANISOTROPIC'",
575 AU_MOINS_UN ('CONDUCTIVITY_File','PERMEABILITY_File'),
577 PERMEABILITY_File = SIMP (statut="f",
578 #typ=("Fichier",'.mater Files (*.mater)'), # le fichier doit exister dans le répertoire d'où on lancer Eficas si le fichier est défini par un nom relatif, ce qui est trop contraignant
579 #typ=("Fichier",'.mater Files (*.mater)','Sauvegarde'), # Le fichier peut ne pas exister, mais on propose de le sauvegarder et d'écraser un fichier existant : pas approprié
580 typ=("FichierNoAbs",'.mater Files (*.mater)'), # l'existence du fichier n'est pas vérifiée, mais on peut le sélectionner quand même via la navigateur. C'est suffisant et permet une bibliothèque de matériaux.
581 ang="PERMEABILITY .mater data file name",
582 fr ="nom du fichier .mater PERMEABILITY",
584 CONDUCTIVITY_File = SIMP (statut="f",
585 typ=("FichierNoAbs",'.mater Files (*.mater)'),
586 ang="CONDUCTIVITY .mater data file name",
587 fr ="nom du fichier .mater CONDUCTIVITY",
589 ), # fin bloc EM_ANISOTROPIC_properties
592 #------------------------------------------------------------------
593 # Données de permittivité, utilisée pour les diélectriques seulement
594 #-------------------------------------------------------------------
595 #HAS_PERMITTIVITY = BLOC(condition="TYPE == 'DIELECTRIC'",
597 #------------------------------------------------
598 # sous bloc niveau 2 : PERMITTIVITY
599 #------------------------------------------------
601 Utiliser_la_permittivite = SIMP (statut='o',
603 into = ("OUI","NON"),
605 ang ="Optionnaly use permittivity or not (default)",
606 fr = u"Utilisation optionnelle de la permittivité du matériau. Pas d'utilisation par défaut.",
608 PERMITTIVITY_properties = BLOC (condition="Utiliser_la_permittivite=='OUI'",
609 PERMITTIVITY = FACT ( statut="o",
610 ang ="Permittivity properties",
611 fr = u"propriétés de permittivité du matériau",
612 HOMOGENEOUS = SIMP (statut="o",
615 into = ("TRUE","FALSE"),
616 ang = "the material is homogeneous or not",
617 fr = u"le matériau est homogène ou non",
619 ISOTROPIC = SIMP (statut="o",
622 into = ("TRUE","FALSE"),
623 ang = "the material is isotropic or not",
624 fr = u"le matériau est isotrope ou non",
626 HOMOGENEOUS_ISOTROPIC_PROPERTIES = BLOC (condition="HOMOGENEOUS=='TRUE' and ISOTROPIC=='TRUE'",
627 LAW = SIMP (statut="o",
632 fr = u"loi linéaire",
634 VALUE = SIMP (statut="o",
637 ang = "enter a complex relative value",
638 fr = u"saisir une valeur complexe relative",
640 ), # Fin BLOC HOMOGENEOUS_ISOTROPIC_PROPERTIES
642 ),# fin FACT PERMITTIVITY
644 ) # fin OPER MATERIAL
648 ##############################################################################
649 # Remarque generale a tous les materiaux :
650 # pour conserver l'affichage scientifique le nombre derriere l'exposant doit
651 # etre strictement superieur au nombre de decimales
654 #===================================================================
655 # 3eme bloc : bloc SOURCES
656 #====================================================================
657 # definition des differentes sources qui seront dans le bloc SOURCES
658 #-------------------------------------------------------------------
662 SOURCE = OPER ( nom = "SOURCE",
665 UIinfo = { "groupes" : ( "2) Proprietes", ) },
666 ang = "source definition",
667 fr = u"définition d'une source",
669 # regles = (UN_PARMI('STRANDED_INDUCTOR','HPORT','EPORT'), # choix d'un type de source
670 # UN_PARMI('WAVEFORM_CONSTANT','WAVEFORM_SINUS'), # choix d'une forme de source
673 #----------------------------------------------------------
674 # sous bloc niveau 1 : stranded inductor source
675 ##---------------------------------------------------------
676 Type=SIMP(statut='o',
678 into=("STRANDED_INDUCTOR", "HPORT", "EPORT"),
680 fr = u"Type de source",
683 STRANDED_INDUCTOR_properties = BLOC (condition="Type=='STRANDED_INDUCTOR'",
684 STRANDED_INDUCTOR = FACT(statut='o',
685 ang="Stranded inductor source",
686 fr=u"source de type inducteur bobiné",
687 NTURNS = SIMP (statut="o",
690 ang="number of turns in the inductor",
691 fr= u"nombre de tours dans l'inducteur bobiné",
693 TYPE = SIMP (statut="o",
697 fr= u"source de type courant",
698 ang="current source type",
701 ),# FIN de FACT STRANDED_INDUCTOR
702 HPORT_properties = BLOC (condition="Type=='HPORT'",
703 HPORT = FACT(statut='o',
704 ang="Magnetic port source",
705 fr=u"source de type port magnétique",
706 TYPE = SIMP (statut="o",
708 into=("VOLTAGE","CURRENT"),
709 fr= u"source de type tension ou courant",
710 ang="voltage or current source type",
713 ),# FIN de FACT HPORT
714 EPORT_properties = BLOC (condition="Type=='EPORT'",
715 EPORT = FACT(statut='o',
716 ang="Electric port source",
717 fr=u"source de type port électrique",
718 TYPE = SIMP (statut="o",
720 into=("VOLTAGE","CURRENT"),
721 fr= u"source de type tension ou courant",
722 ang="voltage or current source type",
725 ),# FIN de FACT EPORT
727 Signal=SIMP(statut='o',
729 into=("WAVEFORM_CONSTANT", "WAVEFORM_SINUS"),
730 ang = "Signal type, i.e., source evolution shape",
731 fr = u"Type de signal, i.e., forme de la source",
733 WAVEFORM_CONSTANT_properties = BLOC (condition="Signal=='WAVEFORM_CONSTANT'",
734 WAVEFORM_CONSTANT = FACT(statut='o',
735 ang="constant source",
736 fr=u"source constante",
737 AMPLITUDE = SIMP (statut="o",
740 ang = "enter the source magnitude value, in A or V units",
741 fr = u"saisir la valeur de l'amplitude de la source, en unités A ou V",
744 ),# FIN de FACT WAVEFORM_CONSTANT
746 WAVEFORM_SINUS_properties = BLOC (condition="Signal=='WAVEFORM_SINUS'",
747 WAVEFORM_SINUS = FACT(statut='o',
748 ang="sinus variation source",
749 fr=u"source variant avec une forme sinusoïdale, définie par son amplitude, sa fréquence et sa phase",
750 AMPLITUDE = SIMP (statut="o",
753 ang = "enter the source magnitude value, in A or V units",
754 fr = u"saisir la valeur de l'amplitude de la source, en unités A ou V",
756 FREQUENCY = SIMP (statut="o",
759 ang = "enter the source frequency value, in Hz units",
760 fr = u"saisir la valeur de la fréquence de la source, en Hz",
762 PHASE = SIMP (statut="o",
765 ang = "enter the source phase value, in degrees units",
766 fr = u"saisir la valeur de la phase de la source, en degrés",
769 ),# FIN de FACT WAVEFORM_SINUS
775 STRANDED_INDUCTOR_GEOMETRY=OPER(nom="STRANDED_INDUCTOR_GEOMETRY",
778 sd_prod=stranded_inductor_geometry,
779 UIinfo = { "groupes" : ( "2) Proprietes", ) },
780 ang = "Geometry properties (shape, direction, etc.) for this stranded inductor",
781 fr = u"Propriétés géométriques de cet inducteur bobiné, e.g., forme, direction, sens",
783 Forme=SIMP(statut='o', typ="TXM", into=("Droit", "Circulaire"),
784 ang = "Stranded inductor shape. Straight or circular.",
785 fr = u"Forme de l'inducteur bobiné (complet ou morceau) : droit ou circulaire.",
787 Propriete= BLOC (condition="Forme=='Circulaire'",
788 Centre=SIMP(statut='o',typ='R',min=3,max=3,
789 ang = "Circular stranded inductor rotation center (cartesian coordinates).",
790 fr = u"Centre de rotation, en coordonnées cartésiennes, de l'inducteur bobiné (complet ou morceau) circulaire.",
793 Direction=SIMP(statut='o',typ='R',min=3,max=3,
794 ang = "Stranded inductor direction (or rotation) axis for the straight (circular) inductor (cartesian coordinates).",
795 fr = u"Axe indiquant la direction de l'inducteur bobiné droit, ou l'axe de rotation (support : Centre) de l'inducteur circulaire, en coordonnées cartésiennes.",
797 Section=SIMP(statut='o', typ='R',
798 ang = "Stranded inductor section (m^2).",
799 fr = u"Section de l'inducteur bobiné, en m^2.",
803 #=========================================================
804 # création d'une macro pour traiter les INCLUDE
806 #----------------------------------------------------------
808 INCLUDE = MACRO ( nom = "INCLUDE",
810 UIinfo = { "groupes" : ( "3) Bibliotheque", ) },
811 sd_prod = opsCarmel.INCLUDE,
812 op_init = opsCarmel.INCLUDE_context,
814 ang = "Used in order to add external material, source, etc. libraries to the study.",
815 fr = u"Permet d'utiliser des bibliothèques de matériaux, sources, etc., dans l'étude.",
817 FileName = SIMP ( statut = "o",
818 typ = ('Fichier', 'comm Files (*.comm);;All Files (*)',),
819 fr = u"Emplacement du fichier (chemin absolu ou relatif) contenant la bibliothèque des matériaux, etc.",
820 ang = "material library file (full or relative path)",
825 MESHGROUP = OPER (nom = "MESHGROUP",
828 UIinfo= {"groupes":("4) Maillage",)},
829 fr= u"attribution d'un matériau ou d'une source à un groupe du maillage",
830 ang = "mesh group association to material or source",
833 EXCLUS ('MATERIAL','SOURCE'),
836 # ----------------------------------------------------------
837 # le mot cle SIMP doit etre facultatif sinon la recuperation
838 # des groupes de mailles sous SALOME ne fonctionne pas car
839 # le concept ne peut pas etre nomme car non valide
840 #-----------------------------------------------------------
841 Domaine = SIMP (statut="f",
842 typ=(grmaille, 'TXM'),
844 ang="Domain used with stranded inductors or topological holes.",
845 fr =u"Domaine utilisé par les inducteurs bobinés ou les trous topologiques.",
848 MATERIAL = SIMP (statut="f",
850 ang="name of the linked real or imaginary material",
851 fr =u"nom du matériau réel ou imaginaire associé",
853 SOURCE = SIMP (statut="f",
855 ang="name of the linked source",
856 fr =u"nom de la source associée",
858 STRANDED_INDUCTOR_GEOMETRY = SIMP ( statut="f",
859 typ=(stranded_inductor_geometry),
860 ang="name of the linked stranded inductor geometry",
861 fr =u"nom de la géométrie d'inducteur bobiné associée",
865 # --------------------------------------------------
866 # definition de macro-groupe de mailles
867 # il est associe a un materiau, source ou inducteur bobiné en morceaux
868 #---------------------------------------------------
870 MACRO_GROUPE = OPER (nom="MACRO_GROUPE",
873 sd_prod=macro_groupe,
874 UIinfo = { "groupes" : ( "4) Maillage", ) },
875 fr=u"Macro-groupe = liste de groupes de maillage, e.g., inducteur bobiné en morceaux.",
876 ang=u"Macro-groupe = liste of mesh groups, e.g., stranded inductor defined as several parts.",
878 EXCLUS ('MATERIAL','SOURCE'),
880 Domaine = SIMP (statut='f',
881 typ=(grmaille, 'TXM'),
883 ang="Domain used with stranded inductors or topological holes.",
884 fr =u"Domaine utilisé par les inducteurs bobinés ou les trous topologiques.",
887 MATERIAL = SIMP (statut="f",
889 ang="name of the linked real or imaginary material",
890 fr =u"nom du matériau réel ou imaginaire associé",
892 SOURCE = SIMP (statut="f",
894 ang="name of the linked source",
895 fr =u"nom de la source associée",
897 LISTE_MESHGROUP=SIMP(statut='f',# facultatif pour l'acquisition automatique des groupes du maillage
900 ang="Ordered list of associated mesh groups, e.g., stranded inductor parts or topological hole parts.",
901 fr =u"Liste ordonnée de groupes de maillage associés entre eux, e.g., morceaux d'un inducteur bobiné ou d'un trou topologique.",