Skip to main content

@anchor LinearSolversApplicationMainPage

LinearSolversApplication

The LinearSolversApplication is a thin wrapper for the Eigen linear algebra library.

Direct sparse solvers

The application provides the following direct sparse solvers:

Python class solver_type Matrix kind Domain Dependencies
SparseLUSolver sparse_lu Square Real None
SparseQRSolver sparse_qr Rectangular Real None
SparseCGSolver sparse_cg SPD* Real None
PardisoLLTSolver pardiso_llt SPD* Real Intel® MKL
PardisoLDLTSolver pardiso_ldlt SPD* Real Intel® MKL
PardisoLUSolver pardiso_lu Square Real Intel® MKL
ComplexSparseLUSolver sparse_lu_complex Square Complex None
ComplexPardisoLLTSolver pardiso_llt_complex SPD* Complex Intel® MKL
ComplexPardisoLDLTSolver pardiso_ldlt_complex SPD* Complex Intel® MKL
ComplexPardisoLUSolver pardiso_lu_complex Square Complex Intel® MKL
CholmodSolver cholmod SPD* Real SuiteSparse
UmfPackSolver umfpack Square Real SuiteSparse
ComplexUmfPackSolver umfpack_complex Square Complex SuiteSparse
SPQRSolver spqr Rectangular Real SuiteSparse
ComplexSPQRSolver spqr_complex Rectangular Complex SuiteSparse

*SPD = Symmetric Positive Definite

Example:

{
    "solver_type": "eigen_sparse_lu"
}

Direct dense solvers

The application provides the following direct solvers for dense systems of equations:

Python class solver_type Matrix requirements Domain Dependencies
DenseColPivHouseholderQRSolver** dense_col_piv_householder_qr None Real None
DenseHouseholderQRSolver** dense_householder_qr None Real None
DenseLLTSolver** dense_llt SPD* Real None
DensePartialPivLUSolver** dense_partial_piv_lu Invertible Real None
ComplexDenseColPivHouseholderQRSolver complex_dense_col_piv_householder_qr None Complex None
ComplexDenseHouseholderQRSolver complex_dense_householder_qr None Complex None
ComplexDensePartialPivLUSolver complex_dense_partial_piv_lu Invertible Complex None

*SPD = Symmetric Positive Definite

**Can also be used to solve equation systems with multiple right hand sides.

Generalized eigensystem solvers

The application provides the following generalized eigensystem Ax=λBx solver for sparse matrices.

Python class solver_type Matrix kind A Matrix kind B Domain Dependencies
EigensystemSolver eigen_eigensystem Symmetric SPD* Real None
SpectraSymGEigsShiftSolver spectra_sym_g_eigs_shift Symmetric SPD* Real None
FEASTGeneralEigensystemSolver** feast General General Real Intel® MKL
ComplexFEASTGeneralEigensystemSolver** feast_complex General General Complex Intel® MKL

*SPD = Symmetric Positive Definite **A special version for symmetric matrices can be triggered in the solver settings.

EigensystemSolver and SpectraSymGEigsShiftSolver compute the smallest eigenvalues and corresponding eigenvectors of the system. MKL routines are used automatically if they are available.

SpectraSymGEigsShiftSolver interfaces a solver from the Spectra library, and has a shift mode that can be used to compute the smallest eigenvalues > shift.

Example:

{
    "solver_type": "spectra_sym_g_eigs_shift",
    "number_of_eigenvalues": 3,
    "max_iteration": 1000,
    "echo_level": 1
}

If the application is compiled with MKL, FEAST 4.0 can be used to solve the generalized eigenvalue problem for real and complex systems (symmetric or unsymmetric). The cmake switch USE_EIGEN_FEAST must be set to ON with

-DUSE_EIGEN_FEAST=ON \

Example:

{
    "solver_type": "feast",
    "symmetric": true,
    "number_of_eigenvalues": 3,
    "search_lowest_eigenvalues": true,
    "e_min" : 0.0,
    "e_max" : 0.2
}

