Beispiel #1
0
 def _read_all(self):
     """Read the file line per line."""
     re_lab = re.compile('POINT *([0-9]+) *CHAMP NO *([0-9]+) *'
                         'DDL NO *([0-9]+)')
     nbf = self.freq_nb
     for ich in range(3):
         for iddl in range(3):
             if ich != iddl:
                 for ifrq in range(self.nbpc * (nbf + 2)):
                     self.fobj.readline()
                     self.ln += 1
                 continue
             for ipc in range(self.nbpc):
                 self.ln += 2
                 self.fobj.readline()
                 mat = re_lab.search(self.fobj.readline())
                 assert mat is not None, 'unexpected line'
                 nums = map(int, mat.groups())
                 assert nums == [ipc + 1, ich + 1, iddl + 1], \
                     '(%d, %d, %d) expected' % (ipc + 1, ich + 1, iddl + 1)
                 val = []
                 self.ln += lire_nb_valeurs(self.fobj, 4 * nbf, val, double)
                 array = NP.array(val).reshape((nbf, 4))
                 self.listfreq = array[:, 0]
                 real = array[:, 1]
                 imag = array[:, 2]
                 self.values[ipc].set(iddl, real, imag)
Beispiel #2
0
 def _read_mode_stat_amor(self):
     """modes statiques : amortissements (facultatifs)"""
     unused = lire_nb_valeurs(self.fobj,
                              self.struct.mode_stat_nb**2,
                              self.struct.mode_stat_amor,
                              double,
                              1,
                              1,
                              regexp_label="STAT +AMOR")
Beispiel #3
0
 def _read_mode_coupl_amor(self):
     """modes couplés : amortissements (facultatifs)"""
     unused = lire_nb_valeurs(self.fobj,
                              self.struct.mode_dyna_nb *
                              self.struct.mode_stat_nb,
                              self.struct.coupl_amor,
                              double,
                              1,
                              1,
                              regexp_label="COUPL +AMOR")
Beispiel #4
0
 def _read_mode_stat(self):
     """mode statiques"""
     self.ln += lire_nb_valeurs(self.fobj,
                                self.struct.noeud_nb * 3,
                                self.struct.mode_stat_vale,
                                double,
                                self.struct.mode_stat_nb,
                                1,
                                max_per_line=3,
                                regexp_label="MODE +STAT +INTER")
Beispiel #5
0
 def _read_mode_dyna(self):
     """mode dynamiques"""
     self.ln += lire_nb_valeurs(self.fobj,
                                self.struct.noeud_nb * 3,
                                self.struct.mode_dyna_vale,
                                double,
                                self.struct.mode_dyna_nb,
                                1,
                                max_per_line=3,
                                regexp_label="MODE +DYNA")
Beispiel #6
0
 def _read_mailles_connect_idx(self, idx):
     """mailles : nb et connectivité pour un groupe"""
     self.ln += 1
     lab, nb = self.fobj.readline().split()
     nb = int(nb)
     if lab == 'POINT':
         self.struct.maille_dime[idx] = 1
     elif lab == 'ELEM':
         self.struct.maille_dime[idx] = 8
     else:
         raise ValueError('unsupported element type: %s' % lab)
     self.ln += lire_nb_valeurs(self.fobj,
                                nb * self.struct.maille_dime[idx],
                                self.struct.maille_connec[idx], int)
     self.struct.maille_nb[idx] = nb
Beispiel #7
0
 def _read_mode_coupl_rigi(self):
     """modes couplés : rigidité"""
     self.ln += lire_nb_valeurs(
         self.fobj, self.struct.mode_dyna_nb * self.struct.mode_stat_nb,
         self.struct.coupl_rigi, double, 1, 1)
Beispiel #8
0
 def _read_mode_coupl_mass(self):
     """modes couplés : masse"""
     self.ln += lire_nb_valeurs(
         self.fobj, self.struct.mode_dyna_nb * self.struct.mode_stat_nb,
         self.struct.coupl_mass, double, 1, 1)
Beispiel #9
0
 def _read_mode_stat_rigi(self):
     """modes statiques : rigidité"""
     self.ln += lire_nb_valeurs(self.fobj, self.struct.mode_stat_nb**2,
                                self.struct.mode_stat_rigi, double, 1, 1)
Beispiel #10
0
 def _read_mode_stat_mass(self):
     """modes statiques : masse"""
     self.ln += lire_nb_valeurs(self.fobj, self.struct.mode_stat_nb**2,
                                self.struct.mode_stat_mass, double, 1, 1)
Beispiel #11
0
 def _read_mode_dyna_rigi(self):
     """modes dynamiques : rigidité"""
     self.ln += lire_nb_valeurs(self.fobj, self.struct.mode_dyna_nb,
                                self.struct.mode_dyna_rigi, double, 1, 1)
Beispiel #12
0
 def _read_mode_dyna_mass(self):
     """modes dynamiques : masse"""
     self.ln += lire_nb_valeurs(self.fobj, self.struct.mode_dyna_nb,
                                self.struct.mode_dyna_mass, double, 1, 1)
Beispiel #13
0
 def _read_mode_dyna_amor(self):
     """modes dynamiques : amortissement"""
     self.ln += lire_nb_valeurs(self.fobj, self.struct.mode_dyna_nb,
                                self.struct.mode_dyna_amor, double, 1, 1)
Beispiel #14
0
 def _read_mode_dyna_freq(self):
     """modes dynamiques : fréquence"""
     self.ln += lire_nb_valeurs(self.fobj, self.struct.mode_dyna_nb,
                                self.struct.mode_dyna_freq, double, 1, 1)
Beispiel #15
0
 def _read_noeuds_coord(self):
     """noeuds : coordonnées"""
     self.ln += lire_nb_valeurs(self.fobj, self.struct.noeud_nb * 3,
                                self.struct.noeud_coor, double)