# Fast Computatio​n of Isotropic Gradients with Jacket’s Convolutions

Researchers from the École Polytechnique de Montréal showed that Jacket is very efficient to rapidly calculate 2D or 3D isotropic gradients in MATLAB® code. From a mathematical point of view, the isotropic gradients are characterized by their very precise orientation compared to the standard 1D finite difference discretizations. Using convolution functions developed by AccelerEyes, the method becomes very simple to apply and provides a very fast evaluation of isotropic gradients of functions or images.

This type of isotropic discretization currently has an application in computational fluid dynamics. They are useful for simulating immiscible multiphase flows using the Lattice Boltzmann Method (LBM), where the orientation of the various fluid interfaces has to be computed very frequently and precisely. In multiphase flow simulation using LBM, calculation of a high order isotropic gradient is the most expensive part of the method, and the use of Jacket, has enabled the researchers to reduce the computational cost by an astonishing amount. The researchers from École Polytechnique believe that isotropic gradients could also be useful in other scientific fields.

The summary of the method with MATLAB examples is presented in the free to download book “MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 3” [1]. A direct link to the book chapter published by InTech is also given below [2]. In particular, the kernels required to perform the convolution are explicitly given in MATLAB m-code. It is therefore easier to reproduce some of the results.

The following figures illustrate the relative speedup to evaluate isotropic gradients of  2D and 3D images using an Nvidia GTX-580 compared to the singlethread MATLAB CPU version (Intel Core-i7 970). The examples have shown gains of 40x to 120x in 2D and 3D respectively!

Speedup with the 14th order 2D isotropic gradient.

Speedup with the 8th order 3D isotropic gradient.

[1] Sébastien Leclaire, Maud El-Hachem and Marcelo Reggio (2012). Convolution Kernel for Fast CPU/GPU Computation of 2D/3D Isotropic Gradients on a Square/Cubic Lattice, MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 3, Vasilios N. Katsikis (Ed.), ISBN: 978-953-51-0752-1, InTech.

[2] Convolution Kernel for Fast CPU/GPU Computation of 2D/3D Isotropic Gradients on a Square/Cubic Lattice