From ed6900098259543563fe60de501a3c2e8b5aab87 Mon Sep 17 00:00:00 2001 From: Christian Caremoli <> Date: Tue, 29 May 2007 17:08:49 +0000 Subject: [PATCH] CCAR: mise a niveau Aster 9.0.27 pour les repertoires SD plus mise a jour tests unitaires dans repertoire Tests --- Aster/Cata/cataSTA6/cata.py | 10 +- Aster/Cata/cataSTA7/cata.py | 10 +- Aster/Cata/cataSTA8/cata.py | 10 +- Aster/Cata/cataSTA9/SD/__init__.py | 17 +- Aster/Cata/cataSTA9/SD/co_cham_elem.py | 4 +- Aster/Cata/cataSTA9/SD/co_cham_no.py | 4 +- Aster/Cata/cataSTA9/SD/co_fonction.py | 6 +- Aster/Cata/cataSTA9/SD/co_macr_elem_dyna.py | 4 +- Aster/Cata/cataSTA9/SD/co_matr_asse_gene.py | 4 +- Aster/Cata/cataSTA9/SD/co_vect_asse_gene.py | 4 +- Aster/Cata/cataSTA9/SD/sd_amor_modal.py | 28 ++ Aster/Cata/cataSTA9/SD/sd_cara_elem.py | 62 ++-- Aster/Cata/cataSTA9/SD/sd_cham_mater.py | 88 +++-- Aster/Cata/cataSTA9/SD/sd_cham_no.py | 37 +- Aster/Cata/cataSTA9/SD/sd_char_contact.py | 125 +++---- Aster/Cata/cataSTA9/SD/sd_compor.py | 5 +- Aster/Cata/cataSTA9/SD/sd_feti.py | 32 +- Aster/Cata/cataSTA9/SD/sd_fiss_xfem.py | 85 +++-- Aster/Cata/cataSTA9/SD/sd_fonction.py | 129 ++++++- Aster/Cata/cataSTA9/SD/sd_interf_dyna_clas.py | 46 +-- Aster/Cata/cataSTA9/SD/sd_l_table.py | 60 +-- Aster/Cata/cataSTA9/SD/sd_macr_elem_dyna.py | 54 ++- Aster/Cata/cataSTA9/SD/sd_mater.py | 43 ++- Aster/Cata/cataSTA9/SD/sd_matr_asse_com.py | 30 +- Aster/Cata/cataSTA9/SD/sd_matr_asse_gene.py | 38 +- Aster/Cata/cataSTA9/SD/sd_melasflu.py | 188 ++++++++-- Aster/Cata/cataSTA9/SD/sd_modele.py | 81 +++-- Aster/Cata/cataSTA9/SD/sd_multi_appui.py | 30 ++ Aster/Cata/cataSTA9/SD/sd_proj_modal.py | 39 ++ Aster/Cata/cataSTA9/SD/sd_resultat.py | 145 ++++++-- Aster/Cata/cataSTA9/SD/sd_sddyna.py | 33 ++ Aster/Cata/cataSTA9/SD/sd_table.py | 56 +-- Aster/Cata/cataSTA9/SD/sd_type_flui_stru.py | 342 ++++++++++++++++-- Aster/Cata/cataSTA9/SD/sd_util.py | 147 ++++++-- Aster/Cata/cataSTA9/SD/utilsd.py | 90 +++++ Doc/Makefile | 1 - Exemples/eficas/cata.py | 6 +- Extensions/param2.py | 2 + Sdbase/__init__.py | 3 - Sdbase/ascheckers.py | 70 ---- Sdbase/asnom.py | 133 ------- Sdbase/asojb.py | 304 ---------------- Sdbase/basetype.py | 156 -------- Tests/testelem/az.comm | 8 +- Tests/testelem/azv6.comm | 8 +- Tests/testelem/cata1.py | 8 +- Tests/testelem/cata2.py | 8 +- Tests/testelem/cata5.py | 8 +- Tests/testelem/params.comm | 1 - Tests/testelem/testbloc1.py | 4 +- Tests/testelem/testjdc1.py | 2 - Tests/testelem/testoper1.py | 4 +- Tests/testelem/testposition1.py | 4 +- 53 files changed, 1628 insertions(+), 1188 deletions(-) create mode 100644 Aster/Cata/cataSTA9/SD/sd_amor_modal.py create mode 100644 Aster/Cata/cataSTA9/SD/sd_multi_appui.py create mode 100644 Aster/Cata/cataSTA9/SD/sd_proj_modal.py create mode 100644 Aster/Cata/cataSTA9/SD/sd_sddyna.py create mode 100644 Aster/Cata/cataSTA9/SD/utilsd.py delete mode 100644 Sdbase/__init__.py delete mode 100644 Sdbase/ascheckers.py delete mode 100644 Sdbase/asnom.py delete mode 100644 Sdbase/asojb.py delete mode 100644 Sdbase/basetype.py diff --git a/Aster/Cata/cataSTA6/cata.py b/Aster/Cata/cataSTA6/cata.py index ebae8e10..a6baa5ee 100755 --- a/Aster/Cata/cataSTA6/cata.py +++ b/Aster/Cata/cataSTA6/cata.py @@ -29,8 +29,8 @@ except: pass # -__version__="$Name: BR_V1_12a1 $" -__Id__="$Id: cata.py,v 1.5 2006-06-20 17:38:47 cchris Exp $" +__version__="$Name: $" +__Id__="$Id: cata.py,v 1.5.12.1 2007-04-26 07:56:01 cchris Exp $" # JdC = JDC_CATA(code='ASTER', execmodul=None, @@ -39,9 +39,9 @@ JdC = JDC_CATA(code='ASTER', A_CLASSER(('DEBUT','POURSUITE'),'FIN'))) #compatibilite avec V9 -import Sdbase -class ASSD(ASSD,Sdbase.AsBase):pass -class GEOM(GEOM,Sdbase.AsBase):pass +import Noyau +class ASSD(ASSD,Noyau.AsBase):pass +class GEOM(GEOM,Noyau.AsBase):pass #fin compatibilite # Type le plus general diff --git a/Aster/Cata/cataSTA7/cata.py b/Aster/Cata/cataSTA7/cata.py index 525aa13a..56642fec 100644 --- a/Aster/Cata/cataSTA7/cata.py +++ b/Aster/Cata/cataSTA7/cata.py @@ -34,8 +34,8 @@ except: pass # -__version__="$Name: BR_V1_12a1 $" -__Id__="$Id: cata.py,v 1.3 2006-12-15 16:00:05 cchris Exp $" +__version__="$Name: $" +__Id__="$Id: cata.py,v 1.3.8.1 2007-04-26 07:56:01 cchris Exp $" # JdC = JDC_CATA(code='ASTER', execmodul=None, @@ -43,9 +43,9 @@ JdC = JDC_CATA(code='ASTER', AU_MOINS_UN('FIN'), A_CLASSER(('DEBUT','POURSUITE'),'FIN'))) #compatibilite avec V9 -import Sdbase -class ASSD(ASSD,Sdbase.AsBase):pass -class GEOM(GEOM,Sdbase.AsBase):pass +import Noyau +class ASSD(ASSD,Noyau.AsBase):pass +class GEOM(GEOM,Noyau.AsBase):pass #fin compatibilite # Type le plus general diff --git a/Aster/Cata/cataSTA8/cata.py b/Aster/Cata/cataSTA8/cata.py index c85d319e..e63e3b1b 100755 --- a/Aster/Cata/cataSTA8/cata.py +++ b/Aster/Cata/cataSTA8/cata.py @@ -33,8 +33,8 @@ try: except: pass -__version__="$Name: BR_V1_12a1 $" -__Id__="$Id: cata.py,v 1.3 2006-12-15 16:00:11 cchris Exp $" +__version__="$Name: $" +__Id__="$Id: cata.py,v 1.3.8.1 2007-04-26 07:56:01 cchris Exp $" EnumTypes = (ListType, TupleType) @@ -45,9 +45,9 @@ JdC = JDC_CATA(code='ASTER', AU_MOINS_UN('FIN'), A_CLASSER(('DEBUT','POURSUITE'),'FIN'))) #compatibilite avec V9 -import Sdbase -class ASSD(ASSD,Sdbase.AsBase):pass -class GEOM(GEOM,Sdbase.AsBase):pass +import Noyau +class ASSD(ASSD,Noyau.AsBase):pass +class GEOM(GEOM,Noyau.AsBase):pass #fin compatibilite # Type le plus general diff --git a/Aster/Cata/cataSTA9/SD/__init__.py b/Aster/Cata/cataSTA9/SD/__init__.py index 2e177851..1c3f94bd 100644 --- a/Aster/Cata/cataSTA9/SD/__init__.py +++ b/Aster/Cata/cataSTA9/SD/__init__.py @@ -1,4 +1,4 @@ -#@ MODIF __init__ SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF __init__ SD DATE 16/05/2007 AUTEUR COURTOIS M.COURTOIS # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -19,8 +19,15 @@ # ====================================================================== from Accas import ASSD -from Sdbase.asnom import SDNom -from Sdbase.ascheckers import Parmi -from Sdbase.asojb import AsBase, AsVK8, AsVK16, AsVK24, AsVK32, AsVK80, \ - AsVI, AsVR, AsVC, AsColl, AsObject, Facultatif, OJBVect + +# pour utilisation du catalogue hors aster +try: + import aster +except: + pass + +from Noyau.asnom import SDNom +from Noyau.ascheckers import Parmi +from Noyau.asojb import AsBase, AsVK8, AsVK16, AsVK24, AsVK32, AsVK80, \ + AsVI, AsVR, AsVC, AsColl, AsObject, Facultatif, OJBVect diff --git a/Aster/Cata/cataSTA9/SD/co_cham_elem.py b/Aster/Cata/cataSTA9/SD/co_cham_elem.py index 74ab6231..b02657b8 100644 --- a/Aster/Cata/cataSTA9/SD/co_cham_elem.py +++ b/Aster/Cata/cataSTA9/SD/co_cham_elem.py @@ -1,4 +1,4 @@ -#@ MODIF co_cham_elem SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF co_cham_elem SD DATE 16/05/2007 AUTEUR COURTOIS M.COURTOIS # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -23,6 +23,8 @@ from SD import * from sd_cham_elem import sd_cham_elem from co_champ import cham_gd_sdaster +import Numeric + # ----------------------------------------------------------------------------- # post-traitement : class post_comp_cham_el : diff --git a/Aster/Cata/cataSTA9/SD/co_cham_no.py b/Aster/Cata/cataSTA9/SD/co_cham_no.py index 8e35ba8b..dacf2744 100644 --- a/Aster/Cata/cataSTA9/SD/co_cham_no.py +++ b/Aster/Cata/cataSTA9/SD/co_cham_no.py @@ -1,4 +1,4 @@ -#@ MODIF co_cham_no SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF co_cham_no SD DATE 16/05/2007 AUTEUR COURTOIS M.COURTOIS # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -23,6 +23,8 @@ from SD import * from sd_cham_no import sd_cham_no from co_champ import cham_gd_sdaster +import Numeric + # ----------------------------------------------------------------------------- # post-traitement : class post_comp_cham_no : diff --git a/Aster/Cata/cataSTA9/SD/co_fonction.py b/Aster/Cata/cataSTA9/SD/co_fonction.py index bef847f3..8b5fc8da 100644 --- a/Aster/Cata/cataSTA9/SD/co_fonction.py +++ b/Aster/Cata/cataSTA9/SD/co_fonction.py @@ -1,4 +1,4 @@ -#@ MODIF co_fonction SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF co_fonction SD DATE 16/05/2007 AUTEUR COURTOIS M.COURTOIS # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -18,11 +18,11 @@ # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== -import types import Accas from SD import * from sd_fonction import sd_fonction +import Numeric from math import pi # ----------------------------------------------------------------------------- @@ -130,7 +130,7 @@ class fonction_sdaster(fonction_class, sd_fonction): def __call__(self,val): ### Pour EFICAS : substitution de l'instance de classe ### parametre par sa valeur - if type(val) == types.InstanceType and hasattr(val,"valeur"): + if isinstance(val, ASSD): val=val.valeur ### __ff=self.convert() diff --git a/Aster/Cata/cataSTA9/SD/co_macr_elem_dyna.py b/Aster/Cata/cataSTA9/SD/co_macr_elem_dyna.py index 993dc0f9..4f9c25ba 100644 --- a/Aster/Cata/cataSTA9/SD/co_macr_elem_dyna.py +++ b/Aster/Cata/cataSTA9/SD/co_macr_elem_dyna.py @@ -1,4 +1,4 @@ -#@ MODIF co_macr_elem_dyna SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF co_macr_elem_dyna SD DATE 16/05/2007 AUTEUR COURTOIS M.COURTOIS # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -22,6 +22,8 @@ import Accas from SD import * from sd_macr_elem_dyna import sd_macr_elem_dyna +import Numeric + # ----------------------------------------------------------------------------- class macr_elem_dyna(ASSD, sd_macr_elem_dyna): def NBRE_MODES(self) : diff --git a/Aster/Cata/cataSTA9/SD/co_matr_asse_gene.py b/Aster/Cata/cataSTA9/SD/co_matr_asse_gene.py index f38315d0..e0490b83 100644 --- a/Aster/Cata/cataSTA9/SD/co_matr_asse_gene.py +++ b/Aster/Cata/cataSTA9/SD/co_matr_asse_gene.py @@ -1,4 +1,4 @@ -#@ MODIF co_matr_asse_gene SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF co_matr_asse_gene SD DATE 16/05/2007 AUTEUR COURTOIS M.COURTOIS # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -22,6 +22,8 @@ import Accas from SD import * from sd_matr_asse_gene import sd_matr_asse_gene +import Numeric + # ----------------------------------------------------------------------------- class matr_asse_gene(ASSD, sd_matr_asse_gene): pass diff --git a/Aster/Cata/cataSTA9/SD/co_vect_asse_gene.py b/Aster/Cata/cataSTA9/SD/co_vect_asse_gene.py index 328eae0d..d57496dd 100644 --- a/Aster/Cata/cataSTA9/SD/co_vect_asse_gene.py +++ b/Aster/Cata/cataSTA9/SD/co_vect_asse_gene.py @@ -1,4 +1,4 @@ -#@ MODIF co_vect_asse_gene SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF co_vect_asse_gene SD DATE 16/05/2007 AUTEUR COURTOIS M.COURTOIS # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -22,6 +22,8 @@ import Accas from SD import * from sd_cham_gene import sd_cham_gene +import Numeric + # ----------------------------------------------------------------------------- class vect_asse_gene(ASSD, sd_cham_gene): diff --git a/Aster/Cata/cataSTA9/SD/sd_amor_modal.py b/Aster/Cata/cataSTA9/SD/sd_amor_modal.py new file mode 100644 index 00000000..bf964112 --- /dev/null +++ b/Aster/Cata/cataSTA9/SD/sd_amor_modal.py @@ -0,0 +1,28 @@ +#@ MODIF sd_amor_modal SD DATE 04/04/2007 AUTEUR ABBAS M.ABBAS +# -*- coding: iso-8859-1 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# ====================================================================== +from SD import * + +class sd_amor_modal(AsBase): +#------------------------------------ + nomj = SDNom(fin=19) + + VALM=AsVR() + BASM=AsVR() + diff --git a/Aster/Cata/cataSTA9/SD/sd_cara_elem.py b/Aster/Cata/cataSTA9/SD/sd_cara_elem.py index 46a55858..dacbbbe5 100644 --- a/Aster/Cata/cataSTA9/SD/sd_cara_elem.py +++ b/Aster/Cata/cataSTA9/SD/sd_cara_elem.py @@ -1,44 +1,46 @@ -#@ MODIF sd_cara_elem SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_cara_elem SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * from SD.sd_cham_elem import sd_cham_elem from SD.sd_carte import sd_carte + class sd_cara_elem(AsBase): +#-------------------------- nomj = SDNom(fin=8) - cargenba = Facultatif(sd_carte(SDNom(nomj='.CARGENBA', fin=19))) - cafibr = Facultatif(sd_cham_elem(SDNom(nomj='.CAFIBR', fin=19))) - carmassi = Facultatif(sd_carte(SDNom(nomj='.CARMASSI', fin=19))) - carcable = Facultatif(sd_carte(SDNom(nomj='.CARCABLE', fin=19))) - carcoque = Facultatif(sd_carte(SDNom(nomj='.CARCOQUE', fin=19))) - cargeoba = Facultatif(sd_carte(SDNom(nomj='.CARGEOBA', fin=19))) - canbsp = Facultatif(sd_cham_elem(SDNom(nomj='.CANBSP', fin=19))) - cardisck = Facultatif(sd_carte(SDNom(nomj='.CARDISCK', fin=19))) - cararcpo = Facultatif(sd_carte(SDNom(nomj='.CARARCPO', fin=19))) - cargenpo = Facultatif(sd_carte(SDNom(nomj='.CARGENPO', fin=19))) - cardiscm = Facultatif(sd_carte(SDNom(nomj='.CARDISCM', fin=19))) - carorien = Facultatif(sd_carte(SDNom(nomj='.CARORIEN', fin=19))) - cardisca = Facultatif(sd_carte(SDNom(nomj='.CARDISCA', fin=19))) - cventcxf = Facultatif(sd_carte(SDNom(nomj='.CVENTCXF', fin=19))) - carpoufl = Facultatif(sd_carte(SDNom(nomj='.CARPOUFL', fin=19))) - cargeopo = Facultatif(sd_carte(SDNom(nomj='.CARGEOPO', fin=19))) + CARGENBA = Facultatif(sd_carte()) + CAFIBR = Facultatif(sd_cham_elem()) + CARMASSI = Facultatif(sd_carte()) + CARCABLE = Facultatif(sd_carte()) + CARCOQUE = Facultatif(sd_carte()) + CARGEOBA = Facultatif(sd_carte()) + CANBSP = Facultatif(sd_cham_elem()) + CARDISCK = Facultatif(sd_carte()) + CARARCPO = Facultatif(sd_carte()) + CARGENPO = Facultatif(sd_carte()) + CARDISCM = Facultatif(sd_carte()) + CARORIEN = Facultatif(sd_carte()) + CARDISCA = Facultatif(sd_carte()) + CVENTCXF = Facultatif(sd_carte()) + CARPOUFL = Facultatif(sd_carte()) + CARGEOPO = Facultatif(sd_carte()) diff --git a/Aster/Cata/cataSTA9/SD/sd_cham_mater.py b/Aster/Cata/cataSTA9/SD/sd_cham_mater.py index 99660f8a..f99146db 100644 --- a/Aster/Cata/cataSTA9/SD/sd_cham_mater.py +++ b/Aster/Cata/cataSTA9/SD/sd_cham_mater.py @@ -1,49 +1,89 @@ -#@ MODIF sd_cham_mater SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_cham_mater SD DATE 23/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * from SD.sd_carte import sd_carte +from SD.sd_util import * -class sd_cham_mater(AsBase): +class sd_cham_mater_varc(AsBase): #---------------------------------- nomj = SDNom(fin=8) - champ_mat = sd_carte(SDNom(nomj='.CHAMP_MAT', fin=19)) - tempe_ref = sd_carte(SDNom(nomj='.TEMPE_REF', fin=19)) + CVRCNOM = AsVK8() + CVRCGD = AsVK8() + CVRCDEF = AsVR() + CVRCVARC = AsVK8() + CVRCCMP = AsVK8() - CVRCNOM = Facultatif(AsVK8()) - CVRCGD = Facultatif(AsVK8()) - CVRCDEF = Facultatif(AsVR()) - CVRCVARC = Facultatif(AsVK8()) - CVRCCMP = Facultatif(AsVK8()) + def exists(self): + return self.CVRCVARC.get() # indirection via CVRCVARC: def check_cham_mater_i_CVRCVARC(self, checker): - if not self.CVRCVARC.get() : return + if not self.exists() : return lnom=self.CVRCVARC.get() for nom in lnom : - if not nom.strip() : continue nom2=self.nomj()[:8]+'.'+nom+'.1' sd2=sd_carte(nom2) ; sd2.check(checker) nom2=self.nomj()[:8]+'.'+nom+'.2' sd2=sd_carte(nom2) ; sd2.check(checker) + # vérification des objets .CVRC* : + def check_CVRC(self, checker): + if not self.exists() : return + xcmp=self.CVRCCMP.get() + xnom=self.CVRCNOM.get() + xgd=self.CVRCGD.get() + xvarc=self.CVRCVARC.get() + xdef=self.CVRCDEF.get() + + # Les 5 objets ont la meme longueur > 0 : + nbcvrc=len(xnom) + assert nbcvrc > 0, (self) + assert len(xcmp) == nbcvrc , (xcmp,xnom,self) + assert len(xgd) == nbcvrc , (xgd,xnom,self) + assert len(xvarc) == nbcvrc , (xvarc,xnom,self) + assert len(xdef) == nbcvrc , (xdef,xnom,self) + + # Les 4 objets sont "non blancs" : + sdu_tous_non_blancs(self.CVRCCMP,checker) + sdu_tous_non_blancs(self.CVRCNOM,checker) + sdu_tous_non_blancs(self.CVRCGD,checker) + sdu_tous_non_blancs(self.CVRCVARC,checker) + + # les noms des CRVC doievent etre differents: + sdu_tous_differents(self.CVRCNOM,checker) + + +class sd_cham_mater(AsBase): +#---------------------------------- + nomj = SDNom(fin=8) + champ_mat = sd_carte(SDNom(nomj='.CHAMP_MAT', fin=19)) + + # La carte TEMPE_REF n'existe pas si AFFE_VARC/NOM_VARC='TEMP' : + # (voir routine cmtref.f) + TEMPE_REF = Facultatif(sd_carte()) + + # si AFFE_VARC : + varc = Facultatif(sd_cham_mater_varc(SDNom(nomj=''))) + + diff --git a/Aster/Cata/cataSTA9/SD/sd_cham_no.py b/Aster/Cata/cataSTA9/SD/sd_cham_no.py index ba514af2..172d5efd 100644 --- a/Aster/Cata/cataSTA9/SD/sd_cham_no.py +++ b/Aster/Cata/cataSTA9/SD/sd_cham_no.py @@ -1,21 +1,21 @@ -#@ MODIF sd_cham_no SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_cham_no SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * @@ -32,14 +32,15 @@ class sd_cham_no(sd_titre): DESC = AsVI(docu='CHNO', ) + def exists(self): + # retourne "vrai" si la SD semble exister (et donc qu'elle peut etre vérifiée) + return self.REFE.exists + # indirection vers PROF_CHNO/NUME_EQUA : def check_cham_no_i_REFE(self, checker): + if not self.exists() : return lnom = self.REFE.get() - # pour se protéger des cham_no inexistants (suffixe=Facultatif(sd_cham_no(...))) : AJACOT_PB - # se serait mieux de le faire en amont - if not lnom : return - # faut-il vérifier le sd_maillage de chaque sd_cham_no ? AJACOT_PB # - cela risque de couter cher # - cela pose un problème "import circulaire" avec sd_maillage -> sd_cham_no => import ici diff --git a/Aster/Cata/cataSTA9/SD/sd_char_contact.py b/Aster/Cata/cataSTA9/SD/sd_char_contact.py index 03fbb250..f4588c6a 100644 --- a/Aster/Cata/cataSTA9/SD/sd_char_contact.py +++ b/Aster/Cata/cataSTA9/SD/sd_char_contact.py @@ -1,21 +1,21 @@ -#@ MODIF sd_char_contact SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_char_contact SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * @@ -23,50 +23,53 @@ from SD import * class sd_char_contact(AsBase): nomj =SDNom(fin=16) - BAMACO =AsVI() - BANOCO =AsVI() - CARACF =AsVR() - COMAFO =AsVR() - CONVCO =AsVI() - DIRCO =AsVR() - ECPDON =AsVI() - FROTE =AsVR() - JEUCON =Facultatif(AsVR()) - JEUCOQ =AsVR() - JEUPOU =AsVR() - JFO1CO =AsVK8() - JFO2CO =AsVK8() - JFO3CO =AsVK8() - JSUPCO =AsVR() - MAESCL =Facultatif(AsVI()) - MAILCO =AsVI() - MAMACO =AsVI() - MANOCO =AsVI() - METHCO =AsVI() - NDIMCO =AsVI() - NOESCL =Facultatif(AsVR()) - NOEUCO =AsVI() - NOEUQU =Facultatif(AsVI()) - NOMACO =AsVI() - NORLIS =AsVI() - NOZOCO =AsVI() - PBAMACO =AsVI() - PBANOCO =AsVI() - PENAL =AsVR() - PMAMACO =AsVI() - PMANOCO =AsVI() - PNOEUQU =AsVI() - PNOMACO =AsVI() - PRANOCO =AsVI() - PSSNOCO =AsVI() - PSUMACO =AsVI() - PSUNOCO =AsVI() - PZONECO =AsVI() - RANOCO =AsVI() - SANSNQ =AsVI() - SSNOCO =AsVI() - SYMECO =AsVI() - TABFIN =Facultatif(AsVR()) - TANDEF =AsVR() - TANPOU =AsVR() - TOLECO =AsVR() + BAMACO = Facultatif(AsVI()) + BANOCO = Facultatif(AsVI()) + CARACF = Facultatif(AsVR()) + COMAFO = Facultatif(AsVR()) + CONVCO = Facultatif(AsVI()) + DIRCO = Facultatif(AsVR()) + ECPDON = Facultatif(AsVI()) + FORMCO = Facultatif(AsVI()) + FROTE = Facultatif(AsVR()) + JEUCON = Facultatif(AsVR()) + JEUCOQ = Facultatif(AsVR()) + JEUPOU = Facultatif(AsVR()) + JFO1CO = Facultatif(AsVK8()) + JFO2CO = Facultatif(AsVK8()) + JFO3CO = Facultatif(AsVK8()) + JSUPCO = Facultatif(AsVR()) + MAESCL = Facultatif(AsVI()) + MAILCO = Facultatif(AsVI()) + MAMACO = Facultatif(AsVI()) + MANOCO = Facultatif(AsVI()) + METHCO = Facultatif(AsVI()) + NDIMCO = Facultatif(AsVI()) + NOESCL = Facultatif(AsVR()) + NOEUCO = Facultatif(AsVI()) + NOEUQU = Facultatif(AsVI()) + NOMACO = Facultatif(AsVI()) + NORLIS = Facultatif(AsVI()) + NOZOCO = Facultatif(AsVI()) + PBAMACO = Facultatif(AsVI()) + PBANOCO = Facultatif(AsVI()) + PENAL = Facultatif(AsVR()) + PMAMACO = Facultatif(AsVI()) + PMANOCO = Facultatif(AsVI()) + PNOEUQU = Facultatif(AsVI()) + PNOMACO = Facultatif(AsVI()) + PRANOCO = Facultatif(AsVI()) + PSSNOCO = Facultatif(AsVI()) + PSUMACO = Facultatif(AsVI()) + PSUNOCO = Facultatif(AsVI()) + PZONECO = Facultatif(AsVI()) + RANOCO = Facultatif(AsVI()) + SANSNQ = Facultatif(AsVI()) + SSNOCO = Facultatif(AsVI()) + SYMECO = Facultatif(AsVI()) + TABFIN = Facultatif(AsVR()) + TANDEF = Facultatif(AsVR()) + TANPOU = Facultatif(AsVR()) + TOLECO = Facultatif(AsVR()) + XFEM = Facultatif(AsVI()) + XFIMAI = Facultatif(AsVK8()) diff --git a/Aster/Cata/cataSTA9/SD/sd_compor.py b/Aster/Cata/cataSTA9/SD/sd_compor.py index 4fb1ad46..0dd66b3c 100644 --- a/Aster/Cata/cataSTA9/SD/sd_compor.py +++ b/Aster/Cata/cataSTA9/SD/sd_compor.py @@ -1,4 +1,4 @@ -#@ MODIF sd_compor SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_compor SD DATE 23/04/2007 AUTEUR PROIX J-M.PROIX # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -23,6 +23,7 @@ from SD import * class sd_compor(AsBase): nomj = SDNom(fin=8) CPRK = AsVK16() - CPRI = AsVI(lonmax=7, ) + CPRI = AsVI() + CPRR = Facultatif(AsVR()) diff --git a/Aster/Cata/cataSTA9/SD/sd_feti.py b/Aster/Cata/cataSTA9/SD/sd_feti.py index 5f4906f9..98f4c7bc 100644 --- a/Aster/Cata/cataSTA9/SD/sd_feti.py +++ b/Aster/Cata/cataSTA9/SD/sd_feti.py @@ -1,21 +1,21 @@ -#@ MODIF sd_feti SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_feti SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * @@ -34,8 +34,8 @@ class sd_feti1(AsBase): FLII = AsColl(acces='NO', stockage='DISPERSE', modelong='VARIABLE', type='I', ) FETB = AsColl(acces='NO', stockage='DISPERSE', modelong='VARIABLE', type='I', ) FETA = AsColl(acces='NO', stockage='DISPERSE', modelong='VARIABLE', type='I', ) - FETJ = AsVI(lonmax=20, ) - FETI = AsVI(lonmax=40, ) + FETJ = AsVI() + FETI = AsVI() FETH = AsVI(lonmax=4, ) diff --git a/Aster/Cata/cataSTA9/SD/sd_fiss_xfem.py b/Aster/Cata/cataSTA9/SD/sd_fiss_xfem.py index f97c2699..3cad8b63 100644 --- a/Aster/Cata/cataSTA9/SD/sd_fiss_xfem.py +++ b/Aster/Cata/cataSTA9/SD/sd_fiss_xfem.py @@ -1,21 +1,21 @@ -#@ MODIF sd_fiss_xfem SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_fiss_xfem SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * @@ -45,43 +45,58 @@ class sd_contact_xfem(AsBase): +class sd_xfem_com1(AsBase): +#------------------------------- +# champs communs aux sd_fiss_xfem et sd_modele : + + nomj = SDNom(fin=8) + + # cham_no : + BASLOC = sd_cham_no() + LNNO = sd_cham_no() + LTNO = sd_cham_no() + STNO = sd_cham_no() + + # cham_elem : + topose_pin = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOSE.PIN'))) + topose_cns = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOSE.CNS'))) + topose_hea = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOSE.HEA'))) + topose_lon = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOSE.LON'))) + topofac_pi = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOFAC.PI'))) + topofac_ai = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOFAC.AI'))) + topofac_cf = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOFAC.CF'))) + topofac_lo = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOFAC.LO'))) + topofac_ba = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOFAC.BA'))) + + + class sd_fiss_xfem(AsBase): #------------------------------- nomj = SDNom(fin=8) - CARAFOND = AsVR(lonmax=7) + CARAFOND = AsVR() FONDFISS = AsVR() GROUP_MA_ENRI = AsVI() GROUP_NO_ENRI = AsVI() FONDMULT = Facultatif(AsVI()) - contact = Facultatif(sd_contact_xfem(SDNom(nomj='.CONTACT'))) + CONTACT = Facultatif(sd_contact_xfem()) - MAILFISS__INDIC = AsVI(SDNom(nomj='.MAILFISS .INDIC'), lonmax=6, ) - mailfiss = Facultatif(sd_mailfiss_xfem(SDNom(nomj='.MAILFISS'))) + mailfiss_indic = AsVI(SDNom(nomj='.MAILFISS .INDIC'), lonmax=6, ) + MAILFISS = Facultatif(sd_mailfiss_xfem()) + # sd_xfem_com1 (idem sd_modele) : + com1 = sd_xfem_com1(SDNom(nomj='')) + # cham_no : - basco = Facultatif(sd_cham_no(SDNom(nomj='.BASCO'))) - basloc = sd_cham_no(SDNom(nomj='.BASLOC')) - grlnno = sd_cham_no(SDNom(nomj='.GRLNNO')) - grltno = sd_cham_no(SDNom(nomj='.GRLTNO')) - lnno = sd_cham_no(SDNom(nomj='.LNNO')) - ltno = sd_cham_no(SDNom(nomj='.LTNO')) - stno = sd_cham_no(SDNom(nomj='.STNO')) - stnor = sd_cham_no(SDNom(nomj='.STNOR')) + BASCO = Facultatif(sd_cham_no()) + GRLNNO = sd_cham_no() + GRLTNO = sd_cham_no() + STNOR = sd_cham_no() # cham_elem : - topose_pin = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOSE.PIN'))) - topose_cns = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOSE.CNS'))) - topose_hea = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOSE.HEA'))) - topose_lon = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOSE.LON'))) topose_cri = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOSE.CRI'))) - topofac_pi = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOFAC.PI'))) - topofac_ai = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOFAC.AI'))) - topofac_cf = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOFAC.CF'))) - topofac_lo = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOFAC.LO'))) - topofac_ba = Facultatif(sd_cham_elem(SDNom(nomj='.TOPOFAC.BA'))) pro_mes_el = Facultatif(sd_cham_elem(SDNom(nomj='.PRO.MES_EL'))) pro_normal = Facultatif(sd_cham_elem(SDNom(nomj='.PRO.NORMAL'))) diff --git a/Aster/Cata/cataSTA9/SD/sd_fonction.py b/Aster/Cata/cataSTA9/SD/sd_fonction.py index 28baafbf..4167db53 100644 --- a/Aster/Cata/cataSTA9/SD/sd_fonction.py +++ b/Aster/Cata/cataSTA9/SD/sd_fonction.py @@ -1,25 +1,26 @@ -#@ MODIF sd_fonction SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_fonction SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * from SD.sd_titre import sd_titre +from SD.sd_util import * class sd_fonction(sd_titre): @@ -29,4 +30,104 @@ class sd_fonction(sd_titre): VALE = AsObject(acces='NU', sd_stockage='CONTIG', modelong='VARIABLE', type='R', xous=Parmi('S', 'X'), genr='V', ltyp=8, ) PARA = Facultatif(AsVR()) + # existence possible de la SD : + def exists(self): + return self.PROL.exists + + def check_PROL(self,checker) : + #------------------------------- + if not self.exists() : return + + prol=self.PROL.get() + assert prol , self + typfon= prol[0].strip() + assert typfon in ('CONSTANT', 'FONCTION', 'FONCT_C', 'NAPPE', 'INTERPRE') ,prol + + #ltabul = True : la fonction est tabulée (et non interpretée) + ltabul = typfon != 'INTERPRE' + + if typfon == 'NAPPE' : + assert len(prol) > 6 , (prol,self) + else : + assert len(prol) == 5 , (prol,self) + + if ltabul : # type d'interpolation + interp= prol[1].strip() + assert interp[:3] in ('NON', 'LIN', 'LOG') , prol + assert interp[4:] in ('NON', 'LIN', 'LOG') , prol + + if ltabul : # nom d'un paramètre + para=prol[2].strip() + assert para != '', prol + + assert prol[3].strip() != '' , prol # type du résultat + + if ltabul : # prolongement à droite et à gauche + prolgd=prol[4].strip() + assert len(prolgd)==2, prol + assert prolgd[0] in ('E', 'C', 'L', 'I'), prol + assert prolgd[1] in ('E', 'C', 'L', 'I'), prol + + if typfon == 'NAPPE' : + nf= (len(prol) - 6)/2 + assert len(prol)==6+2*nf, prol + # 1er paramètre de la nappe + assert prol[5].strip() != '' , prol + + for kf in range(nf): + interp= prol[5+2*kf+1].strip() + prolgd= prol[5+2*kf+2].strip() + assert interp[:3] in ('NON', 'LIN', 'LOG') , prol + assert interp[4:] in ('NON', 'LIN', 'LOG') , prol + assert prolgd[0] in ('E', 'C', 'L', 'I'), prol + assert prolgd[1] in ('E', 'C', 'L', 'I'), prol + + + def check_VALE(self,checker) : + #------------------------------- + if not self.exists() : return + + prol=self.PROL.get() + vale=self.VALE.get() + typfon= prol[0].strip() + + if typfon=='CONSTANT' : + assert len(vale)==2, (vale,self) + + elif typfon=='FONCTION' : + nbpt=len(vale)/2 + assert len(vale)==2*nbpt, (vale,self) + if nbpt > 1 : + assert sdu_monotone(vale[:nbpt]) in (1,),(nbpt,vale,self) + + elif typfon=='FONCT_C' : + nbpt=len(vale)/3 + assert len(vale)==3*nbpt, (vale,self) + if nbpt > 1 : + # print "AJACOT fonction=",self + assert sdu_monotone(vale[:nbpt]) in (1,),(nbpt,vale,self) + + elif typfon=='NAPPE' : + nbfonc=len(vale.keys()) + for k in range(nbfonc): + val1=vale[k+1] + nbpt=len(val1)/2 + assert len(val1)==2*nbpt, (val1,self) + if nbpt > 1 : + assert sdu_monotone(val1[:nbpt]) in (1,),(nbpt,val1,self) + + + def check_NAPPE(self,checker) : + #------------------------------- + if not self.exists() : return + + prol=self.PROL.get() + typfon= prol[0].strip() + if typfon != 'NAPPE' : return + + para=self.PARA.get() + if len(para) > 1 : + assert sdu_monotone(para) in (1,),(para,self) + vale=self.VALE.get() + assert len(para)==len(vale.keys()),self diff --git a/Aster/Cata/cataSTA9/SD/sd_interf_dyna_clas.py b/Aster/Cata/cataSTA9/SD/sd_interf_dyna_clas.py index b2fb9931..75d5878d 100644 --- a/Aster/Cata/cataSTA9/SD/sd_interf_dyna_clas.py +++ b/Aster/Cata/cataSTA9/SD/sd_interf_dyna_clas.py @@ -1,27 +1,27 @@ -#@ MODIF sd_interf_dyna_clas SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_interf_dyna_clas SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * from SD.sd_maillage import sd_maillage from SD.sd_nume_ddl import sd_nume_ddl -import SD.sd_util as sdu +from SD.sd_util import * class sd_interf_dyna_clas(AsBase): @@ -41,17 +41,17 @@ class sd_interf_dyna_clas(AsBase): refe=self.IDC_REFE.get() desc=self.IDC_DESC.get() - sd2=sd_maillage(refe[0]) ; sd2.check() - sd2=sd_nume_ddl(refe[1]) ; sd2.check() - sdu.compare(self.IDC_DESC, checker, refe[2].strip(), '==', '', comment='REFE[2]') + sd2=sd_maillage(refe[0]) ; sd2.check(checker) + sd2=sd_nume_ddl(refe[1]) ; sd2.check(checker) + sdu_compare(self.IDC_DESC, checker, refe[2].strip(), '==', '', comment='REFE[2]') - nomgd=sdu.nom_gd(desc[3]) - sdu.compare(self.IDC_DESC, checker, nomgd, '==', 'DEPL_R', comment='DESC[3]') + nomgd=sdu_nom_gd(desc[3]) + sdu_compare(self.IDC_DESC, checker, nomgd, '==', 'DEPL_R', comment='DESC[3]') - sdu.compare(self.IDC_DESC, checker, desc[0], '==', 1, comment='DESC[0]') - sdu.compare(self.IDC_DESC, checker, desc[4], '>', 0, comment='DESC[4]') + sdu_compare(self.IDC_DESC, checker, desc[0], '==', 1, comment='DESC[0]') + sdu_compare(self.IDC_DESC, checker, desc[4], '>', 0, comment='DESC[4]') freq=self.IDC_DY_FREQ.get() - sdu.compare(self.IDC_DY_FREQ, checker, freq[0], '>', 0., comment='FREQ[0]') + sdu_compare(self.IDC_DY_FREQ, checker, freq[0], '>', 0., comment='FREQ[0]') # nbint = ??? à finir PB_AJACOT diff --git a/Aster/Cata/cataSTA9/SD/sd_l_table.py b/Aster/Cata/cataSTA9/SD/sd_l_table.py index 9b62208d..f2605ff9 100644 --- a/Aster/Cata/cataSTA9/SD/sd_l_table.py +++ b/Aster/Cata/cataSTA9/SD/sd_l_table.py @@ -1,39 +1,55 @@ -#@ MODIF sd_l_table SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_l_table SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * from SD.sd_table import sd_table +from SD.sd_util import * class sd_l_table(AsBase): -#--------------------- +#------------------------ nomj = SDNom(fin=19) - LTNT = AsVK16(lonmax=7) - LTNS = AsVK24(lonmax=7) + # la SD l_table (liste de tables) est une SD destinée à stocker un ensemble de tables + # les tables stockées dans la l_table sont identifiées par un "petit nom" (K16) + + LTNT = AsVK16() + LTNS = AsVK24() + + + # existence possible de la SD : + def exists(self): + return self.LTNT.exists or self.LTNS.exists # indirection vers les tables : def check_l_table_i_LTNS(self, checker): - lnom = self.LTNS.get() - if not lnom: return - for t in lnom: - if not t.strip(): continue - sd2 = sd_table(t) ; sd2.check(checker) + if not self.exists() : return + ltnt = self.LTNT.get() + ltns = self.LTNS.get() + nbtable=self.LTNT.lonuti + sdu_compare(self.LTNT,checker,nbtable,'>',0,'NBUTI(LTNT)>0') + sdu_compare(self.LTNS,checker,self.LTNS.lonuti,'==',nbtable,'NBUTI(LTNS)==NBUTI(LTNT)') + for k in range(nbtable) : + petinom=ltnt[k].strip() + nomtabl=ltns[k].strip() + sdu_compare(self.LTNT,checker,petinom,'!=','',"LTNT[k]!=''") + sdu_compare(self.LTNS,checker,nomtabl,'!=','',"LTNS[k]!=''") + sd2 = sd_table(nomtabl) ; sd2.check(checker) diff --git a/Aster/Cata/cataSTA9/SD/sd_macr_elem_dyna.py b/Aster/Cata/cataSTA9/SD/sd_macr_elem_dyna.py index 5669d503..7e94b733 100644 --- a/Aster/Cata/cataSTA9/SD/sd_macr_elem_dyna.py +++ b/Aster/Cata/cataSTA9/SD/sd_macr_elem_dyna.py @@ -1,28 +1,30 @@ -#@ MODIF sd_macr_elem_dyna SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_macr_elem_dyna SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * -import SD.sd_util as sdu +from SD.sd_util import * +from SD.sd_nume_ddl_gd import sd_nume_ddl_gd class sd_macr_elem_dyna_m(AsBase): +#---------------------------------- nomj = SDNom(fin=18) DESC = AsVI (SDNom(nomj='_DESC'),lonmax=3) REFE = AsVK24 (SDNom(nomj='_REFE'),lonmax=2) @@ -31,14 +33,28 @@ class sd_macr_elem_dyna_m(AsBase): def check_macr_elem_dyna_m_1(self,checker): vale=self.VALE.get() if not vale : return # si Facultatif() - self.DESC.tous_compris(checker,vmin=1) + + sdu_tous_compris(self.DESC,checker,vmin=1) nbdef=self.DESC.get()[1] - sdu.compare(self.VALE, checker, len(vale), '==', (nbdef*(nbdef+1))/2, comment='lonmax(VALE)') + sdu_compare(self.VALE,checker,len(vale),'==',(nbdef*(nbdef+1))/2,'LONMAX(VALE)') class sd_macr_elem_dyna(AsBase): +#------------------------------- nomj = SDNom(fin=8) + # description géométrique et topolique : + DESM = AsVI(lonmax=10) + REFM = AsVK8() + LINO = AsVI() + CONX = Facultatif(AsVI()) + + # rigidité, masse, amortissement condensés : + nume = sd_nume_ddl_gd(SDNom(nomj='')) + KP_EE = Facultatif(AsVR()) + MP_EE = Facultatif(AsVR()) + AP_EE = Facultatif(AsVR()) + MAEL_RAID = sd_macr_elem_dyna_m() MAEL_MASS = sd_macr_elem_dyna_m() MAEL_AMOR = Facultatif(sd_macr_elem_dyna_m()) @@ -49,7 +65,9 @@ class sd_macr_elem_dyna(AsBase): MAEL_DESC = AsVI(lonmax=3, ) MAEL_REFE = AsVK24(lonmax=2, ) + + def check_macr_elem_dyna_1(self,checker): nbdef=self.MAEL_MASS.DESC.get()[1] - sdu.compare(self.MAEL_INER_VALE, checker, len(self.MAEL_INER_VALE.get()), '==', 3*nbdef, comment='lonmax(MAEL_INER_VALE)') + sdu_compare(self.MAEL_INER_VALE, checker,len(self.MAEL_INER_VALE.get()),'==',3*nbdef,'LONMAX(MAEL_INER_VALE)') diff --git a/Aster/Cata/cataSTA9/SD/sd_mater.py b/Aster/Cata/cataSTA9/SD/sd_mater.py index 43cb9d08..db07aab8 100644 --- a/Aster/Cata/cataSTA9/SD/sd_mater.py +++ b/Aster/Cata/cataSTA9/SD/sd_mater.py @@ -1,21 +1,21 @@ -#@ MODIF sd_mater SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_mater SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * @@ -23,10 +23,23 @@ from SD import * from SD.sd_fonction import sd_fonction from SD.sd_compor1 import sd_compor1 +class sd_mater_RDEP(AsBase): +#--------------------------- + # on dirait une fonction, mais c'est plutot la concaténation de plusieurs fonctions + nomj = SDNom(fin=8) + PROL = AsVK16() + VALE = AsVR() + + class sd_mater(AsBase): +#---------------------- nomj = SDNom(fin=8) NOMRC = AsVK16(SDNom(nomj='.MATERIAU.NOMRC'), ) - rdep = Facultatif(sd_fonction(SDNom(nomj='.&&RDEP', fin=19))) + rdep = Facultatif(sd_mater_RDEP(SDNom(nomj='.&&RDEP'))) + + # existence possible de la SD : + def exists(self): + return self.NOMRC.exists # indirection vers les COMPOR1 de NOMRC : def check_mater_i_NOMRC(self, checker): diff --git a/Aster/Cata/cataSTA9/SD/sd_matr_asse_com.py b/Aster/Cata/cataSTA9/SD/sd_matr_asse_com.py index 13070207..5c21ea1f 100644 --- a/Aster/Cata/cataSTA9/SD/sd_matr_asse_com.py +++ b/Aster/Cata/cataSTA9/SD/sd_matr_asse_com.py @@ -1,21 +1,21 @@ -#@ MODIF sd_matr_asse_com SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_matr_asse_com SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * @@ -33,7 +33,7 @@ class sd_matr_asse_com(sd_titre): VALM = AsColl(acces='NU', stockage='DISPERSE', modelong='CONSTANT', type=Parmi('C', 'R'), ltyp=Parmi(16, 8), ) UALF = Facultatif(AsColl(acces='NU', stockage='DISPERSE', modelong='CONSTANT', type=Parmi('C', 'R'), ltyp=Parmi(16, 8), )) VALF = Facultatif(AsColl(acces='NU', stockage='DISPERSE', modelong='VARIABLE', type=Parmi('C', 'R'), ltyp=Parmi(16, 8), )) - CONL = Facultatif(AsVR()) + CONL = Facultatif(OJBVect(type=Parmi('C', 'R'))) LIME = Facultatif(AsVK8(lonmax=1, )) cine = Facultatif(sd_matr_cine(SDNom(nomj=''))) diff --git a/Aster/Cata/cataSTA9/SD/sd_matr_asse_gene.py b/Aster/Cata/cataSTA9/SD/sd_matr_asse_gene.py index 0642796b..4bef8f56 100644 --- a/Aster/Cata/cataSTA9/SD/sd_matr_asse_gene.py +++ b/Aster/Cata/cataSTA9/SD/sd_matr_asse_gene.py @@ -1,21 +1,21 @@ -#@ MODIF sd_matr_asse_gene SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_matr_asse_gene SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * @@ -25,16 +25,18 @@ from SD.sd_nume_ddl_gene import sd_nume_ddl_gene class sd_matr_asse_gene(sd_matr_asse_com): -#----------------------------------- +#----------------------------------------- nomj = SDNom(fin=19) - DESC = Facultatif(AsVI(SDNom(debut=19), lonmax=3, )) + DESC = Facultatif(AsVI(lonmax=3,)) # PB_JACOT : n'existe pas toujours : exemple : fdlv105a + + def exists(self): + return self.REFA.exists # indirection vers sd_nume_ddl à faire car FACT_LDLT modifie le sd_nume_ddl_gene de la sd_matr_asse : def check_matr_asse_gene_i_REFA(self, checker): - # on est obligé de se protéger dans le cas des Facultatif(sd_matr_asse) : - if not self.REFA.get() : return + if not self.exists : return nom=self.REFA.get()[1] sd2=sd_nume_ddl_gene(nom) ; sd2.check(checker) diff --git a/Aster/Cata/cataSTA9/SD/sd_melasflu.py b/Aster/Cata/cataSTA9/SD/sd_melasflu.py index aa19b082..eecf0741 100644 --- a/Aster/Cata/cataSTA9/SD/sd_melasflu.py +++ b/Aster/Cata/cataSTA9/SD/sd_melasflu.py @@ -1,29 +1,32 @@ -#@ MODIF sd_melasflu SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_melasflu SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * from SD.sd_l_table import sd_l_table from SD.sd_table import sd_table -from SD.sd_champ import sd_champ +from SD.sd_cham_no import sd_cham_no from SD.sd_matr_asse_gene import sd_matr_asse_gene +from SD.sd_type_flui_stru import sd_type_flui_stru +from SD.sd_resultat_dyn import sd_resultat_dyn +from SD.sd_util import * class sd_melasflu(AsBase): @@ -37,28 +40,135 @@ class sd_melasflu(AsBase): NUMO = AsVI(SDNom(debut=19)) FACT = AsVR(SDNom(debut=19), ) DESC = AsVK16(SDNom(debut=19), lonmax=1, ) - col1 = AsVK24(SDNom(debut=19,nomj='.0001')) - col3 = Facultatif(AsVK24(SDNom(debut=8,nomj='.TB000000 .0003'))) - col4 = Facultatif(AsVK24(SDNom(debut=8,nomj='.TB000000 .0004'))) - col5 = Facultatif(AsVK24(SDNom(debut=8,nomj='.TB000000 .0005'))) - - sd_l_table = Facultatif(sd_l_table(SDNom(nomj=''))) - sd_table = Facultatif(sd_table(SDNom(nomj=''))) - - # indirection vers des champs : - def check_melasflu_i_COL1(self, checker): - lnom = self.col1.get() - for nom in lnom : - if not nom.strip(): continue - sd2 = sd_champ(nom) ; sd2.check(checker) - - # indirection vers des sd_matr_asse : - def check_melasflu_i_COL345(self, checker): - lnom=[] - if self.col3.get() : lnom= lnom+list(self.col3.get()) - if self.col4.get() : lnom= lnom+list(self.col4.get()) - if self.col5.get() : lnom= lnom+list(self.col5.get()) - for nom in lnom : - if not nom.strip(): continue - sd2 = sd_matr_asse_gene(nom) ; sd2.check(checker) + + # Critère présence VCN et VEN ???? + VCN = Facultatif(AsVR()) + VEN = Facultatif(AsVR()) + + sd_l_table = Facultatif(sd_l_table(SDNom(nomj=''))) # Si faisceau axial + sd_table = sd_table(SDNom(nomj='')) + + + # indirections via .REMF : + #---------------------------------- + def check_melasflu_i_REMF(self, checker): + lnom=self.REMF.get() + sd2 = sd_type_flui_stru(lnom[0]) ; sd2.check(checker) + sd2 = sd_resultat_dyn(lnom[1]) ; sd2.check(checker) + + + # Vérifications supplémentaires : + #---------------------------------- + def check_veri1(self, checker): + desc=self.DESC.get() + numo=self.NUMO.get() + fact=self.FACT.get() + freq=self.FREQ.get() + masg=self.MASG.get() + vite=self.VITE.get() + vcn=self.VCN.get() + ven=self.VEN.get() + l_table = sd_l_table(self.nomj) # Si faisceau axial + + # calcul de itypfl (type d'interaction fluide / structure) : + typfl = sd_type_flui_stru(self.REMF.get()[0]) + itypfl=typfl.FSIC.get()[0] + + # calcul de nbmode (nombre de modes) : + nbmode=len(numo) + + # calcul de nbvite (nombre de vitesses) : + nbvite=len(vite) + + # vérification de l'objet .DESC : + #-------------------------------- + sdu_compare(self.DESC,checker,desc[0].strip(),'==','DEPL','DESC[1]=="DEPL"') + + # vérification de l'objet .NUMO : + #-------------------------------- + sdu_tous_compris(self.NUMO,checker,vmin=1) + + # vérification de l'objet .FACT : + #-------------------------------- + if itypfl==3 : # faisceau axial + sdu_compare(self.FACT,checker,len(fact),'==',3*nbmode*nbvite,'LONMAX(FACT)==3*nbmode*nbvite') + else : + sdu_compare(self.FACT,checker,len(fact),'==',3*nbmode,'LONMAX(FACT)==3*nbmode') + + # vérification de l'objet .MASG : + #-------------------------------- + if itypfl==3 : # faisceau axial + sdu_compare(self.MASG,checker,len(masg),'==',nbmode*nbvite,'LONMAX(MASG)==nbmode*nbvite') + else : + sdu_compare(self.MASG,checker,len(masg),'==',nbmode,'LONMAX(MASG)==nbmode') + + # vérification de l'objet .FREQ : + #-------------------------------- + sdu_compare(self.FREQ,checker,len(freq),'==',2*nbmode*nbvite,'LONMAX(FREQ)==2*nbmode*nbvite') + + # vérification de l'objet .VCN : + #-------------------------------- + if vcn : + fsvi=typfl.FSVI.get() + nbzex=len(fsvi) + nbval=1 + for i in range(nbzex) : + nbval=nbval+fsvi[nbzex+i] + sdu_compare(self.VCN,checker,len(vcn),'==',nbmode,'LONMAX(VCN)==nbmode*nbval') + + # vérification de l'objet .VEN : + #-------------------------------- + if ven : + sdu_compare(self.VEN,checker,len(ven),'==',nbmode,'LONMAX(VEN)==nbmode') + + + # vérification de la SD table contenant les cham_no : + #---------------------------------------------------- + tcham=sd_table(self.nomj) + sdu_compare(None,checker,tcham.nb_column(),'==',1,"1 seule colonne dans la table") + col1=tcham.get_column_name('NOM_CHAM') + sdu_assert(None, checker, col1, "Manque colonne NOM_CHAM") + + data=col1.data.get() + mask=col1.mask.get() + profchno='' + for k in range(len(mask)): + if not mask[k] : continue + ch1=sd_cham_no(data[k]) + ch1.check(checker) + + # Tous les cham_no doivent avoir le meme prof_chno : + profchn1=ch1.REFE.get()[1] + if profchno == '': + profchno=profchn1 + else: + sdu_compare(None,checker,profchn1,'==',profchno,"Tous PROFCHNO identiques") + + + # vérification de la SD l_table : + #-------------------------------- + if itypfl==3 : # faisceau axial + l_table.check(checker) + + # la l_table ne contient qu'une seule table nommée 'MATR_GENE' + sdu_compare(l_table.LTNT,checker,l_table.LTNT.lonuti,'==',1,"LONUTI(LTNT)==1") + sdu_compare(l_table.LTNT,checker,l_table.LTNT.get()[0].strip(),'==','MATR_GENE',"LTNT[0]==MATR_GENE") + + # vérification de la table 'MATR_GENE' : + tmatgen=sd_table(l_table.LTNS.get()[0]) + col1=tmatgen.get_column_name('NUME_VITE') + sdu_assert(None, checker, col1, "Manque colonne NUME_VITE") + col1=tmatgen.get_column_name('VITE_FLUI') + sdu_assert(None, checker, col1, "Manque colonne VITE_FLUI") + + for x in 'MATR_RIGI', 'MATR_MASS', 'MATR_AMOR' : + col1=tmatgen.get_column_name(x) + sdu_assert(None, checker, col1, "Manque colonne : "+x) + data=col1.data.get() + mask=col1.mask.get() + for k in range(len(mask)): + if not mask[k] : continue + matgen=sd_matr_asse_gene(data[k]) + matgen.check(checker) + diff --git a/Aster/Cata/cataSTA9/SD/sd_modele.py b/Aster/Cata/cataSTA9/SD/sd_modele.py index 984e443d..0c17ca07 100644 --- a/Aster/Cata/cataSTA9/SD/sd_modele.py +++ b/Aster/Cata/cataSTA9/SD/sd_modele.py @@ -1,43 +1,72 @@ -#@ MODIF sd_modele SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_modele SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * from SD.sd_ligrel import sd_ligrel -from SD.sd_fiss_xfem import sd_fiss_xfem +from SD.sd_fiss_xfem import sd_fiss_xfem, sd_xfem_com1 +from SD.sd_prof_chno import sd_prof_chno + + +class sd_modele_XFEM(AsBase): +#----------------------------- + nomj = SDNom(fin=8) + # Questions aux responsables XFEM : + # - faut-il garder FISS et NFIS ? + # - Est-il normal de modifier les sd_fiss_xfem dans MODI_MODELE_XFEM ? + + CONT = AsVI() + SDCONT = AsVK24() + FISS = AsVK8() + NFIS = AsVI(lonmax=1,) # nombre de fissures + com1 = sd_xfem_com1(SDNom(nomj='')) + + glute_XFEM = Facultatif(sd_prof_chno(SDNom(nomj='.PRCHN00000'))) # fiche 10833 + + + if 0 : + # Questions aux responsables XFEM : + # - faut-il garder FISS et NFIS ? + # - Est-il normal de modifier les sd_fiss_xfem dans MODI_MODELE_XFEM ? + # indirection vers FISS_XFEM car MODI_MODELE_XFEM modifie FISS_XFEM + # (Damijan va corriger cela avec la multi-fissuration) + # ATTENTION : Ce bout de programme suppose que FISS est de longueur 1 ce qui contradictoire avec la multi-fissuration) + def check_modele_i_FISS(self, checker): + if not self.FISS.get() : return + nom=self.FISS.get()[0] + sd2=sd_fiss_xfem(nom) ; sd2.check(checker) + class sd_modele(AsBase): #----------------------------- nomj = SDNom(fin=8) - NOEUD = Facultatif(AsVI()) - SSSA = Facultatif(AsVI()) + + MODELE = sd_ligrel() NOEUD_UTIL = AsVI() - FISS = Facultatif(AsVK8(lonmax=1, )) + NOEUD = Facultatif(AsVI()) MAILLE = Facultatif(AsVI()) - modele = sd_ligrel(SDNom(nomj='.MODELE', fin=19)) - - # indirection vers FISS_XFEM car MODI_MODELE_XFEM modifie FISS_XFEM - # (Damijan va corriger cela avec la multi-fissuration) - def check_modele_i_FISS(self, checker): - if not self.FISS.get() : return - nom=self.FISS.get()[0] - sd2=sd_fiss_xfem(nom) ; sd2.check(checker) + + # Si modèle avec sous-structures statiques : + SSSA = Facultatif(AsVI()) + + # Si modèle "XFEM" : + xfem = Facultatif(sd_modele_XFEM(SDNom(nomj=''))) diff --git a/Aster/Cata/cataSTA9/SD/sd_multi_appui.py b/Aster/Cata/cataSTA9/SD/sd_multi_appui.py new file mode 100644 index 00000000..0c869865 --- /dev/null +++ b/Aster/Cata/cataSTA9/SD/sd_multi_appui.py @@ -0,0 +1,30 @@ +#@ MODIF sd_multi_appui SD DATE 04/04/2007 AUTEUR ABBAS M.ABBAS +# -*- coding: iso-8859-1 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# ====================================================================== +from SD import * + +class sd_multi_appui(AsBase): +#------------------------------------ + nomj = SDNom(fin=19) + + FDEP=AsVK8() + FVIT=AsVK8() + FACC=AsVK8() + MULA=AsVI() + PSID=AsVR() diff --git a/Aster/Cata/cataSTA9/SD/sd_proj_modal.py b/Aster/Cata/cataSTA9/SD/sd_proj_modal.py new file mode 100644 index 00000000..58889bbc --- /dev/null +++ b/Aster/Cata/cataSTA9/SD/sd_proj_modal.py @@ -0,0 +1,39 @@ +#@ MODIF sd_proj_modal SD DATE 04/04/2007 AUTEUR ABBAS M.ABBAS +# -*- coding: iso-8859-1 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# ====================================================================== +from SD import * + +class sd_proj_modal(AsBase): +#------------------------------------ + nomj = SDNom(fin=19) + + MASG=AsVR() + + AGEM=AsVR() + AGEP=AsVR() + VGEM=AsVR() + VGEP=AsVR() + DGEM=AsVR() + DGEP=AsVR() + RIGG=AsVR() + AMOG=AsVR() + BASM=AsVR() + FONG=Facultatif(AsVK24()) + FORG=Facultatif(AsVR()) + diff --git a/Aster/Cata/cataSTA9/SD/sd_resultat.py b/Aster/Cata/cataSTA9/SD/sd_resultat.py index bd533ebd..d936900a 100644 --- a/Aster/Cata/cataSTA9/SD/sd_resultat.py +++ b/Aster/Cata/cataSTA9/SD/sd_resultat.py @@ -1,21 +1,21 @@ -#@ MODIF sd_resultat SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_resultat SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * @@ -24,30 +24,43 @@ from SD.sd_titre import sd_titre from SD.sd_l_table import sd_l_table from SD.sd_champ import sd_champ from SD.sd_l_charges import sd_l_charges +from SD.sd_char_contact import sd_char_contact from sets import Set +from SD.sd_util import * import aster class sd_resultat(sd_titre): #--------------------------------------- nomj = SDNom(fin=8) - TAVA = Facultatif(AsColl(SDNom(debut=19), acces='NU', stockage='CONTIG', modelong='CONSTANT', type='K', ltyp=8, )) + TAVA = AsColl(SDNom(debut=19), acces='NU', stockage='CONTIG', modelong='CONSTANT', type='K', ltyp=8, ) NOVA = AsObject(SDNom(debut=19), genr='N', xous='S', type='K', ltyp=16, ) TACH = AsColl(SDNom(debut=19), acces='NU', stockage='CONTIG', modelong='CONSTANT', type='K', ltyp=24, ) ORDR = AsVI(SDNom(debut=19), ) DESC = AsObject(SDNom(debut=19), genr='N', xous='S', type='K', ltyp=16, ) - # la déclaration suivante simplifie la sd_fonction check_resultat_i_char - CHAR = Facultatif(AsVI(SDNom(debut=19),type='K', ltyp=24, )) + + # la déclaration suivante simplifie la fonction check_resultat_i_char + CHAR = Facultatif(AsVK24(SDNom(debut=19),)) sd_l_table = Facultatif(sd_l_table(SDNom(nomj=''))) + # existence de la SD : + def exists(self): + return self.ORDR.exists + + + # glute XFEM : + def check_glute_XFEM(self, checker): + sd2 = sd_char_contact('&&OP0070.DEFIC') + sd2.check(checker) + + # indirection vers les champs de .TACH : def check_resultat_i_TACH(self, checker): - lnom = self.TACH.get() - if not lnom: return - for k in lnom.keys(): - for nom in lnom[k] : + tach = self.TACH.get() + for nosym in tach.keys(): + for nom in tach[nosym] : if not nom.strip(): continue sd2 = sd_champ(nom) sd2.check(checker) @@ -55,12 +68,11 @@ class sd_resultat(sd_titre): # indirection vers les objets de .TAVA : def check_resultat_i_TAVA(self, checker): - lnom = self.TAVA.get() - if not lnom: return + tava = self.TAVA.get() S1=Set() - for k in lnom.keys(): - suffix=lnom[k][0][:5] - if not suffix.strip(): continue + for knova in tava.keys(): + suffix=tava[knova][0][:5] + if not suffix.strip(): continue # JP : est-ce possible ? S1.add(suffix) for suffix in S1 : nom=self.nomj()[:19]+suffix @@ -79,3 +91,84 @@ class sd_resultat(sd_titre): for nom in S1 : sd2 = sd_l_charges(nomj=nom); sd2.check(checker) + + # vérification de .ORDR : + def check_ORDR(self, checker): + V = self.ORDR + nuti=V.lonuti + nmax=V.lonmax + sdu_compare(V, checker, nuti, '> ', 0 , comment='nuti > 0') + sdu_compare(V, checker, nuti, '<=', nmax, comment='nuti <= nmax') + + # les numeros d'ordre doivent etre tous différents : + sdu_tous_differents(V,checker,V.get()[:nuti],'1:NUTI') + + + # vérification des longueurs des différents objets : + def check_LONGUEURS(self, checker): + ordr = self.ORDR.get() + tach = self.TACH.get() + nova = self.NOVA.get() + tava = self.TAVA.get() + desc = self.DESC.get() + + nbmax_ordr=len(ordr) # la SD est concue pour stocker jusqu'à nbmax_ordr nume_ordre + nbmax_para=len(nova) # la SD est concue pour stocker jusqu'à nbmax_para paramètres + nbmax_nosym=len(desc) # la SD est concue pour stocker jusqu'à nbmax_nosym nom_cham + + sdu_compare(self.TACH,checker,len(tach),'==',nbmax_nosym,'Incohérence TACH/DESC') + sdu_compare(self.TAVA,checker,len(tava),'==',nbmax_para, 'Incohérence TAVA/NOVA') + + # .TACH + for ksym in tach.keys(): + nosym=desc[ksym-1].strip() + sdu_compare(self.TACH,checker,len(tach[ksym]),'==',nbmax_ordr,nosym+' LONMAX(.TACH) != LONMAX(.ORDR)') + + + # objets trouvés dans .TAVA + for knova in tava.keys(): + sdu_compare(tava,checker,len(tava[knova]),'==',4,'LONMAX(TAVA[ksym]==4') + suffix=tava[knova][0][:5] + npara=int(tava[knova][2]) + if not suffix.strip(): continue + nom=self.nomj()[:19]+suffix + sd2 = AsObject(SDNom(nomj=nom,debut=0), xous='S', genr='V', type=Parmi('I','R','C','K'), + ltyp=Parmi(4,8,16,24),) + sdu_compare(sd2,checker,len(sd2.get()),'==',npara*nbmax_ordr,'Incohérence LONMAX / LONMAX(.ORDR)') + + + # vérification que les variables d'accès sont bien différentes : + def check_ACCES(self, checker): + ordr = self.ORDR.get() + nova = self.NOVA.get() + tava = self.TAVA.get() + + nbmax_ordr=len(ordr) # la SD est concue pour stocker jusqu'à nbmax_ordr nume_ordre + nbuti_ordr=self.ORDR.lonuti # la SD contient réellement nbuti_ordr nume_ordre + + + # objets trouvés dans .TAVA + for knova in tava.keys(): + nova1=nova[knova-1] + suffix=tava[knova][0][:5] + if not suffix.strip(): continue + + nupara=int(tava[knova][1]) + nbpara=int(tava[knova][2]) + acces=tava[knova][3].strip() + assert acces in ('PARA','ACCES') , acces + if acces == 'ACCES' : + # pour l'instant, on ne vérifie que 'INST' car 'FREQ', 'NUME_MODE', 'NOEUD_CMP' ne semblent pas tous différents ... + if nova1.strip() != 'INST' : continue + sdu_compare(tava,checker,nupara,'<=',nbpara,'nupara <= nbpara') + + nom=self.nomj()[:19]+suffix + sd2 = AsObject(SDNom(nomj=nom,debut=0),) + vect=sd2.get() + seq=[] + for k in range(nbuti_ordr) : + seq.append(vect[k*nbpara+nupara-1]) + + sdu_tous_differents(sd2,checker,seq,nova1) + + diff --git a/Aster/Cata/cataSTA9/SD/sd_sddyna.py b/Aster/Cata/cataSTA9/SD/sd_sddyna.py new file mode 100644 index 00000000..6cdcc863 --- /dev/null +++ b/Aster/Cata/cataSTA9/SD/sd_sddyna.py @@ -0,0 +1,33 @@ +#@ MODIF sd_sddyna SD DATE 04/04/2007 AUTEUR ABBAS M.ABBAS +# -*- coding: iso-8859-1 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# ====================================================================== +from SD import * + +class sd_sddyna(AsBase): +#------------------------------------ + nomj = SDNom(fin=15) + + TYPE_SCH=AsVK16(SDNom(nomj='.TYPE_SCH'),lonmax=8) + PARA_SCH=Facultatif(AsVR( SDNom(nomj='.PARA_SCH'),lonmax=4)) + INI_CONT=Facultatif(AsVR( SDNom(nomj='.INI_CONT'),lonmax=4)) + NOM_SD =Facultatif(AsVK24(SDNom(nomj='.NOM_SD' ),lonmax=3)) + TYPE_FOR=Facultatif(AsVI( SDNom(nomj='.TYPE_FOR'),lonmax=2)) + COEF_SCH=Facultatif(AsVR( SDNom(nomj='.COEF_SCH'),lonmax=4)) + INFO_SD =Facultatif(AsVL( SDNom(nomj='.INFO_SD' ),lonmax=5)) + diff --git a/Aster/Cata/cataSTA9/SD/sd_table.py b/Aster/Cata/cataSTA9/SD/sd_table.py index 191eb841..59fbdc9c 100644 --- a/Aster/Cata/cataSTA9/SD/sd_table.py +++ b/Aster/Cata/cataSTA9/SD/sd_table.py @@ -1,21 +1,21 @@ -#@ MODIF sd_table SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_table SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * @@ -30,20 +30,34 @@ class sd_table(sd_titre): TBLP = AsVK24(SDNom(debut=19), ) + def exists(self): + # retourne "vrai" si la SD semble exister (et donc qu'elle peut etre vérifiée) + return self.TBNP.exists + + def nb_column(self): + # retourne le nombre de colonnes de la table : + shape = self.TBNP.get() + return shape[0] + def get_column(self, i): + # retourne la colonne de numéro i nom = self.nomj()[:19]+".%04d"%i return Colonne( nom ) - def shape(self): - print self.nomj() - print self.TBNP.nomj(), self.TBNP.exists - print self.TBNP.get() - return tuple(self.TBNP.get()) + def get_column_name(self, name): + # retourne la colonne de nom name + shape = self.TBNP.get() + desc = self.TBLP.get() + for n in range(shape[0]): + nom = desc[4*n] + nom2= desc[4*n+2] + if nom.strip()==name.strip() : + return Colonne(nom2) + return None def check_table_1(self, checker): + if not self.exists() : return shape = self.TBNP.get() - if shape is None: - return desc = self.TBLP.get() for n in range(shape[0]): nom = desc[4*n+2] diff --git a/Aster/Cata/cataSTA9/SD/sd_type_flui_stru.py b/Aster/Cata/cataSTA9/SD/sd_type_flui_stru.py index 4134b1f3..fa3cceb1 100644 --- a/Aster/Cata/cataSTA9/SD/sd_type_flui_stru.py +++ b/Aster/Cata/cataSTA9/SD/sd_type_flui_stru.py @@ -1,41 +1,339 @@ -#@ MODIF sd_type_flui_stru SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_type_flui_stru SD DATE 09/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== from SD import * +from SD.sd_cara_elem import sd_cara_elem +from SD.sd_modele import sd_modele +from SD.sd_fonction import sd_fonction +from SD.sd_mater import sd_mater +from SD.sd_util import * class sd_type_flui_stru(AsBase): -#------------------------------------ +#=============================================================== nomj = SDNom(fin=8) - FSIC = AsVI(SDNom(debut=19),lonmax=2, ) + FSIC = AsVI(SDNom(debut=19),lonmax=2,) - # AJACOT_PB : j'ai du ajouter plusieurs Facultatifs (sdll116a) - # il y en a vraiment beaucoup maintenant !! FSGM = Facultatif(AsVK8(SDNom(debut=19))) FSVR = Facultatif(AsVR(SDNom(debut=19))) FSVK = Facultatif(AsVK8(SDNom(debut=19))) FSVI = Facultatif(AsVI(SDNom(debut=19))) - FSCR = Facultatif(AsVR(SDNom(debut=19),lonmax=18, )) - FSGR = Facultatif(AsVR(SDNom(debut=19),lonmax=7, )) - UNIT_FAISCEAU = Facultatif(AsVI()) - UNIT_GRAPPES = Facultatif(AsVI()) + FSCR = Facultatif(AsVR(SDNom(debut=19))) + FSGR = Facultatif(AsVR(SDNom(debut=19))) + UNIT_FAISCEAU = Facultatif(AsVI(lonmax=2,)) + UNIT_GRAPPES = Facultatif(AsVI(lonmax=2,)) + def exists(self): + # retourne "vrai" si la SD semble exister (et donc qu'elle peut etre vérifiée) + return self.FSIC.exists + + def u_veri1(self): + #----------------------- + # retourne 2 variables utiles pour les routines chech_xxxx + # type_faisceau : type de faisceau (configuration) + # couplage : indicateur de couplage + fsic=self.FSIC.get() + type_faisceau=fsic[0] + couplage=fsic[1] + return type_faisceau, couplage + + + + def check_FSIC(self,checker): # objet .FSIC + #=============================================================== + fsic=self.FSIC.get() + type_faisceau, couplage= self.u_veri1() + assert type_faisceau in (1,2,3,4), (type_faisceau, fsic) + assert couplage in (0,1), (couplage,fsic) + + + + def check_FSVI(self,checker): # objet .FSVI + #=============================================================== + fsvi=self.FSVI.get() + type_faisceau, couplage= self.u_veri1() + + if type_faisceau == 1 : # FAISCEAU_TRANS + #----------------------------------------- + nbzone=fsvi[1] + sdu_compare(self.FSVI,checker,nbzone,'>',0,"nbzone > 0") + if couplage : + assert len(fsvi)==2+2*nbzone, fsvi + assert fsvi[0] in (1,2), fsvi + for indic in fsvi[2:2+nbzone] : + assert indic > 0 , (nbzone,fsvi,self) + for nbpt in fsvi[2+nbzone:2+2*nbzone] : + assert nbpt >= 0 , (nbzone,fsvi,self) # =0 possible : sdll136a + else : + assert len(fsvi)==2 + + if type_faisceau == 2 : # GRAPPE + #----------------------------------------- + sdu_assert(self.FSVI, checker, not fsvi, "type_faisceau == GRAPPE => FSVI ne doit pas exister") + + if type_faisceau == 3 : # FAISCEAU_AXIAL + #----------------------------------------- + lsimplif=fsvi[0] + # lsimplif=1 : faisceau simplifié + # lsimplif=0 : faisceau complet + + nbtype=fsvi[4] # nombre de types de grille + lgrille=nbtype > 0 + # lgrille=1 : on utilise des grilles + # lgrille=0 : on n'utilise pas de grille + + assert fsvi[0] in (0,1), fsvi + assert fsvi[1] in (1,2,3), fsvi + assert fsvi[2] in (1,2), fsvi + + if not lsimplif : # faisceau complet + if lgrille : + assert len(fsvi)==6+nbtype, fsvi + assert min(fsvi[3:]) > 0, fsvi + else: + assert len(fsvi)==5, fsvi + assert fsvi[3] >= 0, fsvi + + else : # faisceau simplifié + nbzone=fsvi[3] + if lgrille : + assert len(fsvi)==6+nbtype+nbzone, fsvi + assert min(fsvi[3:]) > 0, fsvi + else: + assert len(fsvi)==6+nbzone, fsvi + assert fsvi[3] > 0, fsvi + + if type_faisceau == 4 : # COQUE_COAX + #----------------------------------------- + assert len(fsvi)==2, fsvi + assert fsvi[0] in (0,1), fsvi + assert fsvi[1] in (1,2,3), fsvi + + + + def check_FSVK(self,checker): # objet .FSVK + #=============================================================== + fsvk=self.FSVK.get() + fsvi=self.FSVI.get() + type_faisceau, couplage= self.u_veri1() + + if type_faisceau == 1 : # FAISCEAU_TRANS + #----------------------------------------- + nbzone=fsvi[1] + assert len(fsvk)==4+nbzone, fsvk + carel=fsvk[0].strip() + assert carel != '', fsvk + sd2=sd_cara_elem(carel); sd2.check(checker) + assert fsvk[1].strip() in ('DX', 'DY', 'DZ'), fsvk + for k in range(2,4+nbzone) : + sd2=sd_fonction(fsvk[k]); sd2.check(checker) + + elif type_faisceau == 2 : # GRAPPE + #----------------------------------------- + if couplage : + assert len(fsvk)==4,(fsvk,self) + assert fsvk[0] != '',(fsvk,self) + # on pourrait vérifier que fsvk[1] est un nom de noeud + assert fsvk[1] != '',(fsvk,self) + sd2=sd_cara_elem(fsvk[2].strip()); sd2.check(checker) + sd2=sd_modele(fsvk[3].strip()); sd2.check(checker) + else: + assert not fsvk,(fsvk,self) + + elif type_faisceau == 3 : # FAISCEAU_AXIAL + #----------------------------------------- + lsimplif=fsvi[0] + if not lsimplif : + assert len(fsvk)==3,(fsvk,self) + sd2=sd_fonction(fsvk[0].strip()); sd2.check(checker) + sd2=sd_fonction(fsvk[1].strip()); sd2.check(checker) + sd2=sd_cara_elem(fsvk[2].strip()); sd2.check(checker) + else: + assert len(fsvk)==2,(fsvk,self) + sd2=sd_fonction(fsvk[0].strip()); sd2.check(checker) + sd2=sd_fonction(fsvk[1].strip()); sd2.check(checker) + + elif type_faisceau == 4 : # COQUE_COAX + #----------------------------------------- + assert len(fsvk)==3,(fsvk,self) + sd2=sd_cara_elem(fsvk[0].strip()); sd2.check(checker) + sd2=sd_mater(fsvk[1].strip()); sd2.check(checker) + sd2=sd_mater(fsvk[2].strip()); sd2.check(checker) + + + + def check_FSVR(self,checker): # objet .FSVR + #=============================================================== + fsvr=self.FSVR.get() + fsvi=self.FSVI.get() + type_faisceau, couplage= self.u_veri1() + + if type_faisceau == 1 : # FAISCEAU_TRANS + #----------------------------------------- + nbzone=fsvi[1] + if couplage : + assert len(fsvr)==3+2*nbzone,(fsvr,self) + else : + assert len(fsvr)==1,(fsvr,self) + sdu_tous_compris(self.FSVR,checker,vmin=0.,comment="FSVR > 0") + + elif type_faisceau == 2 : # GRAPPE + #----------------------------------------- + if couplage : + assert len(fsvr)==2,(fsvr,self) + sdu_tous_compris(self.FSVR,checker,vmin=0.,comment="FSVR > 0") + else : + assert not fsvr,(fsvr,self) + + elif type_faisceau == 3 : # FAISCEAU_AXIAL + #----------------------------------------- + lsimplif=fsvi[0] + if not lsimplif : + if fsvi[2]==1 : # enceinte circulaire + assert len(fsvr)==8,(fsvr,self) + else: # enceinte rectangulaire + assert len(fsvr)==10,(fsvr,self) + else : + nbzone=fsvi[3] + if fsvi[2]==1 : # enceinte circulaire + assert len(fsvr)==8+nbzone,(fsvr,self) + sdu_tous_compris(self.FSVR,checker,fsvi[8:],vmin=0.,comment="FSVR > 0") + else: # enceinte rectangulaire + assert len(fsvr)==10+nbzone,(fsvr,self) + sdu_tous_compris(self.FSVR,checker,fsvi[10:],vmin=0.,comment="FSVR > 0") + + elif type_faisceau == 4 : # COQUE_COAX + #----------------------------------------- + assert len(fsvr)==7,(fsvr,self) + sdu_tous_compris(self.FSVR,checker,vmin=0.,comment="FSVR > 0") + + + + def check_FSGM(self,checker): # objet .FSGM + #=============================================================== + fsgm=self.FSGM.get() + fsvi=self.FSVI.get() + type_faisceau, couplage= self.u_veri1() + + if type_faisceau in (1,2) : + #----------------------------------------- + assert not fsgm,(fsvi,self) + + elif type_faisceau == 3 : # FAISCEAU_AXIAL + #----------------------------------------- + nb1=fsvi[3] # nbgrma ou nbzone + if nb1==0 : + assert len(fsgm)==1,(fsgm,self) + else : + assert len(fsgm)==nb1,(fsgm,self) + sdu_tous_differents(self.FSGM,checker,comment='FAISCEAU_AXIAL') + + elif type_faisceau == 4 : # COQUE_COAX + #----------------------------------------- + assert len(fsgm)==2,(fsgm,self) + sdu_tous_differents(self.FSGM,checker,comment='COQUE_COAX') + + + + def check_FSGR(self,checker): # objet .FSGR + #=============================================================== + fsgr=self.FSGR.get() + fsvi=self.FSVI.get() + type_faisceau, couplage= self.u_veri1() + + if type_faisceau in (1,2,4) : + #----------------------------------------- + assert not fsgr,(fsvi,self) + + elif type_faisceau ==3 : + #----------------------------------------- + nbzone=fsvi[3] + nbtype=fsvi[4] # nombre de types de grille + if nbtype==0 : + assert not fsgr,(fsvi,self) + else : # il y a des grilles + lsimplif=fsvi[0] + if lsimplif : + nbgrille=fsvi[6+nbzone] + else : + nbgrille=fsvi[5] + assert len(fsgr)==nbgrille+6*nbtype,(fsgr,self) + + + + def check_FSCR(self,checker): # objet .FSCR + #=============================================== + fscr=self.FSCR.get() + fsvi=self.FSVI.get() + type_faisceau, couplage= self.u_veri1() + + if type_faisceau in (1,2,4) : + #----------------------------------------- + assert not fscr,(fsgm,self) + + elif type_faisceau ==3 : + #----------------------------------------- + lsimplif=fsvi[0] + if lsimplif : + nbtube=fsvi[5] + assert len(fscr)==2*nbtube,(fscr,self) + else : + assert not fscr,(fsvi,self) + + + + def check_UNIT_FAISCEAU(self,checker): # objet .UNIT.FAISCEAU + #=============================================================== + unite=self.UNIT_FAISCEAU.get() + fsvi=self.FSVI.get() + type_faisceau, couplage= self.u_veri1() + + if type_faisceau in (2,3,4) : + #----------------------------------------- + assert not unite,(fsvi,self) + + elif type_faisceau == 1 : + #----------------------------------------- + assert len(unite)==2,(unite,self) + assert unite[0] > 0 ,(unite,self) + assert unite[1] > 0 ,(unite,self) + + + + def check_UNIT_GRAPPES(self,checker): # objet .UNIT.GRAPPES + #=============================================================== + unite=self.UNIT_GRAPPES.get() + fsvi=self.FSVI.get() + type_faisceau, couplage= self.u_veri1() + + if type_faisceau in (1,3,4) : + #----------------------------------------- + assert not unite,(fsvi,self) + + elif type_faisceau == 2 : + #----------------------------------------- + if couplage : + assert len(unite)==2,(unite,self) + assert unite[0] > 0 ,(unite,self) + assert unite[1] > 0 ,(unite,self) + else : + assert not unite, (fsic,self) diff --git a/Aster/Cata/cataSTA9/SD/sd_util.py b/Aster/Cata/cataSTA9/SD/sd_util.py index a1e9ad06..15bf4ffa 100644 --- a/Aster/Cata/cataSTA9/SD/sd_util.py +++ b/Aster/Cata/cataSTA9/SD/sd_util.py @@ -1,21 +1,21 @@ -#@ MODIF sd_util SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_util SD DATE 23/05/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== # COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== """ @@ -28,10 +28,28 @@ try: except: pass +from sets import Set +import copy -def compare(ojb, checker, val1, comp, val2, comment=''): + +# 1) Utilitaires pour vérifier certaines propriétés. +# Ces utilitaires ne provoquent pas d'arret mais écrivent des messages dans un "checker" +# ----------------------------------------------------------------------------------------- + + +# 1.1 Utilitaires pour des scalaires : +# ------------------------------------ + +def sdu_assert(ojb, checker, bool,comment=''): + # Vérifie que le booléen (bool) est vrai + if not bool : + checker.err(ojb, "condition non respectée : (%s)" % (comment,)) + +def sdu_compare(ojb, checker, val1, comp, val2, comment=''): # Vérifie que la relation de comparaison entre val1 et val2 est respectée : # comp= '==' / '!=' / '>=' / '>' / '<=' / '<' + comp=comp.strip() + ok = 0 if comp == "==" : ok = val1 == val2 elif comp == "!=" : @@ -45,20 +63,105 @@ def compare(ojb, checker, val1, comp, val2, comment=''): elif comp == "<" : ok = val1 < val2 else : - assert 0, comp + sdu_assert(ojb, checker, 0, 'sdu_compare: opérateur de comparaison interdit: '+comp) if not ok : checker.err(ojb, "condition non respectée : %s %s %s (%s)" % (val1,comp,val2,comment)) -def affirme(ojb, checker, bool,comment=''): - # Vérifie que le booléen (bool) est vrai - # émet un mesage d'erreur sinon - if not bool : - checker.err(ojb, "condition non respectée : (%s)" % (comment,)) +# 1.2 Utilitaires pour des séquences : +# ------------------------------------ + +def sdu_tous_differents(ojb,checker,sequence=None,comment=''): + # Vérifie que les éléments de la séquence sont tous différents. + # Si l'argument sequence est None, on prend l'ensemble de l'ojb. + + if sequence : + seq=sequence + else : + seq=ojb.get() + + sdu_compare(ojb, checker, len(seq), '==', len(Set(seq)), comment='Tous différents: '+comment) + + +def sdu_tous_non_blancs(ojb,checker,sequence=None,comment=''): + # Vérifie que les éléments (chaines) de la séquence sont tous "non blancs". + # Si l'argument sequence est None, on prend l'ensemble de l'ojb. + + if sequence : + seq=sequence + else : + seq=ojb.get() + + for elem in seq : + assert len(elem.strip()) > 0 , (seq,self, 'tous "non blancs" '+comment) + + +def sdu_tous_compris(ojb,checker,sequence=None,vmin=None,vmax=None,comment=''): + # Vérifie que toutes les valeurs de la sequence sont comprises entre vmin et vmax + # Les bornes vmin et vmax sont autorisées + # Si l'argument sequence est None, on prend l'ensemble de l'ojb. + + assert (not vmin is None) or (not vmax is None),'Il faut fournir au moins une des valeurs vmin ou vmax' + if sequence : + seq=sequence + else: + seq=ojb.get() + + ier = 0 + for v in seq : + if vmin and v < vmin : ier = 1 + if vmax and v > vmax : ier = 1 + if ier == 1 : checker.err( ojb, "L'objet doit contenir des valeurs dans l'intervalle : [%s, %s] " % (vmin,vmax)) + + + +def sdu_monotone(seqini) : + #------------------------------- + # vérifie qu'une séquence est triée par ordre croissant (ou décroissant) + # retourne : + # 3 : ni croissant ni décroissant (désordre) + # 1 : croissant + # -1 : décroissant + # 0 : constant + + n=len(seqini) + if isinstance(seqini,tuple) : + seq=list(seqini) + else : + seq=seqini + + seq2=copy.deepcopy(seq) + seq2.sort() + seq3=copy.deepcopy(seq) + seq3.sort() + seq3.reverse() + + croiss=1 + decroiss=1 + for k in range(n) : + if seq[k] != seq2[k] : + if 0 : print "AJACOT non croissant ",k,seq[k],seq2[k] + croiss=0 + if seq[k] != seq3[k] : + if 0 : print "AJACOT non décroissant ",k,seq[k],seq2[k] + decroiss=0 + + if croiss==1 and decroiss==1 : + return 0 + elif croiss==1 and decroiss==0 : + return 1 + elif croiss==0 and decroiss==1 : + return -1 + elif croiss==0 and decroiss==0 : + return 3 + + +# 2) Utilitaires de questionnement : +# ----------------------------------------------------------------------------------------- -def nom_gd(numgd) : +def sdu_nom_gd(numgd) : # retourne le nom de la grandeur de numéro (numgd) ptn=aster.getvectjev('&CATA.GD.NOMGD') return ptn[numgd-1].strip() diff --git a/Aster/Cata/cataSTA9/SD/utilsd.py b/Aster/Cata/cataSTA9/SD/utilsd.py new file mode 100644 index 00000000..b3d6e98b --- /dev/null +++ b/Aster/Cata/cataSTA9/SD/utilsd.py @@ -0,0 +1,90 @@ +#@ MODIF utilsd SD DATE 02/04/2007 AUTEUR COURTOIS M.COURTOIS +# -*- coding: iso-8859-1 -*- +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# ====================================================================== +# RESPONSABLE COURTOIS M.COURTOIS + +""" + Utilitaire sur le catalogue des structures de données. +""" + +__revision__ = "$Id: $" + +import sys +import os +from glob import glob +from optparse import OptionParser + +# ----- get bibpyt location +main = sys.argv[0] +if os.path.islink(main): + main = os.path.realpath(main) +bibpyt = os.path.normpath(os.path.join( + os.path.dirname(os.path.abspath(main)), os.pardir)) +sys.path.append(bibpyt) + +# ----------------------------------------------------------------------------- +def import_sd(nomsd): + """Import une SD. + """ + try: + mod = __import__('SD.%s' % nomsd, globals(), locals(), [nomsd]) + klass = getattr(mod, nomsd) + except (ImportError, AttributeError), msg: + raise ImportError, "impossible d'importer la SD '%s'" % nomsd + return klass + +# ----------------------------------------------------------------------------- +def tree(nom, *args): + """Retourne l'arbre des sd en arguments + """ + l = [] + for i, sd in enumerate(args): + if len(args) > 1 and i > 0: + l.append('-'*80) + sd_class = import_sd(sd) + tmpobj = sd_class(nomj=nom) + l.append(tmpobj.info()) + return os.linesep.join(l) + +# ----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- +if __name__ == '__main__': + # command arguments parser + parser = OptionParser(usage=__doc__) + parser.add_option('-t', '--tree', dest='tree', + action='store_true', default=False, + help="affiche une SD sous forme d'arbre") + parser.add_option('--nom', dest='nom', + action='store', default='^'*8, + help="nom du concept dans les représentations") + parser.add_option('-a', '--all', dest='all', + action='store_true', default=False, + help="construit la liste des SD à partir des fichiers 'sd_*.py' trouvés") + + opts, l_sd = parser.parse_args() + if opts.all: + l_fich = glob(os.path.join(bibpyt, 'SD', 'sd_*.py')) + l_sd = [os.path.splitext(os.path.basename(f))[0] for f in l_fich] + + if len(l_sd) == 0: + parser.error('quelle(s) structure(s) de données ?') + + if opts.tree: + print tree(opts.nom, *l_sd) + diff --git a/Doc/Makefile b/Doc/Makefile index 56386cea..58a7fed8 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -5,7 +5,6 @@ api: epydoc -n EFICAS --show-imports -o api_eficas -u http://eficas.der.edf.fr \ $(EFICAS)/Noyau/ \ $(EFICAS)/Validation/ \ - $(EFICAS)/Sdbase/ \ $(EFICAS)/Ihm/ \ $(EFICAS)/Extensions/ \ $(EFICAS)/Accas/ \ diff --git a/Exemples/eficas/cata.py b/Exemples/eficas/cata.py index 54503c06..0d34e482 100644 --- a/Exemples/eficas/cata.py +++ b/Exemples/eficas/cata.py @@ -8,9 +8,9 @@ from Accas import AU_MOINS_UN,UN_PARMI,PRESENT_PRESENT,EXCLUS,ENSEMBLE,PRESENT_A from Accas import EVAL #compatibilite avec V9 -import Sdbase -class ASSD(ASSD,Sdbase.AsBase):pass -class GEOM(GEOM,Sdbase.AsBase):pass +import Noyau +class ASSD(ASSD,Noyau.AsBase):pass +class GEOM(GEOM,Noyau.AsBase):pass #fin compatibilite # Type le plus general diff --git a/Extensions/param2.py b/Extensions/param2.py index ad49373b..89f6464b 100644 --- a/Extensions/param2.py +++ b/Extensions/param2.py @@ -30,6 +30,7 @@ class Formula: def __float__(self): return float(self.eval()) def __pos__(self): return self # positive def __neg__(self): return Unop('-', self) + def __abs__(self): return Unop('abs', self) def __add__(self, other): return Binop('+', self, other) def __radd__(self, other): return Binop('+', other, self) def __sub__(self, other): return Binop('-', self, other) @@ -76,6 +77,7 @@ class Binop(Formula): class Unop(Formula): opmap = { '-': lambda x: -x, + 'abs': lambda x: abs(x), } def __init__(self, op, arg): self._op = op diff --git a/Sdbase/__init__.py b/Sdbase/__init__.py deleted file mode 100644 index 9c2d49df..00000000 --- a/Sdbase/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ - -import asojb -from asojb import AsBase diff --git a/Sdbase/ascheckers.py b/Sdbase/ascheckers.py deleted file mode 100644 index fc6a9b4d..00000000 --- a/Sdbase/ascheckers.py +++ /dev/null @@ -1,70 +0,0 @@ -#@ MODIF ascheckers SD DATE 13/02/2007 AUTEUR PELLET J.PELLET -# -*- coding: iso-8859-1 -*- -# CONFIGURATION MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. -# ====================================================================== - -class Parmi(object): - """Classe qui exprime une contrainte multiple pour un attribut""" - def __init__(self, *args): - self.values = list(args) - - def add_value(self, value ): - if value not in self.values: - self.values.append( value ) - - def __call__(self, obj, name, value, log ): - if value not in self.values: - log.err( obj, "l'attribut %s=%r n'est pas dans %r" % (name, value, self.values) ) - - def __repr__(self): - l = [ "Parmi(", ] - g = [ repr(v) for v in self.values ] - l.append( ", ".join(g) ) - l.append( ")" ) - return "".join( l ) - -class CheckLog(object): - """Un validateur qui enregistre toutes - les erreurs trouvées""" - def __init__(self): - self.msg = [] - self.names = {} - self.optional = False - - def log(self, level, obj, msg ): - self.msg.append( (level, obj.nomj(), msg) ) - - def err(self, obj, msg ): - self.log( 0, obj, msg ) - - def warn(self, obj, msg ): - self.log( 1, obj, msg ) - - def visit(self, obj ): - self.names[obj.nomj()] = 1 - - def __str__(self): - d = { 0: "E", 1:"W" } - return "\n".join( [ "%s:%s: %s" % (d[l],n,m) - for l,n,m in self.msg ]) - -class CheckFail(CheckLog): - """Un validateur qui lève une exception - dès la première erreur""" - def err(self, obj, msg ): - raise AssertionError("%s: %s" % (obj.nomj(), msg) ) diff --git a/Sdbase/asnom.py b/Sdbase/asnom.py deleted file mode 100644 index 89a541b8..00000000 --- a/Sdbase/asnom.py +++ /dev/null @@ -1,133 +0,0 @@ -#@ MODIF asnom SD DATE 13/02/2007 AUTEUR PELLET J.PELLET -# -*- coding: iso-8859-1 -*- -# CONFIGURATION MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. -# ====================================================================== - -""" -Description des types de base aster - -version 2 - réécrite pour essayer de simplifier -le problème des instances/types et instances/instances - -le type de base ASBase permet de représenter une structure -de donnée. Une instance de ASBase comme attribut d'une classe -dérivée de ASBase représente une sous-structure nommée. - -une instance de ASBase 'libre' représente une instance de la -structure de donnée complète. - -c'est ce comportement qui est capturé dans la classe StructType -""" - -from basetype import Type - -class SDNom(Type): - """Objet représentant une sous-partie de nom - d'objet jeveux""" - nomj = None - debut = None - fin = None - just = None - justtype = None - - def __init__(self, nomj=None, debut=None, fin=None, just='l', **kwargs ): - """ - Configure un objet nom - nomj : la partie du nom fixée (par ex .TITR) ou '' si non précisée - debut, fin : la partie du K24 concernée - just : la justification a droite ou a gauche ('l' ou 'r') - kwargs : inutilisé, juste par simplicité - - Note: - On utilise cet objet comme attribut d'instance ou de classe. - En attribut de classe pour les noms de structure, cela permet - de définir la position du nom d'objet dans le nom jeveux, l'attribut - nom est alors la valeur du suffixe pour une sous-structure ou None pour - une structure principale. - """ - super( SDNom, self ).__init__( nomj=nomj, debut=debut, fin=fin, just=just, **kwargs ) - self.update( (nomj, debut, fin, just) ) - - def __call__(self): - if self._parent is None or self._parent._parent is None: - debut = self.debut or 0 - prefix = ' '*debut - else: - # normalement - # assert self._parent.nomj is self - nomparent = self._parent._parent.nomj - prefix = nomparent() - debut = self.debut or nomparent.fin or len(prefix) - fin = self.fin or 24 - nomj = self.nomj or '' - nomj = self.just( nomj, fin-debut ) - prefix = prefix.ljust(24) - res = prefix[:debut]+nomj+prefix[fin:] - return res[:24] - - def fcata(self): - return self.just(self.nomj,self.fin-self.debut).replace(' ','?') - - def __repr__(self): - return "" % (self.nomj,self.debut,self.fin) - - # On utilise pickle pour les copies, et pickle ne sait pas gérer la - # sauvegarde de str.ljust ou str.rjust (c'est une méthode non liée) - - def __getstate__(self): - return (self.nomj, self.debut, self.fin, self.justtype ) - - def __setstate__( self, (nomj,debut,fin,just) ): - self.nomj = nomj - self.debut = debut - self.fin = fin - if just=='l' or just is None: - self.just = str.ljust - elif just=='r': - self.just = str.rjust - else: - raise ValueError("Justification '%s' invalide" % just ) - self.justtype = just - - - def update( self, (nomj,debut,fin,just) ): - if nomj is not None: - self.nomj = nomj - if self.debut is None: - self.debut = debut - if self.fin is None: - self.fin = fin - if self.justtype is None and just is not None: - if just=='l': - self.just = str.ljust - elif just=='r': - self.just = str.rjust - else: - raise ValueError("Justification '%s' invalide" % just ) - self.justtype = just - - def reparent( self, parent, new_name ): - self._parent = parent - self._name = new_name - for nam in self._subtypes: - obj = getattr( self, nam ) - obj.reparent( self, nam ) - if self.nomj is None and self._parent._name is not None: - self.nomj = "." + self._parent._name - - diff --git a/Sdbase/asojb.py b/Sdbase/asojb.py deleted file mode 100644 index 9e3c9e70..00000000 --- a/Sdbase/asojb.py +++ /dev/null @@ -1,304 +0,0 @@ -#@ MODIF asojb SD DATE 13/02/2007 AUTEUR PELLET J.PELLET -# -*- coding: iso-8859-1 -*- -# CONFIGURATION MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. -# ====================================================================== - -""" - Description des OJB jeveux -""" -from basetype import Type, MetaType -from asnom import SDNom -from ascheckers import CheckLog - -# pour utilisation dans eficas -try: - import aster -except: - pass - -# ----------------------------------------------------------------------------- -class AsBase(Type): - nomj = SDNom() - optional = False - - def __init__(self, nomj=None, *args, **kwargs ): - super(AsBase,self).__init__( nomj, *args, **kwargs ) - assert self.nomj is not self.__class__.nomj - if isinstance( nomj, str ): - self.nomj.nomj = nomj - elif isinstance( nomj, SDNom ): - self.nomj.update( nomj.__getstate__() ) - - def set_name(self, nomj): - """Positionne le nomj de self - """ - assert isinstance( self.nomj.nomj, str ), "uniquement pour les concepts" - self.nomj.nomj = nomj - - def check(self, checker=None): - if checker is None: - checker = CheckLog() - - # vérifie les enfants : - optional = checker.optional - checker.optional = checker.optional or self.optional - for name in self._subtypes: - v = getattr(self, name) - if isinstance( v, (OJB,AsBase) ): - v.check(checker) - for name in dir(self): - if name.startswith( 'check_' ): - v = getattr(self, name) - if callable(v): - v( checker ) - - checker.optional = optional - return checker - - def members( self ): - pass - - def dump(self, indent=""): - import pydoc - l = [] - checkers = [] - nomj = self.nomj() - if self.optional: - f = "(f)" - else: - f = "(o)" - l.append( f+" "+nomj ) - #l.append( '-'*(len(nomj)+3) ) - for name in self._subtypes: - obj = getattr(self, name) - if isinstance(obj,(AsBase,OJB)): - l.append( obj.dump(indent) ) - for name in dir(self): - if name.startswith( 'check_' ): - obj = getattr(self, name) - if callable(obj) and name.startswith("check_"): - checkers.append( obj ) - - indent = " "*len(nomj) - for checker in checkers: - doc = pydoc.text.document( checker ) - for line in doc.splitlines(): - l.append( indent + line ) - return "\n".join( l ) - - def __repr__(self): - return "<%s(%x,%r)>" % (self.__class__.__name__, id(self), self.nomj() ) - - -# ----------------------------------------------------------------------------- -class JeveuxAttr(object): - """Un attribut jeveux""" - def __init__(self, name): - self.name = name - - def __get__(self, obj, klass): - raise NotImplementedError - - def check(self, attrname, obj, log ): - checker = getattr(obj, "_"+attrname, None ) - if checker is None: - return True - val = self.__get__( obj, obj.__class__ ) - if callable( checker ): - return checker( obj, attrname, val, log ) - else: - test = val == checker - if not test: - log.err( obj, "Attribut incorrect %s %r!=%r" % (self.name, val, checker ) ) - return test - -# ----------------------------------------------------------------------------- -class JeveuxExists(JeveuxAttr): - def __init__(self): - pass - - def __get__(self, obj, klass): - if obj is None: - return self - nomj = obj.nomj() - if len(nomj)!=24: - raise AssertionError(repr(nomj)) - return aster.jeveux_exists( nomj.ljust(24) ) - -# ----------------------------------------------------------------------------- -class JeveuxIntAttr(JeveuxAttr): - def __get__(self, obj, klass): - if obj is None: - return self - return aster.jeveux_getattr( obj.nomj(), self.name )[0] - -# ----------------------------------------------------------------------------- -class JeveuxStrAttr(JeveuxAttr): - def __get__(self, obj, klass): - if obj is None: - return self - return aster.jeveux_getattr( obj.nomj(), self.name )[1].strip() - -# ----------------------------------------------------------------------------- -class OJB(AsBase): - _clas = None - _genr = None - _type = None - _ltyp = None - _xous = None - _docu = None - _exists = True - - clas = JeveuxStrAttr("CLAS") - genr = JeveuxStrAttr("GENR") - type = JeveuxStrAttr("TYPE") - ltyp = JeveuxIntAttr("LTYP") - xous = JeveuxStrAttr("XOUS") - docu = JeveuxStrAttr("DOCU") - exists = JeveuxExists() - #optional = False - nomj = SDNom() - - def __init__(self, nomj=None, **attrs): - super(OJB,self).__init__( nomj, **attrs ) - self.foreachattr( self.setattribute, attrs ) - self.optional = attrs.get('optional', False) - - def setattribute( self, name, prop, attrs ): - _name = "_"+name - if name in attrs: - setattr( self, _name, attrs[name] ) - - def get(self): - nomj = self.nomj() - if aster.jeveux_exists( nomj ): - obj_simple = aster.jeveux_getattr( nomj, 'XOUS')[1].strip() == 'S' - if obj_simple : - return aster.getvectjev( nomj ) - else : - return aster.getcolljev( nomj ) - else: - return None - - def get_stripped(self): - """Fonction utilitaire, renvoie une liste de chaines 'strippées'""" - data = self.get() - if data is not None: - return [ x.strip() for x in self.get() ] - else: - return [] - - def foreachattr(self, callable, *args, **kwargs): - klass = self.__class__ - for k in dir(klass): - v = getattr( klass, k ) - if isinstance(v, JeveuxAttr): - callable( k, v, *args, **kwargs ) - - def check(self, checker=None): - if checker is None: - checker = CheckLog() - # l'objet a déjà été vérifié, on ne fait rien - if self.nomj() in checker.names.keys(): - return checker - checker.visit( self ) - if self.exists: - self.foreachattr( lambda k,v,obj,c: v.check(k, obj, c), - self, checker ) - else: - if not self.optional and not checker.optional : - checker.err( self, "n'existe pas (%r)" %self._parent ) - return checker - - def tous_compris(self, checker, vmin=None, vmax=None): - # Vérifie que toutes les valeurs du vecteur sont comprises entre vmin et vmax - # Les bornes vmin et vmax sont autorisées - assert vmin or vmax, 'Il faut fournir au moins une des valeurs vmin ou vmax' - vect = self.get() - if not vect : return - ier = 0 - for v in vect : - if vmin and v < vmin : ier = 1 - if vmax and v > vmax : ier = 1 - if ier == 1 : checker.err( self, "L'objet doit contenir des valeurs dans l'intervalle : %s %s " % (vmin,vmax)) - - def dump(self, indent=""): - if self.optional: - f = "(f)" - else: - f = "(o)" - return f +" "+ self.nomj() +" "+ str(self.exists) - -# ----------------------------------------------------------------------------- -def Facultatif( ojb ): - ojb.optional = True - return ojb - -# ----------------------------------------------------------------------------- -class OJBVect(OJB): - lonmax = JeveuxIntAttr("LONMAX") - lonuti = JeveuxIntAttr("LONUTI") - -# ----------------------------------------------------------------------------- -class OJBCollec(OJB): - stockage = JeveuxStrAttr("STOCKAGE") - nutioc = JeveuxIntAttr( "NUTIOC" ) - acces = JeveuxStrAttr( "ACCES" ) - modelong = JeveuxStrAttr( "MODELONG" ) - nmaxoc = JeveuxIntAttr( "NMAXOC" ) - -# ----------------------------------------------------------------------------- -class AsVI(OJBVect): - _type = "I" - -# ----------------------------------------------------------------------------- -class AsVR(OJBVect): - _type = "R" - -# ----------------------------------------------------------------------------- -class AsVC(OJBVect): - _type = "C" - -# ----------------------------------------------------------------------------- -class AsVK8(OJBVect): - _type = "K" - _ltyp = 8 - -# ----------------------------------------------------------------------------- -class AsVK16(OJBVect): - _type = "K" - _ltyp = 16 - -# ----------------------------------------------------------------------------- -class AsVK24(OJBVect): - _type = "K" - _ltyp = 24 - -# ----------------------------------------------------------------------------- -class AsVK32(OJBVect): - _type = "K" - _ltyp = 32 - -# ----------------------------------------------------------------------------- -class AsVK80(OJBVect): - _type = "K" - _ltyp = 80 - -# Pour compatibilite -AsColl = OJBCollec -AsObject = OJB diff --git a/Sdbase/basetype.py b/Sdbase/basetype.py deleted file mode 100644 index 050ec233..00000000 --- a/Sdbase/basetype.py +++ /dev/null @@ -1,156 +0,0 @@ -#@ MODIF basetype SD DATE 13/02/2007 AUTEUR PELLET J.PELLET -# -*- coding: iso-8859-1 -*- -# CONFIGURATION MANAGEMENT OF EDF VERSION -# ====================================================================== -# COPYRIGHT (C) 1991 - 2007 EDF R&D WWW.CODE-ASTER.ORG -# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY -# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY -# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR -# (AT YOUR OPTION) ANY LATER VERSION. -# -# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT -# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF -# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU -# GENERAL PUBLIC LICENSE FOR MORE DETAILS. -# -# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE -# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, -# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. -# ====================================================================== - -""" -Description des types de base aster ------------------------------------ - -version 2 - réécrite pour essayer de simplifier -le problème des instances/types et instances/instances. - -Le type de base `Type` permet de représenter une structure -de donnée. Une instance de `Type` comme attribut d'une classe -dérivée de `Type` représente une sous-structure nommée. - -Une instance de `Type` 'libre' représente une instance de la -structure de donnée complète. - -C'est ce comportement qui est capturé dans la classe BaseType - -La classe `Type` hérite de BaseType et y associe la métaclasse MetaType. - -""" -from copy import copy,deepcopy -import cPickle - -__docformat__ = "restructuredtext" - - - - -class MetaType(type): - """Métaclasse d'un type représentant une structure de données. - Les méthodes spéciales __new__ et __call__ sont réimplémentées - """ - def __new__( mcs, name, bases, classdict ): - """Création d'une nouvelle 'classe' dérivant de Type. - - Cette méthode permet de calculer certains attributs automatiquement: - - - L'attribut _subtypes qui contient la liste des sous-structures - de type 'Type' attributs (directs ou hérités) de cette classe. - - Pour chaque attribut de classe héritant de Type, on recrée une nouvelle - instance des attributs hérités pour pouvoir maintenir une structure de - parentée entre l'attribut de classe et sa nouvelle classe. - - L'effet obtenu est que tous les attributs de classe ou des classes parentes - de cette classe sont des attributs associés à la classe feuille. Ces attributs - ont eux-meme un attribut parent qui pointe sur la classe qui les contient. - """ - new_cls = type.__new__( mcs, name, bases, classdict ) - new_cls._subtypes = [] - for b in bases: - if hasattr(b,'_subtypes'): - new_cls._subtypes += b._subtypes - # affecte la classe comme parent des attributs de classe - # et donne l'occasion aux attributs de se renommer à partir - # du nom utilisé. - for k, v in classdict.items(): - if not isinstance( v, BaseType ): - continue - v.reparent( new_cls, k ) - new_cls._subtypes.append( k ) - return new_cls - - def dup_attr(cls, inst): - """Duplique les attributs de la classe `cls` pour qu'ils deviennent - des attributs de l'instance `inst`. - """ - # reinstantiate and reparent subtypes - for nam in cls._subtypes: - obj = getattr( cls, nam ) - # permet de dupliquer completement l'instance - cpy = cPickle.dumps(obj) - newobj = cPickle.loads( cpy ) - newobj.reparent( inst, None ) - setattr( inst, nam, newobj ) - - def __call__(cls, *args, **kwargs): - """Instanciation d'un Type structuré. - Lors de l'instanciation on effectue un travail similaire à la - création de classe: Les attributs sont re-parentés à l'instance - et réinstanciés pour obtenir une instanciation de toute la structure - et de ses sous-structures. - - Les attributs de classe deviennent des attributs d'instance. - """ - inst = cls.__new__(cls, *args, **kwargs) - # reinstantiate and reparent subtypes - cls.dup_attr( inst ) - type(inst).__init__(inst, *args, **kwargs) - return inst - - def mymethod(cls): - pass - - -class BaseType(object): - # Le parent de la structure pour les sous-structures - _parent = None - _name = None - - def __init__(self, *args, **kwargs): - self._initargs = args - self._initkwargs = kwargs - self._name = None - self._parent = None - - def reparent( self, parent, new_name ): - self._parent = parent - self._name = new_name - for nam in self._subtypes: - obj = getattr( self, nam ) - obj.reparent( self, nam ) - - def base( self ): - if self._parent is None: - return self - return self._parent.base() - - def change_type(self, new_type, nomj=None): - """Méthode appelée quand on change a posteriori le type - du concept (pour les 'CO'). - Si `nomj` est None, on prend `self.nom`. - """ - self.__class__ = new_type - nomj = nomj or self.nom - new_type.dup_attr(self) - - # Comment appeler AsBase.__init__ ? - # type(nomj)=str donc plus simple que dans AsBase.__init__... - assert isinstance(nomj, str), 'Valeur inattendue pour nomj : %s' % nomj - assert self.nomj is not self.__class__.nomj - self.nomj.nomj = nomj - - -class Type(BaseType): - __metaclass__ = MetaType - diff --git a/Tests/testelem/az.comm b/Tests/testelem/az.comm index b7f540d5..3d5fa743 100644 --- a/Tests/testelem/az.comm +++ b/Tests/testelem/az.comm @@ -1,5 +1,4 @@ - DEBUT(); P1 = 9.8; @@ -13,6 +12,7 @@ P6 = (P1 - 3); P4 = [2, 3, 4]; + #Pas trouve shellpanel MAILLA2=LIRE_MAILLAGE(UNITE=P4[1],); @@ -21,6 +21,7 @@ aaa = FORMULE(VALE='a+z', NOM_PARA=('a','z',),); MAIL=LIRE_MAILLAGE(UNITE=P3,); + # 'LIRE_MAILLAGE', 'UNITE' --> uniquebasepanel az = FORMULE(VALE='aaaaa', @@ -53,6 +54,7 @@ CARA=AFFE_CARA_ELEM(MODELE=MOD, SECTION='CERCLE', CARA='R', VALE=(3.0,P6,),),); + # 'AFFE_MODELE', 'MAILLAGE' --> uniqueassdpanel # AFFE_MODELE', 'AFFE', 'GROUP_MA' --> plusieursbasepanel # 'AFFE_MODELE', 'AFFE', 'PHENOMENE' --> uniqueintopanel @@ -65,6 +67,7 @@ F1=DEFI_FONCTION(NOM_PARA='DX',VALE=(5.0,3.0, F3=DEFI_FONCTION(NOM_PARA='DRX',VALE_C=(5.0,7.0,9.0, 9.0,8.0,7.0, ),); + # 'DEFI_FONCTION', 'VALE' --> fonctionpanel MATER2=DEFI_MATERIAU(ELAS=_F(E=100000000000.0, @@ -92,17 +95,20 @@ TH1=THER_LINEAIRE(MODELE=AFFE1, CHAM_MATER=CHMAT2, EXCIT=_F(CHARGE=AAAZ,), SENSIBILITE=(PS1,PS2,),); + # 'THER_LINEAIRE', 'SENSIBILITE' --> plusieursassdpanel ACA1=AFFE_CHAR_ACOU(MODELE=AFFE1, PRES_IMPO=_F(TOUT='OUI', PRES=('RI',3.0,3.0,),),); + # 'AFFE_CHAR_ACOU', 'PRES_IMPO', 'PRES' --> uniquecomppanel MACRO_MATR_ASSE(MODELE=AFFE1, NUME_DDL=CO('DDL1'), MATR_ASSE=_F(MATRICE=CO('MAT1'), OPTION='RIGI_THER',),); + # 'MACRO_MATR_ASSE', 'MATR_ASSE', 'MATRICE' --> uniquesdcopanel FIN(); diff --git a/Tests/testelem/azv6.comm b/Tests/testelem/azv6.comm index 8e076310..422743da 100644 --- a/Tests/testelem/azv6.comm +++ b/Tests/testelem/azv6.comm @@ -1,5 +1,4 @@ - DEBUT(); P1 = 9.8; @@ -13,6 +12,7 @@ P6 = (P1 - 3); P4 = [2, 3, 4]; + #Pas trouve shellpanel MAILLA2=LIRE_MAILLAGE(UNITE=P4[1],); @@ -20,6 +20,7 @@ MAILLA2=LIRE_MAILLAGE(UNITE=P4[1],); aaa = FORMULE(REEL='(a+z) = (a,z)',); MAIL=LIRE_MAILLAGE(UNITE=P3,); + # 'LIRE_MAILLAGE', 'UNITE' --> uniquebasepanel az = FORMULE(REEL='(aaaaa) = (ae,inst)',); @@ -51,6 +52,7 @@ CARA=AFFE_CARA_ELEM(MODELE=MOD, SECTION='CERCLE', CARA='R', VALE=(3.0,P6,),),); + # 'AFFE_MODELE', 'MAILLAGE' --> uniqueassdpanel # AFFE_MODELE', 'AFFE', 'GROUP_MA' --> plusieursbasepanel # 'AFFE_MODELE', 'AFFE', 'PHENOMENE' --> uniqueintopanel @@ -63,6 +65,7 @@ F1=DEFI_FONCTION(NOM_PARA='DX',VALE=(5.0,3.0, F3=DEFI_FONCTION(NOM_PARA='DRX',VALE_C=(5.0,7.0,9.0, 9.0,8.0,7.0, ),); + # 'DEFI_FONCTION', 'VALE' --> fonctionpanel MATER2=DEFI_MATERIAU(ELAS=_F(E=100000000000.0, @@ -90,17 +93,20 @@ TH1=THER_LINEAIRE(MODELE=AFFE1, CHAM_MATER=CHMAT2, EXCIT=_F(CHARGE=AAAZ,), SENSIBILITE=(PS1,PS2,),); + # 'THER_LINEAIRE', 'SENSIBILITE' --> plusieursassdpanel ACA1=AFFE_CHAR_ACOU(MODELE=AFFE1, PRES_IMPO=_F(TOUT='OUI', PRES=('RI',3.0,3.0,),),); + # 'AFFE_CHAR_ACOU', 'PRES_IMPO', 'PRES' --> uniquecomppanel MACRO_MATR_ASSE(MODELE=AFFE1, NUME_DDL=CO('DDL1'), MATR_ASSE=_F(MATRICE=CO('MAT1'), OPTION='RIGI_THER',),); + # 'MACRO_MATR_ASSE', 'MATR_ASSE', 'MATRICE' --> uniquesdcopanel FIN(); diff --git a/Tests/testelem/cata1.py b/Tests/testelem/cata1.py index 1ec39bae..0c9334c6 100644 --- a/Tests/testelem/cata1.py +++ b/Tests/testelem/cata1.py @@ -1,5 +1,5 @@ from Accas import SIMP,FACT,OPER,ASSD,AsException,AsType -import Sdbase +import Noyau class CATA: def __init__(self): @@ -10,15 +10,15 @@ class CATA: cata=CATA() -class concept(ASSD,Sdbase.AsBase):pass +class concept(ASSD,Noyau.AsBase):pass OP1 = OPER(nom='OP1',op=1,sd_prod=concept, a=SIMP(typ='I'), c=SIMP(typ='I',position='global'), ) -class concept2(ASSD,Sdbase.AsBase):pass -class concept3(ASSD,Sdbase.AsBase):pass +class concept2(ASSD,Noyau.AsBase):pass +class concept3(ASSD,Noyau.AsBase):pass def op2_prod(TYPE_RESU,**args): if TYPE_RESU == "TRANS" : return concept2 diff --git a/Tests/testelem/cata2.py b/Tests/testelem/cata2.py index 34dc6831..b8460ff2 100644 --- a/Tests/testelem/cata2.py +++ b/Tests/testelem/cata2.py @@ -1,5 +1,5 @@ from Accas import SIMP,FACT,OPER,ASSD,AsException,AsType,CO,MACRO -import Sdbase +import Noyau class CATA: @@ -11,15 +11,15 @@ class CATA: cata=CATA() -class concept(ASSD,Sdbase.AsBase):pass +class concept(ASSD,Noyau.AsBase):pass OP1 = OPER(nom='OP1',op=1,sd_prod=concept, a=SIMP(typ='I'), c=SIMP(typ='I',position='global'), ) -class concept2(ASSD,Sdbase.AsBase):pass -class concept3(ASSD,Sdbase.AsBase):pass +class concept2(ASSD,Noyau.AsBase):pass +class concept3(ASSD,Noyau.AsBase):pass def op2_prod(self,MATR,**args): self.type_sdprod(MATR,concept2) diff --git a/Tests/testelem/cata5.py b/Tests/testelem/cata5.py index 33fa23b8..cb015867 100644 --- a/Tests/testelem/cata5.py +++ b/Tests/testelem/cata5.py @@ -1,11 +1,11 @@ # -*- coding: iso-8859-15 -*- from Accas import SIMP,FACT,OPER,ASSD,AsException,AsType,CO,MACRO,JDC_CATA -import Sdbase +import Noyau JdC=JDC_CATA(code="ASTER") -class concept(ASSD,Sdbase.AsBase):pass -class concept2(ASSD,Sdbase.AsBase):pass -class concept3(ASSD,Sdbase.AsBase):pass +class concept(ASSD,Noyau.AsBase):pass +class concept2(ASSD,Noyau.AsBase):pass +class concept3(ASSD,Noyau.AsBase):pass class concept4(concept2):pass def OP_ops(self,MATR,**args): diff --git a/Tests/testelem/params.comm b/Tests/testelem/params.comm index b24787fd..46966b0c 100644 --- a/Tests/testelem/params.comm +++ b/Tests/testelem/params.comm @@ -1,5 +1,4 @@ - DEBUT(); a = 1.0; diff --git a/Tests/testelem/testbloc1.py b/Tests/testelem/testbloc1.py index c3b0b748..f8bb6902 100644 --- a/Tests/testelem/testbloc1.py +++ b/Tests/testelem/testbloc1.py @@ -1,8 +1,8 @@ # coding=utf-8 from Accas import SIMP,FACT,BLOC,UN_PARMI,OPER,ASSD,MACRO,_F -import Sdbase +import Noyau -class concept(ASSD,Sdbase.AsBase):pass +class concept(ASSD,Noyau.AsBase):pass import unittest diff --git a/Tests/testelem/testjdc1.py b/Tests/testelem/testjdc1.py index ea403fb0..369a614f 100644 --- a/Tests/testelem/testjdc1.py +++ b/Tests/testelem/testjdc1.py @@ -64,7 +64,6 @@ FIN CR validation :toto.comm cr=app.get_text_JDC(j,'python') expected=""" - DEBUT(); MA=LIRE_MAILLAGE(INFO=1,); @@ -78,7 +77,6 @@ FIN(); cr=app.get_text_JDC(j,'python') expected=""" - DEBUT(); MA=LIRE_MAILLAGE(INFO=1,); diff --git a/Tests/testelem/testoper1.py b/Tests/testelem/testoper1.py index dc5ae280..0956ff66 100644 --- a/Tests/testelem/testoper1.py +++ b/Tests/testelem/testoper1.py @@ -3,9 +3,9 @@ import cata1 from cata1 import OP1,OP2,OP3,OP4,OP5,OP6,OP7 from Accas import AsException,ASSD,OPER,SIMP,FACT,BLOC,_F -import Sdbase +import Noyau -class concept(ASSD,Sdbase.AsBase):pass +class concept(ASSD,Noyau.AsBase):pass import unittest diff --git a/Tests/testelem/testposition1.py b/Tests/testelem/testposition1.py index ce295dbe..84e36f81 100644 --- a/Tests/testelem/testposition1.py +++ b/Tests/testelem/testposition1.py @@ -3,9 +3,9 @@ import os import cata3 from Accas import AsException,ASSD,OPER,SIMP,FACT,BLOC,_F -import Sdbase +import Noyau -class concept(ASSD,Sdbase.AsBase):pass +class concept(ASSD,Noyau.AsBase):pass import unittest -- 2.39.2