Welcome to the forums. Please post in English or French.

You are not logged in.

#1 2021-07-06 10:54:43

Registered: 2021-06-29
Posts: 1

Model reduction - extract matrix after ASSE_MATR_GENE

Hi everyone,

I am using model reduction and dynamic substructuring to model the mechanical behavior of different parts. At every stage of the reduction I extract the mass and stiffness matrices, but I have a problem in doing so when matrices are assembled in the generalised model (ASSE_MATR_GENE).

This behavior can be observed in the test case shlv301 if the RIGGEN matrix is printed with the following command:


Considering my case, I assemble two macro-elements with stiffness matrices k1 and k2 (both of dimension 260x260) and once the generalized model is generated I assemble the matrix and try to export it (same procedure as in shlv301):

                   OPTION='RIGI_GENE' )
scipy.sparse.save_npz(path + '/' + filename + '.npz', scipy.sparse.csr_matrix(k.EXTR_MATR_GENE()))

The error happens in co_matr_asse_gene.py, more specifically in the method:

class matr_asse_gene_r(matr_asse_gene):
  def EXTR_MATR_GENE(self) :
    """ retourne les valeurs de la matrice generalisee reelle
    dans un format numpyal Array
        Attributs retourne
          - self.valeurs : numpy.array contenant les valeurs """
    if not self.accessible():
       raise AsException("Erreur dans matr_asse_gene.EXTR_MATR_GENE en PAR_LOT='OUI'")
    import numpy

    desc = self.sdj.DESC.get()
    # On teste si le DESC du vecteur existe
    if not desc:
        raise AsException("L'objet vecteur {0!r} n'existe pas"
    desc = numpy.array(desc)

    # Si le stockage est plein
    if desc[2]==2 :
       valeur = VALM_triang2array(self.sdj.VALM.get(), desc[1])

    # Si le stockage est diagonal
    elif desc[2]==1 :
       valeur = VALM_diag2array(self.sdj.VALM.get(), desc[1])

    # Sinon on arrete tout
      raise KeyError
    return valeur

It falls in the "# Sinon on arrete tout" case. I have:

  • desc[2] is equal to 3, this is the reason why I fall in the else case. I assume that the matrix is not diagonal and not triangular, but something else is stored in this dictionary.

  • self.sdj.VALM.get() is a dictionary with only one key (which is 1) and the dimension of the list within is 432900.

  • desc[1] should be the matrix dimension and is equal to 1000, which is not coherent with the vector in the dictionary.

The exact same behaviour is observed in the test case shlv301 (values are different).


  • Since the test case works when the method EXTR_MATR_GENE() is not used, I expect this to be the desired behaviour.

  • How can I extract the assembled matrices for the generalised model?

  • What does desc[2]=3 means?

Last edited by worldsheep (2021-07-07 06:25:35)