Element Matrix Class#

class ansys.mapdl.reader.emat.EmatFile(filename)

Enables pythonic access to an ANSYS element matrix file.

Parameters:

filename (str, pathlib.Path) – File to open. Generally ends in *.emat.

Examples

>>> from ansys.mapdl import reader as pymapdl_reader
>>> emat_file = pymapdl_reader.read_binary('file.emat')
property eeqv

Element equivalence table. This table equates the number used for storage to the actual element number.

Notes

The ANSYS program stores all element data in the numerical order that the SOLUTION processor solves the elements. This table equates the order number used to the actual element.

property element_matrices_index_table

Return element matrices index table

property enum

Sorted ANSYS element numbers

property filename

String form of the filename. This property is read-only.

global_applied_force()

Returns the applied force for each node.

Returns:

applied_force – Applied force with size (n_nodes, n_dof). Result is sorted to correspond with the sorted global nodes array.

Return type:

np.ndarray

property n_dof

Number of dofs per node

property n_elements

Number of elements in the file

property n_nodes

Number of nodes in the file

property neqv

Nodal equivalence table. This table equates the number used for storage to the actual node number.

property nnum

Sorted ANSYS node numbers

property pathlib_filename

Return the pathlib.Path version of the filename. This property can not be set.

read_element(index, stress=True, mass=True, damping=True, stress_stiff=True, applied_force=True, newton_raphson=True, imaginary_load=True)

Read element by index

Parameters:
  • index (int) – Element index. This is not the element number. Reference the element equivalency table for the actual element number.

  • stress (bool, optional) – Return the stress matrix entries if available.

  • mass (bool, optional) – Return the mass matrix entries if available.

  • damping (bool, optional) – Return the damping matrix entries if available.

  • stress_stiff (bool, optional) – Return the stress stiffening entries if available.

  • newton_raphson (bool, optional) – Return the newton raphson load entries if available.

  • applied_force (bool, optional) – Return the applied load vector if available.

  • imaginary_load (bool, optional) – Return the imaginary load vector if available.

Returns:

  • dof_idx (np.ndarray) – DOF index table. This record specifies the DOF locations of this element matrix in relation to the global matrix. The index is calculated as (N-1)*NUMDOF+DOF, where N is the position number of the node in the nodal equivalence table and DOF is the DOF reference number given above

  • element_data (dict) – Dictionary containing the following entries for each of the corresponding inputs when the item is True. - ‘stress’ : stress matrix entries - ‘mass’ : mass matrix entries - ‘damping’ : damping matrix entries - ‘stress_stiff’ : stress stiffening matrix entries - ‘newton_raphson’ : newton rapson load vector - ‘applied_force’ : applied force vector - ‘imaginary_load’ : imaginary load vector

Notes

If the matrix is diagonal, the length of the records will be nmrow. If the matrix is unsymmetric, the length of the records will be nmrow*nmrow. If the matrix is symmetric, only the lower triangular terms are written and the length of the records will be (nmrow)*(nmrow+1)/2

Records are written relative to the dof_idx. The index is calculated as (N-1)*NUMDOF+DOF, where N is the position number of the node in the nodal equivalence table and DOF is the DOF reference number given by dof_idx.

read_element_matrix_header(f_index)

Read element matrix header

Parameters:

f_indes (int) – Fortran index to the start of the element matrix header.

Notes

stkey - stiffness matrix key

0 - matrix not present 1 - matrix present

mkey - mass matrix key

0 - matrix not present 1 - matrix present

dkey - damping matrix key

0 - matrix not present 1 - matrix present

sskey - stress stiffening matrix key

0 - matrix not present 1 - matrix present

akey - applied load vector key

0 - vector not used 1 - vector used

nrkey - newton-raphson(restoring) load

0 - vector not used 1 - vector used

ikey - imaginary load vector key (for complex analyses)

0 - vector not used 1 - vector used

nmrow - numbers/columns in matrices.

If the number is negative, the matrices will be written in lower triangular form.

read_header()

Read standard emat file header