AnsMath#

class ansys.math.core.math.AnsMath(mapdl=None, **kwargs)#

Provides the common class for abstract math objects.

Examples

Create an instance.

>>> import ansys.math.core.math as pymath
>>> mm = pymath.AnsMath()

Add vectors.

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

Multiply matrices (not yet available).

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

Methods

AnsMath.add(obj1, obj2)

Add two AnsMath vectors or matrices.

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

Load the damping matrix from a FULL file.

AnsMath.dot(vec_a, vec_b)

Multiply two AnsMath vectors.

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

Solve an eigenproblem.

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

Factorize a matrix.

AnsMath.free([mat])

Delete AnsMath objects.

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

Load a vector from a FULL file.

AnsMath.load_matrix_from_file([dtype, name, ...])

Import a matrix from an existing FULL file.

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

Load the mass matrix from a FULL file.

AnsMath.mat([nrow, ncol, dtype, init, name, ...])

Create a matrix.

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

Send a SciPy matrix or NumPy array to MAPDL.

AnsMath.mgs(mat[, thresh])

Apply the Modified Gram-Schmidt (MGS) algorithm to a matrix.

AnsMath.norm(obj[, order])

Return the norm of an AnsMath object.

AnsMath.ones(nrow[, ncol, dtype, name, asarray])

Create a vector or a matrix where all values are ones.

AnsMath.rand(nrow[, ncol, dtype, name, asarray])

Create a vector or a matrix where all values are random.

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

Return the load vector from a FULL file.

AnsMath.set_vec(data[, name])

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

AnsMath.sparse(mat[, thresh])

Sparsify an existing matrix based on a threshold value.

AnsMath.status()

Print the status of all AnsMath objects.

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

Load the stiffness matrix from a FULL file.

AnsMath.subtract(obj1, obj2)

Subtract two AnsMath vectors or matrices.

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

Apply an SVD algorithm on a matrix.

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

Create a vector.

AnsMath.zeros(nrow[, ncol, dtype, name, asarray])

Create a vector or a matrix where all values are zeros.