Skip to main content

KRATOS Multiphysics ("Kratos") is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.

Project description

@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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

kratoslinearsolversapplication-10.4.3-cp314-cp314-win_amd64.whl (957.3 kB view details)

Uploaded CPython 3.14Windows x86-64

kratoslinearsolversapplication-10.4.3-cp314-cp314-manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

kratoslinearsolversapplication-10.4.3-cp313-cp313-win_amd64.whl (928.4 kB view details)

Uploaded CPython 3.13Windows x86-64

kratoslinearsolversapplication-10.4.3-cp313-cp313-manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

kratoslinearsolversapplication-10.4.3-cp312-cp312-win_amd64.whl (928.5 kB view details)

Uploaded CPython 3.12Windows x86-64

kratoslinearsolversapplication-10.4.3-cp312-cp312-manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

kratoslinearsolversapplication-10.4.3-cp311-cp311-win_amd64.whl (926.6 kB view details)

Uploaded CPython 3.11Windows x86-64

kratoslinearsolversapplication-10.4.3-cp311-cp311-manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

kratoslinearsolversapplication-10.4.3-cp310-cp310-win_amd64.whl (926.3 kB view details)

Uploaded CPython 3.10Windows x86-64

kratoslinearsolversapplication-10.4.3-cp310-cp310-manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

kratoslinearsolversapplication-10.4.3-cp39-cp39-win_amd64.whl (922.0 kB view details)

Uploaded CPython 3.9Windows x86-64

kratoslinearsolversapplication-10.4.3-cp39-cp39-manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

kratoslinearsolversapplication-10.4.3-cp38-cp38-win_amd64.whl (926.4 kB view details)

Uploaded CPython 3.8Windows x86-64

kratoslinearsolversapplication-10.4.3-cp38-cp38-manylinux_2_28_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 dcbfd12ff383d43d5315848098a1a7a6e5984abe386f78a8eb92d0df471fd0cb
MD5 36659acd84c421c2a154dcbf7e8551e9
BLAKE2b-256 11c8ad7f0c5138119faaa60c9ab3fb7a51c2e451bde924ffddb68119d48578d0

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3756250ebead1d2fa12d0a56a81d203119cb1fbcd02ed46d85cb00f45d710199
MD5 fa521d2cb62819504aab6d2ce47bff06
BLAKE2b-256 0353bb1236f95275c370cd24702020ee95c2b315dedf9031eb2d565c52fdac56

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 9ec3e130a59fd736e33329d79d18e3a64e2398781bc801bd5025b9ab83e45369
MD5 0d303a631cb1777a0a52b05f116f3ad7
BLAKE2b-256 be550e9b7a1020d708e322322e86bbc1d89b360a6d5a9ab55cf4e216143a2127

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f30477c40b44b7117b4b1854a7321a9284286d6fa01f0112862781bb56305451
MD5 841721535b80297ba77be8936626d4de
BLAKE2b-256 f51482a2553bf4812ca58a479899a81970439d41e26d7f38cda1b1e8efc80ade

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a68261d87d09271e97de6bf23d4965ff9b36f201487bf96fab2624ec9b741b52
MD5 efc8e8335a2583e4980f371a988fac2d
BLAKE2b-256 d7be987ce4685ddf72c1af016a95b745f11f9c9920be34b1c35b81f1caacf1c0

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2c77bc744e7b760f55892468f0898efe46413faff3bb125d2706d7808b74b86f
MD5 a7f9a62f4fd659c2112cfdcae5d3e8d4
BLAKE2b-256 b1ebcec97e6f2ea1a357b6fde3ca71a68083e6f17209cd4903c36ec0e1536b2a

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c363e924af646e9e8a922f8f0e9c919a61f32088336d6d9c5eef0ed36fd32179
MD5 93c710f85835a55e738f0c8b2b0125fe
BLAKE2b-256 ff41579194937a0034cd3bcc907e382b63404cabcd58cfe111fc655d5083cdb5

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b3bd91daadcc4b46fbeb58428922226be03d205e095442b637ca470d4927b9ff
MD5 cd81efe37e68b1a418543049df6c5028
BLAKE2b-256 2eb6e57bc3700eba0b6fdd4d0a95f51623dae73dc86922b288e0c167785c4d33

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9849c376af4fd825b22a225c06dd42187479ff74aa876f756d61858dff85e7f1
MD5 aa8176d2cf849b335d0662ff08bb4c70
BLAKE2b-256 058f30bcedbebff7553c23e560d8302cd4db64f6cb0dbdb8fe9d7cac26bead72

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9a990bcc8c7659f56c63d8cec94b7bf9e6b0ef4054630c8f4eadd7d283656e6d
MD5 f68277b7bd4f9a5066f2772dc65ac528
BLAKE2b-256 9646097e3463d3af9e955d0514145b16a3d818529e959bfc6d5c75bc6ee71553

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 812a9d938e0d6e747200bda41e13a1ade56912baba8719793096e4127b4b67da
MD5 eb54c65eb6009cc5e89d7ce4bb75bda1
BLAKE2b-256 5d587564ce950a15646c17e0b947d0790e2b4fc8eb66595da40c5138d2174e1c

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d0d4baff7a0ffdebd05bd636384d4b0df0da0f6030874b0c69c2262e1c1e50d4
MD5 d67cd2d0b6ed65e14e878d5447d8d9ad
BLAKE2b-256 3e63bbd0015f755924bb2e341751bd901568d2875785700730186934eb72f83c

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 07c3d6254e0a831f7498b672fc9d61b0717723cf2d32e9459c651868adf7bf9f
MD5 fdb87424b280c9aeb33235bd8711817d
BLAKE2b-256 2c42319f4cb5b2c3b04b642cdf0796d3bc714c68fcdc90502f33716c9b6f938f

See more details on using hashes here.

File details

Details for the file kratoslinearsolversapplication-10.4.3-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for kratoslinearsolversapplication-10.4.3-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a5e1c4554bd445ba783f2fa755e6fa648c05bc7dba3e43fff5fee65965f107dc
MD5 444524334821f4b819b273b66847dbaf
BLAKE2b-256 02aef8c9f5912acc36fb8cc06613a638567a0feaccc31aaeeafd5b0bcbb10fbf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page