MapdlMath#

class ansys.mapdl.core.math.MapdlMath(mapdl)[source]#

Abstract mapdl math class. Created from a Mapdl instance.

Examples

Create an instance.

>>> from ansys.mapdl.core import launch_mapdl
>>> mapdl = launch_mapdl()
>>> mm = mapdl.math

Vector addition

>>> v1 = mm.ones(10)
>>> v2 = mm.ones(10)
>>> v3 = v1 + v2

Matrix multiplcation (not yet available)

>>> v1 = mm.ones(10)
>>> m1 = mm.rand(10, 10)
>>> v2 = m1*v1

Methods

MapdlMath.add(obj1, obj2)

Add two APDLMath vectors or matrices.

MapdlMath.damp([dtype, name, fname, asarray])

Load the damping matrix from the full file.

MapdlMath.dot(vec_a, vec_b)

Dot product between two ANSYS vector objects.

MapdlMath.eigs(nev, k[, m, c, phi, algo, ...])

Solve an eigenproblem.

MapdlMath.factorize(mat[, algo, inplace])

Factorize a matrix.

MapdlMath.free()

Delete all vectors.

MapdlMath.get_vec([dtype, name, fname, ...])

Load a vector from a file.

MapdlMath.load_matrix_from_file([dtype, ...])

Import a matrix from an existing FULL file.

MapdlMath.mass([dtype, name, fname, asarray])

Load the mass matrix from a full file.

MapdlMath.mat([nrow, ncol, dtype, init, ...])

Create an APDLMath matrix.

MapdlMath.matrix(matrix[, name, triu])

Send a scipy matrix or numpy array to MAPDL.

MapdlMath.mgs(mat[, thresh])

Apply Modified Gram-Schmidt algorithm to a matrix.

MapdlMath.norm(obj[, order])

Matrix or vector norm.

MapdlMath.ones(nrow[, ncol, dtype, name, ...])

Create a vector or matrix containing all ones

MapdlMath.rand(nrow[, ncol, dtype, name, ...])

Create a vector or matrix containing all random values

MapdlMath.rhs([dtype, name, fname, asarray])

Return the load vector from a full file.

MapdlMath.set_vec(data[, name])

Push a numpy array or Python list to the MAPDL memory workspace.

MapdlMath.sparse(mat[, thresh])

Sparsify a existing matrix based on a threshold value.

MapdlMath.status()

Print out the status of all APDLMath Objects.

MapdlMath.stiff([dtype, name, fname, asarray])

Load the stiffness matrix from a full file.

MapdlMath.subtract(obj1, obj2)

Subtract two ANSYS vectors or matrices.

MapdlMath.svd(mat[, thresh, sig, v])

Apply an SVD Algorithm on a matrix.

MapdlMath.vec([size, dtype, init, name, asarray])

Create a vector.

MapdlMath.zeros(nrow[, ncol, dtype, name, ...])

Create a vector or matrix containing all zeros.