KratosMultiphysics
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.
|
Kratos Multiphysics uses several components of the Trilinos project for its MPI capabilities. The most relevant of these are the distributed-memory matrix and vector classes from the Epetra module and the linear solvers provided by the AztecOO, Amesos and ML packages. In addition, it also contains the MPI version of the AMGCL solver.
TrilinosLinearSolver
AztecSolver
AmesosSolver
Amesos2Solver
MultiLevelSolver
AMGCL Mpi-based Solver
The Trilinos application also provides MPI versions of most of the core classes of Kratos, adapted to work with Epetra distributed matrices where necessary. Hence it provide its own version of the following Kratos classes:
TrilinosResidualBasedBuilderAndSolver
TrilinosEliminationBuilderAndSolver
TrilinosBlockBuilderAndSolver
TrilinosBlockBuilderAndSolverPeriodic
TrilinosDisplacementCriteria
TrilinosResidualCriteria
TrilinosAndCriteria
TrilinosOrCriteria
TrilinosMixedGenericCriteria
TrilinosSolvingStrategy
TrilinosLinearStrategy
TrilinosNewtonRaphsonStrategy
For more information about these please refer to their serial version (without Trilinos prefix) in the main Kratos documentation.
Building the TrilinosApplication
requires the Trilinos libraries and their dependencies already installed on the system.
The easiest way to get them is by the package manager of the GNU/Linux distribution. For example, in Ubuntu GNU/Linux:
However, there may be situations where downloading the packages may not be possible.
In this case, other (potentially trickier) option is to download the source code and build the libraries. For more detailed and updated instructions for compiling Trilinos and other necessary packages, refer to Compiling Kratos with MPI support, in the wiki.
Assuming that the dependencies are installed, the following steps are:
TrilinosApplication
to the list of applications to be compiled in the building script for Kratos, as described in the install instructions.TRILINOS_ROOT
variable to the build directory. For example:Or, if Trilinos is installed with a package manager, then libraries and headers may be in different locations. Moreover, the name of the libraries may not be standard. In this case, instead of setting TRILINOS_ROOT
, set -DTRILINOS_INCLUDE_DIR=String
with the path to the include dir, -DTRILINOS_LIBRARY_DIR=String
with the path to the library dir, and set -DTRILINOS_LIBRARY_PREFIX=String
with the prefix to use when looking for the Trilinos libraries, i.e.,
For example, in the case of Ubuntu with Trilinos installed by sudo apt install trilinos-all-dev
:
Notes:
-*Trilinos* is a large project and not all of its packages are being used in Kratos. Check the docker of the CI to see which packages are necessary in order to compile the TrilinosApplication.
At the moment, the list of required packages is:
-It is possible to do a minimal installation of the TrilinosApplication only using the Epetra package. Other packages can be disabled with the following flags:
Spack is a multi-platform package manager that builds and installs multiple versions and configurations of software. It works on GNU/Linux, macOS, and many supercomputers. Spack is non-destructive: installing a new version of a package does not break existing installations, so many configurations of the same package can coexist.
To install Spack you just need to run the following command:
To use it you will need to add the corresponding environment variables (or call spack_location/spack/bin/spack
):
Then in order to install Trilinos:
In case we want to use MUMPS and SuperLUDist with Trilinos, you can install them all together and properly liked with:
If you want that the libraries are added automatically to LD_LIBRARY_PATH
to run the following commands before loading the modules:
Now you just need to load Trilinos:
or (if installed):
Once to compile TrilinosApplication
just remember to add the application to the configure
bash script: