README.md
1
2# gsElasticity
3gsElasticity is a **submodule of G+Smo** which has started as a collection of nonlinear elasticity solvers for 2D and 3D solids. Since then, its focus has shifted towards mesh deformation, and now gsElasticity contains isogeometric solvers for nonlinear elasticity and incompressible Navier-Stokes equations, various PDE-based mesh deformations algorithms and a partitioned fluid-structure interaction solver. Additionally, gsElasticity includes numerous application examples and the corresponding NURBS geometries.
4
5------------------ Nonlinear elastic deformation of a 3D object ----------------------------------------------------
6
7<img src="https://raw.githubusercontent.com/gismo/gsElasticity/media/images/terrific.png" width="500">
8
9------------------ Active muscle behavior ----------------------------------------------------
10
11<img src="https://raw.githubusercontent.com/gismo/gsElasticity/media/images/muscle.png" width="600">
12
13------------------ Fluid-structure interaction in 2D ---------------------------------------------------------------
14
15<img src="https://raw.githubusercontent.com/gismo/gsElasticity/media/images/FSI.png" width="450">
16
17------------------ Mesh deformation for isogeometric domain parametrization -----------------------------------------
18
19<img src="https://raw.githubusercontent.com/gismo/gsElasticity/media/images/meshDeform.png" width="550">
20
21## Solvers
22gsElasticity currently includes the following solvers for 2D and 3D multi-patch tensor-product NURBS geometries:
23* Elasticity solvers
24 * linear elasticity
25 * nonlinear elasticity with St.Venant-Kirchhoff and neo-Hookean material laws
26 * implicit time integration with Newmark method
27 * pure displacement and mixed displacement-pressure formulations
28 * thermal expansion
29 * active muscle behavior
30* Incompressible Navier-Stokes solver
31 * Stokes equation
32 * stationary INSE
33 * explicit and implicit time integration with the one-step theta-scheme
34 * suitable for arbitrary Lagrangian-Eulerian (ALE) mappings
35 * ~~SUPG stabilization~~
36 * ~~turbulence model~~
37* Fluid-structure interaction solver
38 * partitioned approach
39 * strong coupling
40 * Aitken relaxation for convergence speed-up
41* Bi-harmonic equation solver in mixed formulation
42* Poisson's equation solver
43
44## Installation
45Since gsElasticity is a submodule of G+Smo, you should download G+Smo first:
46```
47git clone https://github.com/gismo/gismo.git
48```
49Then, configure G+Smo with `GISMO_ELASTICITY=ON`:
50```
51cd gismo
52mkdir build
53cd build
54cmake .. -DGISMO_ELASTICITY=ON
55```
56This will trigger a download of gsElasticity from GitHub. Once gsElasticity is downloaded, you can compile G+Smo with gsElasticity:
57```
58make
59```
60Once complete, you can find the compiled library in `/path/to/gismo/build/lib` and examples in `/path/to/gismo/build/bin`.
61
62#### Advanced installation
63gsElasticity is an independent .git repository. By default, the procedure described above downloads the version of gsElasticity __that is linked to G+Smo__. Usually, it is the latest stable version. However, if you want to get other versions/branches of gsElastisity, or even contribute to it, you should access gsElasticity via its .git repository located in `/path/to/gismo/extenstions/gsElasticity`. For example, to get the latest version of gsElasticity, do
64```
65cd /path/to/gismo/extenstion/gsElasticity
66git pull
67```
68
69Simulation of time-dependent processes can be rather computationally costly. Although G+Smo and gsElasticity are not suitable for distributed computing, you can achieve significant speed-up by using it with multi-theading on your desktop or laptop. To that end, you should install OpenMP library https://www.geeksforgeeks.org/openmp-introduction-with-installation-guide/. Once you have OpenMP, configure G+Smo with `GISMO_WITH_OPENMP=ON`:
70```
71cd /path/to/gismo/build
72cmake .. -DGISMO_ELASTICITY=ON -DGISMO_WITH_OPENMP=ON
73```
74By defining the environmental variable `OMP_NUM_THREADS`, you can choose how many threads your application is going to use
75```
76export OMP_NUM_THREADS=<number of threads to use>
77```
78With OpenMP included, at least the linear system assebmly is parallelized. This is a big deal in IGA since the high continuity of NURBS inceases the support of each basis function, which in turn increases the number of function evaluations necessary for matrix assembly. However, G+Smo uses Eigen library http://eigen.tuxfamily.org/index.php?title=Main_Page as a linear algebra backend, and linear system solvers in Eigen tend to be pretty slow. Luckily, there is a way to significantly speed up your applications - get Pardiso solver https://www.pardiso-project.org/ and compile G+Smo with it included!
79
80There are two options to get Pardiso - either as a stand-alone library from the official page https://www.pardiso-project.org/#download, or as a part of Intel MKL https://software.intel.com/en-us/mkl. The former options allows you to get the latest version of Pardiso (which, theoretically, should be faster than the version that Intel MKL uses). Once you register, download the library and get a license, you can configure G+Smo with Pardiso by
81```
82cd /path/to/gismo/build
83cmake .. -DGISMO_ELASTICITY=ON -DGISMO_WITH_OPENMP=ON -DGISMO_WITH_PARDISO=ON -DPardiso_DIR=/path/to/pardiso
84```
85The Intel MKL way to use Pardiso is only viable for machines with an Intel CPU. To that end, you should register at Intel Development Tools https://software.intel.com/en-us/articles/free-ipsxe-tools-and-libraries, download and intall Inter C/C++ compiler and Intel MKL library. After that, you can configure G+Smo with Pardiso in the following way:
86```
87cd /path/to/gismo/build
88source /path/to/intel/compilers_and_libraries/linux/bin/compilervars.sh intel64
89cmake .. -DGISMO_ELASTICITY=ON -DGISMO_WITH_OPENMP=ON -DEIGEN_USE_MKL_ALL=ON -DGISMO_WITH_PARDISO=ON -DPARDISO_USE_MKL=ON -DINTEL_ROOT=/path/to/intel -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc
90```
91Despite an older version of Pardiso used in MKL, Intel optimization often results in faster performance than if a stand-alone library is used.
92
93Final tip: you can speed up the compilation of G+Smo by specifying the number of threads `make` command uses:
94```
95make -j<number of threads to use>
96```
97
98## Using
99Check out numerous detailed examples in `path/to/gismo/extensions/gsElasticity/examples`!
100