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

You are not logged in.

#1 Code_Aster usage » Import MASS and STIFFNESS matrices extracted from Code-Aster in matlab » 2020-11-12 21:03:29

Replies: 1

Hi everyone.
I extracted the mass and stiffness matrix of a structure using in the comm file these instruction

import numpy as np
import scipy.sparse as ss
# vals, lins, cols, dim = M.EXTR_MATR(sparse=True)
mas = ss.csr_matrix(M.EXTR_MATR())
stif = ss.csr_matrix(K.EXTR_MATR())

ss.save_npz("/home/daniele/salome_meca/appli_V2019.0.3_universal/USERS/prova/Mass.npz", mas)
ss.save_npz("/home/daniele/salome_meca/appli_V2019.0.3_universal/USERS/prova/Stiff.npz", stif)

At the end i obtained the compressed file mas and stif containing npy files. How can i rebuild the matrices in matlab?
Thank you to those can help me

#2 Re: Code_Aster usage » Extraction of mass and stiffness matrices » 2020-11-12 20:57:21

Finally it works! I did as you suggested writing DEBUT(PAR_LOT='OUI').
Thank you very much for your help. Now i have to understand how to import the file in matlab i will open another post. Thank you again

#3 Re: Code_Aster usage » Extraction of mass and stiffness matrices » 2020-11-12 15:31:16

And honestly i don't know where the command PAR_LOT='OUI' is used

#4 Re: Code_Aster usage » Extraction of mass and stiffness matrices » 2020-11-12 15:16:53

Thank you very much i will have a look. Before of that message in salome shell i have also this message

# ------------------------------------------------------------------------------------------
/home/daniele/salome_meca/V2019.0.3_universal/tools/Code_aster_stable-v144_smeca/lib/aster/aster_settings.py:262: DeprecationWarning: this command line option is deprecated : --rep_outils
  coreopts.parse_args(argv or sys.argv)
/home/daniele/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)

it can be linked with the error? I use salome meca on ubuntu 20.04

#5 Re: Code_Aster usage » Extraction of mass and stiffness matrices » 2020-11-12 08:32:10

Using the suggestion contained in forum2/viewtopic.php?pid=62625 i have this problem

# ------------------------------------------------------------------------------------------
>> JDC.py: DEBUT CR phase d'initialisation
   ! Erreur dans matr_asse.EXTR_MATR en PAR_LOT='OUI' !
fin CR phase d'initialisation


attached there my comm file. Can someone help me?

Thank a lot

#6 Re: Code_Aster usage » EXTR_MATR Error » 2020-11-12 08:27:28

Hello everyone. I am trying to do the same but I have the same problem if i run this code on salome shell and on interactive mode through salome_meca

#8 Code_Aster usage » Extraction of mass and stiffness matrices » 2020-11-11 15:44:11

Replies: 8

Hello to everyone
i am using code-aster 14.6 and i'd like to know if it is possible to extract the global mass and stiffness matrices in salome-meca because i want to use them in matlab. I look around in the forum but there is not a clear and comprehensive answer. Thanks to those who can help me

#9 Introduce yourself / Présentez vous » Hello » 2020-11-11 15:38:28

Replies: 0

Hello to everyone
I am a researcher from Italy