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

You are not logged in.

#1 2021-11-03 19:05:40

Cloud10
Member
Registered: 2016-04-01
Posts: 3

ASSEMBLAGE and EXTR_MAT order of coordinate nodes

Hi,
I am trying to save stiffness and mass matrices before a modal analysis to perform operations of coordinate reduction (like Craig-Bampton) and then compute equivalent mass and stiffness properties of the free body (no loads or constraints). I use the following code to assemble and save the matrices:

ASSEMBLAGE(
CHAM_MATER=fieldmat,
MATR_ASSE=(_F(MATRICE=CO('m_free'),
OPTION='MASS_MECA'),
_F(MATRICE=CO('k_free'),
OPTION='RIGI_MECA')),
MODELE=model,
NUME_DDL=CO('ndllfree'))

import scipy.sparse as ss
mass = ss.csr_matrix(m_free.EXTR_MATR())
stiff = ss.csr_matrix(k_free.EXTR_MATR())

ss.save_npz("./Mass.npz", mass)
ss.save_npz("./Stiff.npz", stiff)

In an external python file, I load the matrices and the MED file containing the mesh, where I defined some groups of nodes by which I need to perform slices and reductions. As I get wrong results, I am wondering if the order of the nodes/coordinates in the matrices and in the original mesh are the same. I have some questions:
- how can I check if the order of the coordinate points in the mesh file and the M,K matrices are the same?
- is it correct that in the matrix the order of rows and columns is Point1_X, Point1_Y, Point1_Z, Point2_X, Point2_Y ....?
- how are NUME_DDL and its name used?
- is there a way to save geometric information (like point coordinates) together with the mass and stiffness matrices?

Thank you
Claudio

Offline