Build instructions

  1. Set the required definitions for cmake

    As any other app:

    Windows: in configure.bat

    set KRATOS_APPLICATIONS=%KRATOS_APPLICATIONS%%KRATOS_APP_DIR%\LinearSolversApplication;
    

    Linux: in configure.sh

    add_app ${KRATOS_APP_DIR}/LinearSolversApplication
    
  2. Build Kratos

  3. Setup the ProjectParameters.json

    "linear_solver_settings": {
        "solver_type" : "LinearSolversApplication.sparse_lu"
    }
    
  4. Run the simulation

Enable MKL (optional)

In case you have installed MKL (see below), you can also use the Pardiso solvers.

  1. Run the MKL setup script before building Kratos:

    Windows:

    call "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\env\vars.bat" intel64 lp64
    

    Linux:

    source /opt/intel/oneapi/setvars.sh intel64
    
  2. Add the following flag to CMake to your configure script:

    Windows:

    -DUSE_EIGEN_MKL=ON ^
    

    Linux:

    -DUSE_EIGEN_MKL=ON \
    
  3. Build Kratos

  4. Usage:

    Windows:

    call "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\env\vars.bat" intel64 lp64
    

    Linux:

    Set the environment before using MKL

    source /opt/intel/oneapi/setvars.sh intel64
    

Install MKL on Ubuntu with apt

Intel MKL can be installed with apt on Ubuntu. A guide can be found in here. For example to install the MKL 2022 version

sudo bash
# <type your user password when prompted.  this will put you in a root shell>
# If they are not installed, you can install using the following command:
sudo apt update
sudo apt -y install cmake pkg-config build-essential
# use wget to fetch the Intel repository public key
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
# add to your apt sources keyring so that archives signed with this key will be trusted.
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
# remove the public key
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
# Configure apt client to use Intel repository
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
# Install all MKL related dependencies. You can install full HPC with: sudo apt install intel-hpckit
sudo apt install intel-oneapi-mkl-devel
# Exit
exit

To enable the MKL environment (needs to be done before build/run) use

source /opt/intel/oneapi/setvars.sh intel64

Enable SuiteSparse (optional)

SuiteSparse is a collection of open-source sparse matrix algorithms, including efficient implementations of various factorizations. Kratos currently provides wrappers for CHOLMOD, UMFPACK, and SPQR.

Install the SuiteSparse package on your system, and set the USE_EIGEN_SUITESPARSE flag in your CMake configuration to ON. One way of doing this is appending the list of arguments you pass to CMake in your configure script with:

-DUSE_EIGEN_SUITESPARSE:BOOL=ON

Installing SuiteSparse

  • Arch Linux

    • SuiteSparse is available through your package manager.
    • sudo pacman -S suitesparse
  • Debian (and derivatives, including Ubuntu)

    • SuiteSparse is available through your package manager.
    • sudo apt install libsuitesparse-dev
  • Fedora (and derivatives, including RHEL)

    • SuiteSparse is available through your package manager.
    • sudo dnf install suitesparse-devel
  • MacOS

    • SuiteSparse is available on Homebrew for both Intel and Apple Silicon machines.
    • brew install suite-sparse
  • Windows

    • SuiteSparse is available through vcpkg and MSYS2 package managers.
    • vcpkg install suitesparse suitesparse-spqr suitesparse-umfpack (remember to add to build script -DCMAKE_TOOLCHAIN_FILE="vcpkg_path\vcpkg\scripts\buildsystems\vcpkg.cmake")
    • pacman -S mingw-w64-x86_64-suitesparse

Metadata

