ansys.mapdl.core.Mapdl.merge#

Mapdl.merge(name1='', name2='', val1='', val2='', **kwargs)#

Merges two dense matrices or vectors into one.

Mechanical APDL Command: *MERGE

Parameters:
name1str

Name of the matrix or vector to extend.

name2str

Name of the matrix or vector to be merged into Name1.

val1str

Row number indicating where the new values are to be inserted into the Name1 vector.

val2str

Specifies how the Name2 matrix or vector is copied into the Name1 matrix.

  • COL - Insert the new values at the column location specified by Val1 (default).

  • ROW - Insert the new values at the row location specified by Val1.

Notes

Warning

This function contains specificities regarding the argument definitions. Please refer to the command documentation for further explanations.

Argument Descriptions

  • name1 : str - Name of the matrix or vector to extend.

  • name2 : str - Name of the matrix or vector to be merged into Name1.

  • val1, val2 : str - Additional input. The meaning of Val1 and Val2 varies depending on the entity type (matrix or vector). See details below.

The following Val1 and Val2 fields are used if Name1 refers to a dense matrix created by the dmat command:

  • val1 : str - Column or row number indicating where the new values are to be inserted into the Name1 matrix.

  • val2 : str - Specifies how the Name2 matrix or vector is copied into the Name1 matrix.

    • COL - Insert the new values at the column location specified by Val1 (default).

    • ROW - Insert the new values at the row location specified by Val1.

The following Val1 field is used if Name1 refers to a vector created by the vec command:

  • val1 : str - Row number indicating where the new values are to be inserted into the Name1 vector.

merge can be used to add new columns or rows to a dense matrix that was created by the dmat command. In this case, Name1 must be the name of the dense matrix and Name2 must refer to a vector or another dense matrix.

The following two examples demonstrate merging columns into a dense matrix.

The following example demonstrates merging rows into a dense matrix.

merge can also be used to add new rows to a vector that was created by the vec command. In this case, Name1 and Name2 must both refer to vectors, as demonstrated in the example below.

In all cases, the values of the original matrix or vector are retained, and the matrix or vector is resized to accommodate the additional rows or columns.