1 #@ MODIF sd_maillage SD DATE 11/05/2011 AUTEUR SELLENET N.SELLENET
2 # -*- coding: iso-8859-1 -*-
3 # CONFIGURATION MANAGEMENT OF EDF VERSION
4 # ======================================================================
5 # COPYRIGHT (C) 1991 - 2011 EDF R&D WWW.CODE-ASTER.ORG
6 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
7 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
8 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
9 # (AT YOUR OPTION) ANY LATER VERSION.
11 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
12 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
13 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
14 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.
16 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
17 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
18 # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
19 # ======================================================================
22 from SD.sd_titre import sd_titre
24 from SD.sd_cham_no import sd_cham_no
25 from SD.sd_carte import sd_carte
26 from SD.sd_l_table import sd_l_table
29 class sd_voisinage(AsBase):
30 #-------------------------------
36 class sd_maillage(sd_titre):
37 #-------------------------------
40 DIME = AsVI(lonmax=6, )
42 # un sd_maillage a toujours des noeuds :
46 # normalement, un sd_maillage a toujours une "sd_l_table" contenant des caractéristiques géométriques :
47 lt = sd_l_table(SDNom(nomj=''))
49 # si le sd_maillage a des groupes :
50 GROUPENO = Facultatif(AsColl(acces='NO', stockage='DISPERSE', modelong='VARIABLE', type='I', ))
51 GROUPEMA = Facultatif(AsColl(acces='NO', stockage='DISPERSE', modelong='VARIABLE', type='I', ))
53 # si le sd_maillage a des mailles :
54 CONNEX = Facultatif(AsColl(acces='NU', stockage='CONTIG', modelong='VARIABLE', type='I', ))
55 TYPMAIL = Facultatif(AsVI())
56 NOMMAI = Facultatif(AsPn(ltyp=8))
58 # si le sd_maillage a des super-mailles :
59 NOMACR = Facultatif(AsVK8())
60 SUPMAIL = Facultatif(AsColl(acces='NO', stockage='DISPERSE', modelong='VARIABLE', type='I', ))
61 PARA_R = Facultatif(AsVR())
62 TYPL = Facultatif(AsVI())
64 # si le sd_maillage est linéique (tube_GV) :
65 abs_curv = Facultatif(sd_carte(SDNom(nomj='.ABS_CURV')))
67 # Lorsque le sd_maillage sert de support a un sd_modele contenant des volumes finis :
68 VGE = Facultatif(sd_voisinage())
70 ADAPTATION = Facultatif(AsVI(lonmax=1, ))
81 return nb_no, nb_nl, nb_ma, nb_sm, nb_sm_mx, dim_coor
83 # remarque : la sd_maillage pouvant etre "volumineuse", on s'interdit (pour des raisons de temps CPU)
84 # de vérifier le contenu des gros objets.
86 def check_DIME(self,checker):
87 nb_no, nb_nl, nb_ma, nb_sm, nb_sm_mx, dim_coor = self.u_dime()
88 assert nb_sm <= nb_sm_mx , (nb_sm, nb_sm_mx)
89 if nb_nl > 0 : assert nb_sm > 0
90 assert nb_no > 0 , nb_no
91 assert dim_coor in (2,3), dim_coor
94 def check_NOEUDS(self,checker):
95 nb_no, nb_nl, nb_ma, nb_sm, nb_sm_mx, dim_coor = self.u_dime()
96 assert self.NOMNOE.nomuti == nb_no + nb_nl , (nb_no, nb_nl)
97 assert self.COORDO.VALE.lonmax == 3*nb_no , nb_no
100 def check_MAILLES(self,checker):
101 nb_no, nb_nl, nb_ma, nb_sm, nb_sm_mx, dim_coor = self.u_dime()
102 if nb_ma == 0 : return
103 assert self.NOMMAI.nommax == nb_ma , nb_ma
104 assert self.TYPMAIL.lonmax == nb_ma , nb_ma
105 assert self.CONNEX.nmaxoc == nb_ma , nb_ma
108 def check_SSS(self,checker):
109 nb_no, nb_nl, nb_ma, nb_sm, nb_sm_mx, dim_coor = self.u_dime()
110 if nb_sm == 0 : return
111 assert self.NOMACR.lonmax == nb_sm , nb_sm
112 assert self.PARA_R.lonmax == 14*nb_sm , nb_sm
113 assert self.SUPMAIL.nmaxoc == nb_sm , nb_sm
115 def check_TYPL(self,checker):
116 nb_no, nb_nl, nb_ma, nb_sm, nb_sm_mx, dim_coor = self.u_dime()
117 if nb_nl == 0 : return
118 assert self.TYPL.lonmax == nb_nl , nb_nl
121 assert k in (-1, -2) , typl