Eikonal CUDA implementation for the Advanced Methods for Scientific Computing (AMSC) Course @Polimi
Students:
An Eikonal equation is a non-linear first-order partial differential equation
that is encountered in problems of wave propagation.
An Eikonal equation is one of the form:
where
-
$d$ is the dimension of the problem, either 2 or 3; -
$u$ is the eikonal function, representing the travel time of a wave; -
$\nabla u(x)$ is the gradient of$u$ , a vector that points in the direction of the wavefront; -
$H$ is the Hamiltonian, which is a function of the spatial coordinates$x$ and the gradient$\nabla u$ ; -
$\Gamma$ is a set smooth boundary conditions.
In most cases,
In the simplest cases,
where
The project is a CUDA library designed for computing the Eikonal equation based on the FIM algorithm on 3D unstructured tetrahedrical meshes. It is designed to be highly extensible, and easy to integrate in different applications.
This repository contains a main component, src
, which is a library for the computation of the numerical solution of the Eikonal equation described in the introduction paragraph. The library contains:
Mesh
which is a class that represents a mesh in 3D.LocalSolver
which is a class responsable for the resolution of the local problem.Solver
which is the implementation of the CUDA solver. For more details, always refer to the documentation.
The repo also contains an utility component, test
, which contains a test case and some input meshes.
After cloning the repo with the command
git clone https://github.com/AMSC22-23/Eikonal-Cuda-Cesaroni-Tonarelli-Trabacchin.git
,
the installation of METIS and GKlib software is required. To install them, access the repo and run the following:
$ ./install_dependences.sh
Moreover, Eigen should be already installed, and its location should be provided when configuring the project. If no location is provided, a default one will be attempted. Then, to build the executable, from the root folder run the following commands:
$ mkdir build
$ cd build
$ cmake .. -DEIGEN_DIR=<EigenLocation>
$ make
An executable for the test will be created into /build
, and can be executed through:
$ ./eikonal input-filename num-partitions output-filename
where:
input-filename
is the input file path where the mesh will be retrieved. The program only accepts file in vtk format.num-partitions
is the number of partitions dividing the domain.output-filename
is the name of the output file. The file will be located in the foldertest/meshes/output_meshes
.
However, these are only examples. To fully exploit our library, it should be directly used in code to access further features, such as the possibility to modify the velocity matrix and the boundary conditions (which in our example are defaulted respectively to the identity matrix and the vertex nearest to the origin).
We provide test meshes at this link.
One example is:
$ ./eikonal ../test/meshes/input_meshes/cube-5.vtk 4 output-cube5
will execute the algorithm on a cubic test model and will save the output into the file output-cube5
.
Performance analysis and results can be found in the documentation.