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

*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

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.3.1.5-cp312-cp312-win_amd64.whl (875.7 kB view details)

Uploaded CPython 3.12Windows x86-64

stemkratoslinearsolversapplication-10.3.1.5-cp312-cp312-manylinux_2_34_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

stemkratoslinearsolversapplication-10.3.1.5-cp311-cp311-win_amd64.whl (874.3 kB view details)

Uploaded CPython 3.11Windows x86-64

stemkratoslinearsolversapplication-10.3.1.5-cp311-cp311-manylinux_2_34_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

stemkratoslinearsolversapplication-10.3.1.5-cp310-cp310-win_amd64.whl (873.9 kB view details)

Uploaded CPython 3.10Windows x86-64

stemkratoslinearsolversapplication-10.3.1.5-cp310-cp310-manylinux_2_34_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

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

File metadata

File hashes

Hashes for stemkratoslinearsolversapplication-10.3.1.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7ce24b514a7012792dd53b0c9b6a6f3aec1fdb8b9a7ce54ba25ec930f4e31f3f
MD5 74ed963f1ea6f0dd44beec9c2786cec0
BLAKE2b-256 70e9e9a9cb351fea27a6b9aecf10775e0705294082dc7191b16a919bed2e85d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stemkratoslinearsolversapplication-10.3.1.5-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 24e33713f5888f337217c2376702a5319f3d7aa1a0cea19031c38be4841648c3
MD5 fb68b9a59edd5b8e367875e998ef2d9f
BLAKE2b-256 2bb0afe930310b5998e325976477472f0fbe3a4a97c638b9c6f0e8bc4707e894

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stemkratoslinearsolversapplication-10.3.1.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 27057161a2a82b922bd1b211204d33743892c0a9ae2542e1f82e29f68740fec9
MD5 425d1bbe7b7c2623fe64f600ffa14949
BLAKE2b-256 731ab2e12f1144b63820e49011d883ef3326897c52c3f17dc6a1309204e3f581

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stemkratoslinearsolversapplication-10.3.1.5-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2365ac3e88cf9a1cbd0db74433f54e3c120870d0ea3bc30df4dd3dae46b81b00
MD5 7e283c509febb7b9a1fd9dd8ffa28e0d
BLAKE2b-256 e46e441ecabe546056ea7a4289a299f8b2e5d81141fb54f0e982488ee838a878

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stemkratoslinearsolversapplication-10.3.1.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 772a4a2206394548da170cbd4d62d51d6d9d19eb63a12acc241e7c652996d1d1
MD5 9816d9d89849e48c5378ad9248f47952
BLAKE2b-256 376705a9572c55ce8bc0ab5c2e594716c92718fc49a8d85329c06d7a73b348a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stemkratoslinearsolversapplication-10.3.1.5-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 503f61b18f00fe7f3d8b71996383281f84ba8e11ecd464c0e7beda8961db0a84
MD5 d297d23e4f3f4ed5efd5d39d4d4636b6
BLAKE2b-256 853a34dd0c903a4fefd6458bdfe073d8831a615923599b0d7c5303c5160eedda

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