Release files for stemkratoslinearsolversapplication 10.4.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for stemkratoslinearsolversapplication 10.4.0.4
File Actions
stemkratoslinearsolversapplication-10.4.0.4-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for stemkratoslinearsolversapplication-10.4.0.4-cp314-cp314-win_amd64.whl
stemkratoslinearsolversapplication-10.4.0.4-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details for stemkratoslinearsolversapplication-10.4.0.4-cp314-cp314-manylinux_2_34_x86_64.whl
stemkratoslinearsolversapplication-10.4.0.4-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for stemkratoslinearsolversapplication-10.4.0.4-cp313-cp313-win_amd64.whl
stemkratoslinearsolversapplication-10.4.0.4-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details for stemkratoslinearsolversapplication-10.4.0.4-cp313-cp313-manylinux_2_34_x86_64.whl
stemkratoslinearsolversapplication-10.4.0.4-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for stemkratoslinearsolversapplication-10.4.0.4-cp312-cp312-win_amd64.whl
stemkratoslinearsolversapplication-10.4.0.4-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details for stemkratoslinearsolversapplication-10.4.0.4-cp312-cp312-manylinux_2_34_x86_64.whl

Total release size: 11.7 MB

Release files / stemkratoslinearsolversapplication-10.4.0.4-cp314-cp314-win_amd64.whl

Download URL stemkratoslinearsolversapplication-10.4.0.4-cp314-cp314-win_amd64.whl
Size 965.5 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
549684d93dea51822eec4eb066faa3523915c2db7ede742fb2d8b18a977888e5
BLAKE2b-256 checksum
How to use checksums
b0d8dc2d000a8f21415e7ac07a4676e85729a281abfb9278431d079546ec9102
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / stemkratoslinearsolversapplication-10.4.0.4-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL stemkratoslinearsolversapplication-10.4.0.4-cp314-cp314-manylinux_2_34_x86_64.whl
Size 3.0 MB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
057c65ec2266c0131b52d25c31b8a43d254ea0393332e496d6ac85423fc5e9a5
BLAKE2b-256 checksum
How to use checksums
b7764f50543782ec47a6db05046002c7f97c0639c69d7d441eeb4254fa4f1902
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / stemkratoslinearsolversapplication-10.4.0.4-cp313-cp313-win_amd64.whl

Download URL stemkratoslinearsolversapplication-10.4.0.4-cp313-cp313-win_amd64.whl
Size 938.2 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
434cdab4733903f658c3121d843dc47fab20570862d17117f24a100cf18df417
BLAKE2b-256 checksum
How to use checksums
41a1839399cee917a10d793c8dfae11ac8d3b89ce0eaf175ea039f7edef1f150
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / stemkratoslinearsolversapplication-10.4.0.4-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL stemkratoslinearsolversapplication-10.4.0.4-cp313-cp313-manylinux_2_34_x86_64.whl
Size 2.9 MB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
5308831d72bb1e1acbc3381ce04c9743f1d40067c4691129bc55a5470eac4f56
BLAKE2b-256 checksum
How to use checksums
76d74860495ab9e23f4e9acdb5d80b9485948951afa032679e50e11abec0f24f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / stemkratoslinearsolversapplication-10.4.0.4-cp312-cp312-win_amd64.whl

Download URL stemkratoslinearsolversapplication-10.4.0.4-cp312-cp312-win_amd64.whl
Size 938.2 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
d21af7fd747cf4a9bfdf84c80b8b7e231585bd872b6137df639c69c3e7037d00
BLAKE2b-256 checksum
How to use checksums
930980802c9eb18628d08b3b6d52e0ae5010f859f6a642b57c163af5b11fcd08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / stemkratoslinearsolversapplication-10.4.0.4-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL stemkratoslinearsolversapplication-10.4.0.4-cp312-cp312-manylinux_2_34_x86_64.whl
Size 3.0 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
f48a3892a4c204dd2244a53e7bfeda449b0186f2256d5d8f0f0550126c9ffb6b
BLAKE2b-256 checksum
How to use checksums
8d8ed3a3d4206ea5aba5ffe9f7d0d6746aa69618d3a45c488e24bad410f708fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for stemkratoslinearsolversapplication 10.4.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page