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.

stemkratoslinearsolversapplication-10.4.0.3-cp312-cp312-win_amd64.whl (938.2 kB view details)

Uploaded CPython 3.12Windows x86-64

stemkratoslinearsolversapplication-10.4.0.3-cp312-cp312-manylinux_2_34_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

stemkratoslinearsolversapplication-10.4.0.3-cp311-cp311-win_amd64.whl (936.1 kB view details)

Uploaded CPython 3.11Windows x86-64

stemkratoslinearsolversapplication-10.4.0.3-cp311-cp311-manylinux_2_34_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

stemkratoslinearsolversapplication-10.4.0.3-cp310-cp310-win_amd64.whl (935.5 kB view details)

Uploaded CPython 3.10Windows x86-64

stemkratoslinearsolversapplication-10.4.0.3-cp310-cp310-manylinux_2_34_x86_64.whl (2.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

Details for the file stemkratoslinearsolversapplication-10.4.0.3-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for stemkratoslinearsolversapplication-10.4.0.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d58817c4cbad02de057bcb78cfdf05ca071736f0cfe90a06e221359696596fdf
MD5 95223cc5bdcd9e828d83a9b122e6fbd2
BLAKE2b-256 4a6e8ef0ae92a2d7b5376e7d2041fe18b4611bfd82cc6e7f7f4fb1e2a5e1bc12

See more details on using hashes here.

File details

Details for the file stemkratoslinearsolversapplication-10.4.0.3-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for stemkratoslinearsolversapplication-10.4.0.3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 23838fb2bc98bcd62319fa690c8dcbd3d8d60396c34d93ac37be819cdbcd9e9c
MD5 058aaf6a397a78b1bdfe40f8ae04b1a0
BLAKE2b-256 4d12e146b22d0285cd2b77200128f762944f044002c59334674836cce84175e4

See more details on using hashes here.

File details

Details for the file stemkratoslinearsolversapplication-10.4.0.3-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for stemkratoslinearsolversapplication-10.4.0.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1647d66643a67bae3dc27bd5c168722b1a4cbafbf7cd9653a39513e6786b59d6
MD5 7ad07b3ae6c1e8edbedb60abac610b95
BLAKE2b-256 a2b9bac8a8464c60108138ec59f1dbbf6257cebd3c9adca693ad9589bc4f59ab

See more details on using hashes here.

File details

Details for the file stemkratoslinearsolversapplication-10.4.0.3-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for stemkratoslinearsolversapplication-10.4.0.3-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1b96c3e5273ef621124a003385b2ffe5cd9c6d5e09cc9bdf0213ac6abac61532
MD5 0dae77b6d5a3152c8dd006625cc2125a
BLAKE2b-256 01fb9bcc54441391a573e8e518f362009ce3b91361ef40bafe128a58e68a8a58

See more details on using hashes here.

File details

Details for the file stemkratoslinearsolversapplication-10.4.0.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for stemkratoslinearsolversapplication-10.4.0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 896893f5148648f7d8182803c93716a65f3abe541100cbb887bb3aad29d7f894
MD5 0e9fb521484ba02ddce10fc87ad81b33
BLAKE2b-256 5ef45e15c09d1be5a32d658ba99eaed260fef7b94bb1f93251ea6cb33f3456d0

See more details on using hashes here.

File details

Details for the file stemkratoslinearsolversapplication-10.4.0.3-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for stemkratoslinearsolversapplication-10.4.0.3-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 cd23c9f35a0ef36984fea446fa28eb10d89726d75c97ed4fc765a64ff5a5e5b8
MD5 fdabc2faf67c712efa7187e576a0c0ad
BLAKE2b-256 7a87a43dc5d02e7511846b2f1dd6a8d40142d4037dae42f2f6cbc6dff69fae59

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