]> SALOME platform Git repositories - tools/eficas.git/blob - Aster/Cata/cataSTA10/SD/sd_maillage.py
Salome HOME
b1fd54a181fbe335be15ee9dbaaf266e4abceac7
[tools/eficas.git] / Aster / Cata / cataSTA10 / SD / sd_maillage.py
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.
10 #
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.
15 #
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 # ======================================================================
20
21 from SD import *
22 from SD.sd_titre import sd_titre
23
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
27
28
29 class sd_voisinage(AsBase):
30 #-------------------------------
31     nomj = SDNom(fin=12)
32     PTVOIS = AsVI()
33     ELVOIS = AsVI()
34
35
36 class sd_maillage(sd_titre):
37 #-------------------------------
38     nomj = SDNom(fin=8)
39
40     DIME = AsVI(lonmax=6, )
41
42     # un sd_maillage a toujours des noeuds :
43     NOMNOE = AsPn(ltyp=8)
44     COORDO = sd_cham_no()
45
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=''))
48
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', ))
52
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))
57
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())
63
64     # si le sd_maillage est linéique (tube_GV) :
65     abs_curv  = Facultatif(sd_carte(SDNom(nomj='.ABS_CURV')))
66
67     # Lorsque le sd_maillage sert de support a un sd_modele contenant des volumes finis :
68     VGE  = Facultatif(sd_voisinage())
69
70     ADAPTATION = Facultatif(AsVI(lonmax=1, ))
71
72
73     def u_dime(self):
74         dime=self.DIME.get()
75         nb_no    =dime[0]
76         nb_nl    =dime[1]
77         nb_ma    =dime[2]
78         nb_sm    =dime[3]
79         nb_sm_mx =dime[4]
80         dim_coor =dime[5]
81         return nb_no, nb_nl, nb_ma, nb_sm, nb_sm_mx, dim_coor
82
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.
85
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
92
93
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
98
99
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
106
107
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
114
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
119         typl=self.TYPL.get()
120         for k in typl :
121             assert  k in (-1, -2) , typl
122