From a7a391a79e2bcaff96ee367ee905412a4ab28cb6 Mon Sep 17 00:00:00 2001 From: Pascale Noyret Date: Thu, 15 Nov 2007 12:54:51 +0000 Subject: [PATCH] *** empty log message *** --- Aster/Cata/cataSTA9/SD/sd_char_contact.py | 42 +++--- Aster/Cata/cataSTA9/SD/sd_char_unilate.py | 32 ++-- Aster/Cata/cataSTA9/SD/sd_compor.py | 154 +++++++++++++++++++- Aster/Cata/cataSTA9/SD/sd_feti.py | 4 +- Aster/Cata/cataSTA9/SD/sd_listis.py | 7 +- Aster/Cata/cataSTA9/SD/sd_macr_elem_stat.py | 92 ++++++++++-- Aster/Cata/cataSTA9/SD/sd_mater.py | 19 ++- Aster/Cata/cataSTA9/SD/sd_matr_elem.py | 71 +++++---- Aster/Cata/cataSTA9/SD/sd_melasflu.py | 88 ++++++----- Aster/Cata/cataSTA9/SD/sd_mode_cycl.py | 4 +- Aster/Cata/cataSTA9/SD/sd_resuelem.py | 43 ++++-- Aster/Cata/cataSTA9/SD/sd_resultat.py | 8 +- Aster/Cata/cataSTA9/SD/sd_surface_1d.py | 32 ++-- Aster/Cata/cataSTA9/SD/sd_util.py | 18 ++- Aster/Cata/cataSTA9/SD/sd_vect_elem.py | 35 +++-- Aster/Cata/cataSTA9/SD/sd_xfem.py | 63 ++++---- 16 files changed, 501 insertions(+), 211 deletions(-) diff --git a/Aster/Cata/cataSTA9/SD/sd_char_contact.py b/Aster/Cata/cataSTA9/SD/sd_char_contact.py index 77c4c8bb..3ba9765c 100644 --- a/Aster/Cata/cataSTA9/SD/sd_char_contact.py +++ b/Aster/Cata/cataSTA9/SD/sd_char_contact.py @@ -1,4 +1,4 @@ -#@ MODIF sd_char_contact SD DATE 15/10/2007 AUTEUR GENIAUT S.GENIAUT +#@ MODIF sd_char_contact SD DATE 22/10/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -20,7 +20,7 @@ from SD import * from SD.sd_champ import sd_champ -from SD.sd_xfem import sd_modele_xfem +from SD.sd_xfem import sd_modele_xfem, sd_contact_xfem class sd_char_contact(AsBase): nomj =SDNom(fin=16) @@ -30,17 +30,17 @@ class sd_char_contact(AsBase): def exists(self): # retourne True si la SD semble exister. return self.FORMCO.exists - + def formulation_xfem(self): - if not self.exists() : return + if not self.exists() : return False iform = self.FORMCO.get()[0] - return iform == 3 + return iform == 3 def contact_xfem_actif(self): - if not self.formulation_xfem() : return - return self.XNBASC.exists - + if not self.formulation_xfem() : return False + return self.XNBASC.exists + BAMACO = Facultatif(AsVI()) BANOCO = Facultatif(AsVI()) CARACF = Facultatif(AsVR()) @@ -98,8 +98,13 @@ class sd_char_contact(AsBase): XNRELL = Facultatif(AsVK24()) MODELX = Facultatif(AsVK8(lonmax=1,)) - + # si contact xfem : + xfem = Facultatif(sd_contact_xfem(SDNom(nomj=''))) + + # indirection vers les champs de .XNBASC : + # Question à Mickael : + # la fonction suivante ne serait-elle pas mieux placée dans la classe sd_contact_xfem ? def check_char_contact_xfem_XNBASC(self, checker): if not self.contact_xfem_actif() : return lnom = self.XNBASC.get() @@ -109,24 +114,27 @@ class sd_char_contact(AsBase): if not nom.strip(): continue sd2 = sd_champ(nom) sd2.check(checker) - + # indirection vers les champs de .XNRELL : # On ne vérifie rien pour l'instant + # Question à Mickael : + # la fonction suivante ne serait-elle pas mieux placée dans la classe sd_contact_xfem ? def check_char_contact_xfem_XNRELL(self, checker): if not self.contact_xfem_actif() : return - lnom = self.XNRELL.get() + lnom = self.XNRELL.get() nbnom = self.XNRELL.lonuti for k in range(nbnom) : nom = lnom[k] - oo = AsObject(SDNom(nomj=nom,debut=0),genr='V', xous='S', type=Parmi('I','R')) - oo.check(checker) - + oo = AsObject(SDNom(nomj=nom,debut=0),genr='V', xous='S', type=Parmi('I','R')) + oo.check(checker) + + # Verification MODELE xfem def check_char_contact_xfem_MODELX(self, checker): if not self.contact_xfem_actif() : return - nom = self.MODELX.get()[0] + nom = self.MODELX.get()[0] sd2 = sd_modele_xfem(nom) sd2.check(checker) - - + + diff --git a/Aster/Cata/cataSTA9/SD/sd_char_unilate.py b/Aster/Cata/cataSTA9/SD/sd_char_unilate.py index e23f01a4..330ce996 100644 --- a/Aster/Cata/cataSTA9/SD/sd_char_unilate.py +++ b/Aster/Cata/cataSTA9/SD/sd_char_unilate.py @@ -1,34 +1,34 @@ -#@ MODIF sd_char_unilate SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_char_unilate SD DATE 22/10/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 * class sd_char_unilate(AsBase): nomj = SDNom(fin=16) - COEFD = AsVR() - COEFG = AsVR() DIMECU = AsVI() LISNOE = AsVI() POINOE = AsVI() METHCU = AsVI(lonmax=1,) PARACU = AsVR(lonmax=1,) CMPGCU = AsVK8() + COEFD = AsVect(ltyp=8, type=Parmi('K','R')) + COEFG = AsVect(ltyp=8, type=Parmi('K','R')) diff --git a/Aster/Cata/cataSTA9/SD/sd_compor.py b/Aster/Cata/cataSTA9/SD/sd_compor.py index 2088269c..7b77d401 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 19/06/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_compor SD DATE 12/11/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -19,6 +19,7 @@ # ====================================================================== from SD import * +from SD.sd_mater import sd_mater # Remarque : #------------ @@ -33,3 +34,154 @@ class sd_compor(AsBase): CPRR = Facultatif(AsVR()) + def check_tout(self,checker) : + #------------------------------- + cpri=self.CPRI.get() + type=cpri[0] + assert type in (1,2,3) , CPRI + if type == 1 : + self.monocristal(cpri,checker) + if type == 2 : + self.polycristal(cpri,checker) + if type == 3 : + self.multifibres(cpri,checker) + + + + def monocristal(self,cpri,checker) : + #------------------------------------ + nboccm=cpri[4] + nvi =cpri[2] + nbsys=(nvi-8)/3 + assert nvi==8+3*nbsys , (nvi, nbsys, cpri) + cprk=self.CPRK.get_stripped() + + # vérif existence et longueur + assert len(cpri)==7, cpri + assert len(cprk)==5*nboccm+1, (cpri,cprk) + assert not self.CPRR.get() + + # vérif CPRI : + #------------- + assert cpri[1] == 1 ,cpri + assert cpri[2] == nvi ,cpri + assert cpri[3] == 1 ,cpri + assert cpri[4] > 0 ,cpri + assert cpri[5] == 1 ,cpri + assert cpri[6] == nvi ,cpri + + # vérif CPRK : + #------------- + elas=cprk[5*nboccm] + assert elas in ('ELAS', 'ELAS_ORTH') ,cprk + for k in range(nboccm): + famil =cprk[5*k+0] + mater =cprk[5*k+1] + ecoul =cprk[5*k+2] + ecro_isot =cprk[5*k+3] + ecro_cine =cprk[5*k+4] + sd2=sd_mater(mater) ; sd2.check(checker) + assert famil in ('BASAL','BCC24','PRISMATIQUE','OCTAEDRIQUE','PYRAMIDAL1', + 'PYRAMIDAL2','CUBIQUE1','CUBIQUE2','MACLAGE','JOINT_GRAIN', + 'RL','UNIAXIAL') + assert ecoul in ('ECOU_VISC1','ECOU_VISC2','ECOU_VISC3') + assert ecro_isot in ('ECRO_ISOT1','ECRO_ISOT2') + assert ecro_cine in ('ECRO_CINE1','ECRO_CINE2') + + + + def polycristal(self,cpri,checker) : + #------------------------------------ + nbphases=cpri[1] + assert nbphases > 0 , cpri + lgcprk =cpri[6+3*nbphases-2] + assert lgcprk > 0 , cpri + cprk=self.CPRK.get_stripped() + cprr=self.CPRR.get() + + # vérif existence et longueur + #------------------------------ + assert len(cpri)==6+3*nbphases, (cpri,nbphases) + assert len(cprr)==2+4*nbphases, (cpri,cprr,nbphases) + assert len(cprk)==lgcprk, (cpri,cprk) + + # vérif CPRI : + #------------- + nvitot=cpri[2] + assert nvitot >= 0 ,cpri + nbmono=cpri[3] + assert nbmono > 0 ,cpri + nbpara =cpri[6+3*nbphases-1] + assert nbpara in (0,1,2) ,cpri + for k in range(nbphases): + nbfam1 = cpri[4+3*k+0] + numono = cpri[4+3*k+1] + nvi1 = cpri[4+3*k+2] + assert nbfam1 > 0 ,cpri + assert numono > 0 and numono <= nbmono ,(cpri,nbmono) + assert nvi1 >=0 ,cpri + + # vérif CPRR : + #------------- + frac_tot=0. + for k in range(nbphases): + frac =cprr[4*k+0] + assert frac >= 0. and frac <= 1. ,(cprr,k) + frac_tot=frac_tot+frac + for dir in range(1,4): + angl =cprr[4*k+dir] + assert angl >=0. and angl <=360. , (angl,dir) + assert frac_tot > 0.99 and frac_tot < 1.01 + + # vérif CPRK : + #------------- + locali =cprk[0] + assert locali in ('BZ','BETA') ,(locali,cprk) + decal=0 + for k in range(nbmono): + mono1 =cprk[0+decal+1] + sd2=sd_compor(mono1) ; sd2.check(checker) + nbfam1=int(cprk[0+decal+2]) + assert nbfam1 > 0 , (nbfam1,k,decal,cprk) + decal=decal+2+5*nbfam1+1 + # on pourrait encore vérifier que le .CPRK de mono1 a bien été recopié + # mais il faut bien s'arreter ... + + + + def multifibres(self,cpri,checker) : + #------------------------------------ + nbgmax=cpri[2] + cprk=self.CPRK.get_stripped() + + # vérif existence et longueur + assert len(cpri)==3, cpri + assert len(cprk)==6*nbgmax+1, (cpri,cprk) + assert not self.CPRR.get() + + # vérif CPRI : + #------------- + assert cpri[1] > 0, cpri + assert cpri[2] > 0, cpri + + # vérif CPRK : + #------------- + mater=cprk[6*nbgmax] + assert mater != '', cprk + sd2=sd_mater(mater) ; sd2.check(checker) + for k in range(nbgmax): + grfib1 =cprk[6*k+0] + mater1 =cprk[6*k+1] + loifib1 =cprk[6*k+2] + algo1d =cprk[6*k+3] + deform =cprk[6*k+4] + nbfib= int(cprk[6*k+5]) + assert grfib1 != '' , cprk + assert mater1 != '' , cprk + sd2=sd_mater(mater1) ; sd2.check(checker) + assert loifib1 != '' , cprk + assert algo1d in ('ANALYTIQUE','DEBORST') , cprk + assert deform in ('PETIT','PETIT_REAC','REAC_GEOM') , cprk + assert nbfib > 0 , cprk + + diff --git a/Aster/Cata/cataSTA9/SD/sd_feti.py b/Aster/Cata/cataSTA9/SD/sd_feti.py index a2cafff2..bacae34f 100644 --- a/Aster/Cata/cataSTA9/SD/sd_feti.py +++ b/Aster/Cata/cataSTA9/SD/sd_feti.py @@ -1,4 +1,4 @@ -#@ MODIF sd_feti SD DATE 10/07/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_feti SD DATE 23/10/2007 AUTEUR BOITEAU O.BOITEAU # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -36,7 +36,7 @@ class sd_feti1(AsBase): FETA = AsColl(acces='NO', stockage='DISPERSE', modelong='VARIABLE', type='I', ) FETJ = AsVI() FETI = AsVI() - FETH = AsVI(lonmax=4, ) + FETH = AsVI() FCFI = AsColl(acces='NO', stockage='DISPERSE', modelong='VARIABLE', type='I', ) FCFL = AsColl(acces='NO', stockage='DISPERSE', modelong='VARIABLE', type='K', ltyp=24, ) FCFM = AsColl(acces='NO', stockage='DISPERSE', modelong='VARIABLE', type='I', ) diff --git a/Aster/Cata/cataSTA9/SD/sd_listis.py b/Aster/Cata/cataSTA9/SD/sd_listis.py index 29a899b3..a0d2f416 100644 --- a/Aster/Cata/cataSTA9/SD/sd_listis.py +++ b/Aster/Cata/cataSTA9/SD/sd_listis.py @@ -1,4 +1,4 @@ -#@ MODIF sd_listis SD DATE 10/07/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_listis SD DATE 22/10/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -20,6 +20,7 @@ from SD import * from SD.sd_titre import sd_titre +from SD.sd_util import * class sd_listis(sd_titre): @@ -51,6 +52,8 @@ class sd_listis(sd_titre): assert vale[n1] == bint[k+1] assert len(vale) == n1+1 + assert sdu_monotone(vale) in (1,) , vale + # cas particulier : if len(vale) == 1 : @@ -58,5 +61,7 @@ class sd_listis(sd_titre): assert len(nbpa) == 1 assert len(lpas) == 1 assert vale[0] == bint[0] + assert nbpa[0] == 0, nbpa + assert lpas[0] == 0, lpas diff --git a/Aster/Cata/cataSTA9/SD/sd_macr_elem_stat.py b/Aster/Cata/cataSTA9/SD/sd_macr_elem_stat.py index a4803015..a1ebed47 100644 --- a/Aster/Cata/cataSTA9/SD/sd_macr_elem_stat.py +++ b/Aster/Cata/cataSTA9/SD/sd_macr_elem_stat.py @@ -1,21 +1,21 @@ -#@ MODIF sd_macr_elem_stat SD DATE 24/09/2007 AUTEUR DEVESA G.DEVESA +#@ MODIF sd_macr_elem_stat SD DATE 22/10/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_macr_elem_stat(AsBase): REFM = AsVK8() LINO = AsVI() VARM = AsVR(lonmax=2) - CONX = Facultatif(AsVI()) + CONX = Facultatif(AsVI()) # l'objet devient obligatoire dès l'étape de condensation de la rigidité # rigidité condensée : rigimeca = Facultatif(sd_matr_asse_gd(SDNom(nomj='.RIGIMECA', fin=19))) @@ -43,7 +43,7 @@ class sd_macr_elem_stat(AsBase): # masse condensée : massmeca = Facultatif(sd_matr_asse_gd(SDNom(nomj='.MASSMECA', fin=19))) MAEL_MASS_VALE = Facultatif(AsVR()) - + # amortissement condensé : MAEL_AMOR_VALE = Facultatif(AsVR()) @@ -52,5 +52,65 @@ class sd_macr_elem_stat(AsBase): LICH = Facultatif(AsColl(acces='NO', stockage='CONTIG', modelong='CONSTANT', type='K', ltyp=8)) + def check_longueurs(self, checker): + #------------------------------------ + # vérifs existence, longueurs, ... + + desm=self.DESM.get() + refm=self.REFM.get() + assert desm[0]==0, desm + nbnoe, nbnoi, nddle, nddli, nbchar, nbcas, nlage, nlagl, nlagi =desm[1:10] + assert nbnoe > 0 ,desm + assert nbchar >= 0 ,desm + + # si on n'a pas encore condensé la rigidité, certaines valeurs ne sont pas encore calculées : + if self.MAEL_RAID_VALE.exists : + assert nbnoi > 0 ,desm + assert nddle > 1 ,desm + assert nddli > 0 ,desm + assert nbcas >= 0 ,desm + assert nlage >= 0 ,desm + assert nlagl >= 0 ,desm + assert nlagi >= 0 ,desm + assert self.CONX.lonmax == 3*(nbnoe+nlage+nlagl) ,(desm,self.CONX.get()) + assert refm[5] == 'OUI_RIGI' + + assert self.REFM.lonmax == 9+nbchar ,(desm,self.REFM.get()) + assert self.LINO.lonmax == nbnoe ,(desm,self.LINO.get()) + + # rigidité condensée : + if self.MAEL_RAID_VALE.exists : + assert self.MAEL_RAID_VALE.lonmax == (nddle*(nddle+1))/2 + + assert self.PHI_IE.exists + phi_ie=self.PHI_IE.get() # on ne sait pas faire autrement que ramener l'objet entier ... + nlblph=len(phi_ie[1])/nddli # nombre de lignes de phi_ie par bloc + assert self.PHI_IE.nmaxoc == (nddle-1)/nlblph +1 , (nddle, self.PHI_IE.nmaxoc) + for ke in phi_ie.keys() : + assert len(phi_ie[ke]) == nddli*nlblph ,(nddli,nlblph,nddle,len(phi_ie[ke]),ke) + + # masse condensée : + if self.MAEL_MASS_VALE.exists : + assert self.MAEL_MASS_VALE.lonmax == (nddle*(nddle+1))/2 + assert refm[6] == 'OUI_MASS' + + # amortissement condensé : (JP : je ne sais pas si ca peut exister ?) + if self.MAEL_AMOR_VALE.exists : + assert self.MAEL_AMOR_VALE.lonmax == (nddle*(nddle+1))/2 + assert refm[7] == 'OUI_AMOR' + + # chargements condensés : + if nbcas > 0 : + assert self.LICA.exists + assert self.LICA.nmaxoc >= nbcas + lica=self.LICA.get() + for k in lica.keys(): + assert len(lica[k]) == 2*(nddli + nddle) + assert self.LICH.exists + assert self.LICH.nmaxoc == self.LICA.nmaxoc + assert self.LICH.nutioc == self.LICA.nutioc + lich=self.LICH.get() + for k in lich.keys(): + assert len(lich[k]) >= nbchar + 1 diff --git a/Aster/Cata/cataSTA9/SD/sd_mater.py b/Aster/Cata/cataSTA9/SD/sd_mater.py index 7fad929c..ff528b56 100644 --- a/Aster/Cata/cataSTA9/SD/sd_mater.py +++ b/Aster/Cata/cataSTA9/SD/sd_mater.py @@ -1,4 +1,4 @@ -#@ MODIF sd_mater SD DATE 17/07/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_mater SD DATE 22/10/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -43,12 +43,17 @@ class sd_compor1(AsBase): # parfois, THER_NL crée une sd_fonction pour BETA def check_compor1_i_VALK(self, checker): nom= self.nomj().strip() - valk=list(self.VALK.get()) - if not valk : return if nom[8:16]=='.THER_NL' : - k=valk.index('BETA ') - nomfon=valk[2*k+1] - sd2=sd_fonction(nomfon) ; sd2.check(checker) + valk=list(self.VALK.get_stripped()) + if valk : + nbk2=self.VALK.lonuti + nbr=self.VALR.lonuti + nbc=self.VALC.lonuti + nbk=nbk2-nbr-nbc + k2=valk.index('BETA') + k=k2-nbr-nbc + nomfon=valk[nbr+nbc+nbk/2+k] + sd2=sd_fonction(nomfon) ; sd2.check(checker) class sd_mater(AsBase): @@ -71,6 +76,6 @@ class sd_mater(AsBase): nomc1=self.nomj()[:8]+'.'+nom comp1 = sd_compor1(nomc1) - # parfois, comp1 est vide. AJACOT_PB : ssls115g/DEFI_COQU_MULT + # parfois, comp1 est vide : ssls115g/DEFI_COQU_MULT if comp1.VALK.get() : comp1.check(checker) diff --git a/Aster/Cata/cataSTA9/SD/sd_matr_elem.py b/Aster/Cata/cataSTA9/SD/sd_matr_elem.py index d1149e02..73202cbc 100644 --- a/Aster/Cata/cataSTA9/SD/sd_matr_elem.py +++ b/Aster/Cata/cataSTA9/SD/sd_matr_elem.py @@ -1,45 +1,62 @@ -#@ MODIF sd_matr_elem SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_matr_elem SD DATE 22/10/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_resuelem import sd_resuelem +from SD.sd_modele import sd_modele +from SD.sd_cham_mater import sd_cham_mater +from SD.sd_cara_elem import sd_cara_elem + class sd_matr_elem(AsBase): nomj = SDNom(fin=8) - LISTE_RESU = AsVK24() - REFE_RESU = AsVK24(lonmax=5, ) + REFE_RESU = AsVK24(lonmax=5, ) + LISTE_RESU = Facultatif(AsVK24()) # indirection par LISTE_RESU : def check_matr_elem_i_LISTE_RESU(self, checker): - lnom = self.LISTE_RESU.get() - if not lnom: - checker.err(self, "sd_champ LISTE_RESU absent") - return + if not self.LISTE_RESU.exists : return + lnom = self.LISTE_RESU.get_stripped() for nom in lnom: - if not nom.strip(): - continue - resu1 = sd_resuelem(nom) - # parfois, le nom est non ' ' et pourtant le sd_resuelem n'existe pas - # Il faudrait corriger cette anomalie. - if resu1.NOLI.exists : - resu1.check(checker) + if nom != '' : + sd2 = sd_resuelem(nom); sd2.check(checker) + + + def check_1(self, checker): + refe = self.REFE_RESU.get_stripped() + assert refe[2] in ('OUI_SOUS_STRUC', 'NON_SOUS_STRUC'), refe + + # existence de LISTE_RESU : + if refe[2] == 'NON_SOUS_STRUC': + assert self.LISTE_RESU.exists + + assert refe[1] != '', refe + + sd2=sd_modele(refe[0]) ; sd2.check(checker) + + if refe[3] != '' : + sd2=sd_cham_mater(refe[3]) ; sd2.check(checker) + + if refe[4] != '' : + sd2=sd_cara_elem(refe[4]) ; sd2.check(checker) + diff --git a/Aster/Cata/cataSTA9/SD/sd_melasflu.py b/Aster/Cata/cataSTA9/SD/sd_melasflu.py index eecf0741..5d968ae3 100644 --- a/Aster/Cata/cataSTA9/SD/sd_melasflu.py +++ b/Aster/Cata/cataSTA9/SD/sd_melasflu.py @@ -1,4 +1,4 @@ -#@ MODIF sd_melasflu SD DATE 09/05/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_melasflu SD DATE 22/10/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -41,93 +41,99 @@ class sd_melasflu(AsBase): FACT = AsVR(SDNom(debut=19), ) DESC = AsVK16(SDNom(debut=19), lonmax=1, ) - # Critère présence VCN et VEN ???? + # si FAISCEAU_TRANS + couplage fluide-structure + BASE_MODALE/AMOR_REDUIT_CONN : VCN = Facultatif(AsVR()) VEN = Facultatif(AsVR()) - sd_l_table = Facultatif(sd_l_table(SDNom(nomj=''))) # Si faisceau axial sd_table = sd_table(SDNom(nomj='')) + sd_l_table = Facultatif(sd_l_table(SDNom(nomj=''))) # Si FAISCEAU_AXIAL # 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) + remf=self.REMF.get_stripped() + sd2 = sd_type_flui_stru(remf[0]) ; sd2.check(checker) + sd2 = sd_resultat_dyn(remf[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 + remf=self.REMF.get() + desc=self.DESC.get_stripped() # calcul de itypfl (type d'interaction fluide / structure) : - typfl = sd_type_flui_stru(self.REMF.get()[0]) - itypfl=typfl.FSIC.get()[0] + typfl = sd_type_flui_stru(remf[0]) + itypfl=typfl.FSIC.get()[0] # 1 -> FAISCEAU_TRANS + # 3 -> FAISCEAU_AXIAL + couplage=typfl.FSIC.get()[1] # 1 -> prise en compte du couplage + assert itypfl > 0 , remf # calcul de nbmode (nombre de modes) : - nbmode=len(numo) + nbmode=self.NUMO.lonmax + assert nbmode > 0 # calcul de nbvite (nombre de vitesses) : - nbvite=len(vite) + nbvite=self.VITE.lonmax + assert nbvite > 0 # vérification de l'objet .DESC : #-------------------------------- - sdu_compare(self.DESC,checker,desc[0].strip(),'==','DEPL','DESC[1]=="DEPL"') + assert len(desc)==1 , desc + assert desc[0] == 'DEPL' , desc # vérification de l'objet .NUMO : #-------------------------------- - sdu_tous_compris(self.NUMO,checker,vmin=1) + for x in self.NUMO.get() : + assert x >= 1 , numo # 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') + assert self.FACT.lonmax == 3*nbmode*nbvite else : - sdu_compare(self.FACT,checker,len(fact),'==',3*nbmode,'LONMAX(FACT)==3*nbmode') + assert self.FACT.lonmax == 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') + assert self.MASG.lonmax == nbmode*nbvite else : - sdu_compare(self.MASG,checker,len(masg),'==',nbmode,'LONMAX(MASG)==nbmode') + assert self.MASG.lonmax == nbmode # vérification de l'objet .FREQ : #-------------------------------- - sdu_compare(self.FREQ,checker,len(freq),'==',2*nbmode*nbvite,'LONMAX(FREQ)==2*nbmode*nbvite') + assert self.FREQ.lonmax == 2*nbmode*nbvite + + # vérification existence .VCN et .VEN: + #------------------------------------- + if self.VCN.exists : assert self.VEN.exists + if self.VEN.exists : assert self.VCN.exists + if self.VEN.exists : assert itypfl == 1 and couplage == 1 # vérification de l'objet .VCN : #-------------------------------- - if vcn : + if self.VCN.exists : 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') + nbzone=fsvi[1] + nbval=0 + for i in range(nbzone) : + nbval=nbval+fsvi[2+nbzone+i] + assert self.VCN.lonmax == nbmode*nbval # vérification de l'objet .VEN : #-------------------------------- - if ven : - sdu_compare(self.VEN,checker,len(ven),'==',nbmode,'LONMAX(VEN)==nbmode') + if self.VEN.exists : + assert self.VEN.lonmax == 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") + tcham=self.sd_table + assert tcham.nb_column() == 1 , tcham col1=tcham.get_column_name('NOM_CHAM') - sdu_assert(None, checker, col1, "Manque colonne NOM_CHAM") + assert col1, "Il manque la colonne NOM_CHAM" data=col1.data.get() mask=col1.mask.get() @@ -142,12 +148,16 @@ class sd_melasflu(AsBase): if profchno == '': profchno=profchn1 else: - sdu_compare(None,checker,profchn1,'==',profchno,"Tous PROFCHNO identiques") + assert profchn1 == profchno ,(profchn1, profchno) # vérification de la SD l_table : #-------------------------------- - if itypfl==3 : # faisceau axial + if self.sd_l_table.LTNT.exists : assert itypfl == 3 # FAISCEAU_AXIAL + if itypfl == 3 : assert self.sd_l_table.LTNT.exists + + if self.sd_l_table.LTNT.exists : + l_table = self.sd_l_table l_table.check(checker) # la l_table ne contient qu'une seule table nommée 'MATR_GENE' diff --git a/Aster/Cata/cataSTA9/SD/sd_mode_cycl.py b/Aster/Cata/cataSTA9/SD/sd_mode_cycl.py index 645d999e..f89c9a75 100644 --- a/Aster/Cata/cataSTA9/SD/sd_mode_cycl.py +++ b/Aster/Cata/cataSTA9/SD/sd_mode_cycl.py @@ -1,4 +1,4 @@ -#@ MODIF sd_mode_cycl SD DATE 10/07/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_mode_cycl SD DATE 23/10/2007 AUTEUR BODEL C.BODEL # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -89,6 +89,6 @@ class sd_mode_cycl(AsBase): nb_mod, nb_ddl, nb_ddli, nb_freq, nb_diam = self.u_dime() freq=self.CYCL_FREQ.get() assert len(freq) == nb_diam*nb_freq ,(self.CYCL_DESC.get(),len(freq)) - for x in freq : assert x > 0 , freq + for x in freq : assert x >= 0 , freq diff --git a/Aster/Cata/cataSTA9/SD/sd_resuelem.py b/Aster/Cata/cataSTA9/SD/sd_resuelem.py index 097e1591..a89f47e0 100644 --- a/Aster/Cata/cataSTA9/SD/sd_resuelem.py +++ b/Aster/Cata/cataSTA9/SD/sd_resuelem.py @@ -1,24 +1,26 @@ -#@ MODIF sd_resuelem SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_resuelem SD DATE 22/10/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 + class sd_resuelem(AsBase): nomj = SDNom(fin=19) @@ -27,3 +29,16 @@ class sd_resuelem(AsBase): DESC = AsVI(SDNom(debut=19), docu='RESL', ) + def check_1(self, checker): + noli = self.NOLI.get_stripped() + sd2=sd_ligrel(noli[0]) ; sd2.check(checker) + assert noli[1] != '' , noli + + desc = self.DESC.get() + assert desc[0] > 0 and desc[0] < 1000 , desc + nbgr=desc[1] + assert nbgr > 0 , desc + assert len(desc)==nbgr+2, desc + assert self.RESL.nmaxoc == nbgr, desc + for k in desc : + assert k >= 0, desc diff --git a/Aster/Cata/cataSTA9/SD/sd_resultat.py b/Aster/Cata/cataSTA9/SD/sd_resultat.py index 4e33f096..565f82a4 100644 --- a/Aster/Cata/cataSTA9/SD/sd_resultat.py +++ b/Aster/Cata/cataSTA9/SD/sd_resultat.py @@ -1,4 +1,4 @@ -#@ MODIF sd_resultat SD DATE 17/07/2007 AUTEUR COURTOIS M.COURTOIS +#@ MODIF sd_resultat SD DATE 22/10/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -49,12 +49,6 @@ class sd_resultat(sd_titre): 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): tach = self.TACH.get() diff --git a/Aster/Cata/cataSTA9/SD/sd_surface_1d.py b/Aster/Cata/cataSTA9/SD/sd_surface_1d.py index 96dfb7f4..b4c7ec0e 100644 --- a/Aster/Cata/cataSTA9/SD/sd_surface_1d.py +++ b/Aster/Cata/cataSTA9/SD/sd_surface_1d.py @@ -1,21 +1,21 @@ -#@ MODIF sd_surface_1d SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_surface_1d SD DATE 22/10/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 * @@ -29,8 +29,8 @@ class sd_surface_1d(AsBase): nomj = SDNom(fin=13) sgtel = sd_reperage_1d(SDNom(nomj='.SGTEL')) repom = sd_reperage_omega(SDNom(nomj='')) - CONEX_ORIG = AsVI(SDNom(nomj='.CONEX.ORIG'), lonmax=1, ) - CONEX_EXTR = AsVI(SDNom(nomj='.CONEX.EXTR'), lonmax=1, ) + CONEX_ORIG = AsVI(SDNom(nomj='.CONEX.ORIG')) + CONEX_EXTR = AsVI(SDNom(nomj='.CONEX.EXTR')) DESC = AsVR(SDNom(debut=13), lonmax=6, ) diff --git a/Aster/Cata/cataSTA9/SD/sd_util.py b/Aster/Cata/cataSTA9/SD/sd_util.py index 84256d15..10ea554c 100644 --- a/Aster/Cata/cataSTA9/SD/sd_util.py +++ b/Aster/Cata/cataSTA9/SD/sd_util.py @@ -1,4 +1,4 @@ -#@ MODIF sd_util SD DATE 10/07/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_util SD DATE 22/10/2007 AUTEUR PELLET J.PELLET # -*- coding: iso-8859-1 -*- # CONFIGURATION MANAGEMENT OF EDF VERSION # ====================================================================== @@ -141,10 +141,8 @@ def sdu_monotone(seqini) : 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 : @@ -172,3 +170,17 @@ def sdu_licmp_gd(numgd) : nomgd=sdu_nom_gd(numgd) nocmp=aster.getcolljev('&CATA.GD.NOMCMP') return nocmp[nomgd.ljust(8)] + + + +# 3) Utilitaires pour la vérification de l'existence des objets : +# ----------------------------------------------------------------------------------------- + +def sdu_ensemble(lojb) : + # vérifie que les objets JEVEUX de lojb existent simultanément : + assert len(lojb) > 1 , lojb + lexi=[] + for obj1 in lojb : + lexi.append(obj1.exists) + for x in lexi[1:] : + assert x==lexi[0] , (lojb,lexi) diff --git a/Aster/Cata/cataSTA9/SD/sd_vect_elem.py b/Aster/Cata/cataSTA9/SD/sd_vect_elem.py index bcadd9d7..f47c7c14 100644 --- a/Aster/Cata/cataSTA9/SD/sd_vect_elem.py +++ b/Aster/Cata/cataSTA9/SD/sd_vect_elem.py @@ -1,21 +1,21 @@ -#@ MODIF sd_vect_elem SD DATE 13/02/2007 AUTEUR PELLET J.PELLET +#@ MODIF sd_vect_elem SD DATE 22/10/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 * @@ -27,3 +27,10 @@ class sd_vect_elem(sd_matr_elem): LISTE_CHAR = Facultatif(AsColl(acces='NO', stockage='CONTIG', modelong='CONSTANT', type='I', )) + def check_LISTE_CHAR(self, checker): + if not self.LISTE_CHAR.exists : return + lchar = self.LISTE_CHAR.get() + for nochar in lchar.keys() : + for k in lchar[nochar] : + assert k in (0,1) , lchar + diff --git a/Aster/Cata/cataSTA9/SD/sd_xfem.py b/Aster/Cata/cataSTA9/SD/sd_xfem.py index 680c87e5..af9cc2ca 100644 --- a/Aster/Cata/cataSTA9/SD/sd_xfem.py +++ b/Aster/Cata/cataSTA9/SD/sd_xfem.py @@ -1,21 +1,21 @@ -#@ MODIF sd_xfem SD DATE 15/10/2007 AUTEUR GENIAUT S.GENIAUT +#@ MODIF sd_xfem SD DATE 22/10/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,6 +23,7 @@ from SD import * from SD.sd_cham_no import sd_cham_no from SD.sd_cham_elem import sd_cham_elem from SD.sd_carte import sd_carte +from SD.sd_util import * @@ -31,11 +32,10 @@ from SD.sd_carte import sd_carte #------------------------------- class sd_fiss_xfem(AsBase): + nomj = SDNom(fin=8) # I.1) objets relatifs aux level sets - nomj = SDNom(fin=8) - LNNO = sd_cham_no() LTNO = sd_cham_no() GRLNNO = sd_cham_no() @@ -57,7 +57,7 @@ class sd_fiss_xfem(AsBase): MAILFISS_HECT = Facultatif(AsVI(SDNom(nomj='.MAILFISS .HECT'))) MAILFISS_INDIC = AsVI(SDNom(nomj='.MAILFISS .INDIC'), lonmax=6, ) LISNOH = Facultatif(AsVI()) - + # I.3) objets relatifs à la propagation PRO_MES_EL = Facultatif(sd_cham_elem(SDNom(nomj='.PRO.MES_EL'))) @@ -71,17 +71,23 @@ class sd_fiss_xfem(AsBase): LISRL = Facultatif(AsVI(SDNom(nomj='.LISRL'))) +# 1.5) vérifications d'existence : + + def check_existence(self,checker) : + sdu_ensemble((self.FONDFISS, self.FONDMULT)) + sdu_ensemble((self.LISRL, self.LISCO)) + sdu_ensemble((self.PRO_MES_EL.CELD, self.PRO_NORMAL.CELD)) + #------------------------------- # II. sd modele #------------------------------- class sd_modele_xfem(AsBase): + nomj = SDNom(fin=8) # II.1) objets relatifs aux sous-éléments - nomj = SDNom(fin=8) - TOPOSE_PIN = sd_cham_elem(SDNom(nomj='.TOPOSE.PIN')) TOPOSE_CNS = sd_cham_elem(SDNom(nomj='.TOPOSE.CNS')) TOPOSE_HEA = sd_cham_elem(SDNom(nomj='.TOPOSE.HEA')) @@ -101,7 +107,7 @@ class sd_modele_xfem(AsBase): TOPOFAC_OE = sd_cham_elem(SDNom(nomj='.TOPOFAC.OE')) TOPOFAC_OM = sd_cham_elem(SDNom(nomj='.TOPOFAC.OM')) -# II.3) objets concaténés relatifs aux level sets +# II.3) objets concaténés relatifs aux level sets LNNO = sd_cham_no() LTNO = sd_cham_no() @@ -110,7 +116,7 @@ class sd_modele_xfem(AsBase): # II.4) autres objets - XFEM_CONT = AsVI(lonmax=1) # contact ou pas + XFEM_CONT = AsVI(lonmax=1) # contact ou pas FISS = AsVK8() # noms des fissures NFIS = AsVI(lonmax=1,) # nombre de fissures XMAFIS = sd_carte() # pour chaque maille : nom de la fissure @@ -123,13 +129,12 @@ class sd_modele_xfem(AsBase): class sd_contact_xfem(AsBase): #------------------------------- + nomj = SDNom(fin=16) - nomj = SDNom(fin=8) - - CARACF = AsVR(SDNom(nomj='CONTACT.CARACF')) - ECPDON = AsVI(SDNom(nomj='CONTACT.ECPDON')) - METHCO = AsVI(SDNom(nomj='CONTACT.METHCO')) + CARACF = AsVR() + ECPDON = AsVI() + METHCO = AsVI() - XFIMAI = AsVK8(SDNom(nomj='CONTACT.XFIMAI')) - XNRELL = AsVK24(SDNom(nomj='CONTACT.XNRELL')) - XNBASC = AsVK24(SDNom(nomj='CONTACT.XNBASC')) + XFIMAI = AsVK8() + XNRELL = AsVK24() + XNBASC = AsVK24() -- 2.39.2