Salome HOME
Inserted logo picture in README file
[tools/solverlab.git] / README.md
1 </center>
2
3 | ![logo](logoSOLVERLAB.png) |
4 |:--:|
5 | *SOLVERLAB* |
6
7 </center>
8 SOLVERLAB is a geometrical and numerical C++/Python library designed for numerical analysts who work on the discretisation of partial differential equations on general shapes and meshes and would rather focus on high-level scripting. The goal is to provide simple MATLAB style functions for the generation and manipulation of meshes, fields and matrices. The library originates from [CDMATH](http://cdmath.jimdo.com), a collaborative workgroup with the same name. It is based on the [MEDcoupling](https://docs.salome-platform.org/latest/dev/MEDCoupling/tutorial/index.html) C++/python library of the [SALOME](http://www.salome-platform.org/) project for the handling of meshes and fields, and on the C++ library [PETSC](https://www.mcs.anl.gov/petsc/) for the handling of matrices and linear solvers. 
9
10 SOLVERLAB includes PDE systems
11 arising from the modeling of nuclear reactor cores which involves fluid dynamics, heat and neutron diffusion as well as solid elasticity. It
12 is a simple environment meant at students and researchers for teachind and promote new numerical
13 methods on general geometries with unstructured meshes.  
14 The main research objectives of SOLVERLAB are the study of
15
16 - Numerical schemes for compressible flows at low Mach numbers on general meshes
17 - Well balanced schemes for stiff source terms (heat source, phase change, pressure losses)
18 - Numerical handling of flow inversion, phase disappearance and counter-currents in two phase flows
19 - Numerical handling of stiff porosity or cross section functions
20 - Schemes that preserve the phasic volume fraction α ∈ [0, 1]
21 - Convergence of finite volume methods
22 - New preconditioners for implicit methods for two phase flows
23 - The coupling of fluid models or multiphysics coupling (eg thermal hydraulics and neutronics or thermal hydraulics and solid thermics)
24
25 The library is currently developed for linux distributions and is maintained on Ubuntu 16.04 LTS and 18.04 LTS, as well as on Fedora 24, 26, 28, 30 and 32.
26
27 Examples of use
28 ---------------
29 - [Examples of stable numerical methods for the 1D linear transport equation](CDMATH/tests/doc/1DTransportEquation/RegularGrid/TransportEquation1D_RegularGrid.ipynb)
30 - [Shock formation and numerical capture issues for the 1D Burgers' equations](CDMATH/tests/doc/1DBurgersEquation/BurgersEquation1D.ipynb)
31 - [Influence of the mesh on the convergence and low Mach precision for the UPWIND finite volume method applied to the 2D wave system](CDMATH/tests/doc/2DWaveSystemVF_stationary/Convergence_WaveSystem_Upwind_SQUARE.ipynb)
32 - [Influence of the mesh on the convergence and low Mach precision  for the CENTERED finite volume method applied to the 2D wave system](CDMATH/tests/doc/2DWaveSystemVF_stationary/Convergence_WaveSystem_Centered_SQUARE.ipynb)
33 - [Influence of the mesh on the convergence and low Mach precision  for the STAGGERED finite volume method applied to the 2D wave system](CDMATH/tests/doc/2DWaveSystemVF_stationary/Convergence_WaveSystem_Staggered_SQUARE_squares.ipynb)
34 - [Influence of the mesh on the convergence and low Mach precision  for the PSEUDO-STAGGERED (colocated) finite volume method applied to the 2D wave system](CDMATH/tests/doc/2DWaveSystemVF_stationary/Convergence_WaveSystem_PStag_SQUARE.ipynb)
35 - [Finite elements for the Poisson problem on a cube in 3D (by S. Kameni Ngwamou, PhD student)](CDMATH/tests/doc/3DPoissonEF/FiniteElements3DPoisson_CUBE.ipynb)
36 - [Finite elements for the stationary diffusion of the temperature in a 3D room. Influence of the radiator position (by S. Kameni Ngwamou, PhD student)](CDMATH/tests/doc/3DRoomCoolingEF/3DRoomCoolingEF.ipynb)
37 - [Surface Finite elements for the Poisson-Beltrami problem on a sphere in 3D (by M. Nguemfouo, PhD student)](CDMATH/tests/doc/3DPoissonSphereEF/SynthesisConvergenceFESphere.pdf)
38 - [Surface Finite elements for the Poisson-Beltrami problem on a torus in 3D (by M. Nguemfouo, PhD student)](CDMATH/tests/doc/3DPoissonTorusEF/SynthesisConvergenceFETorus.pdf)
39
40 Download SOLVERLAB sources to compile
41 ----------------------------------
42
43 Create your source directory. For instance:
44 * `mkdir ~/workspace/SOLVERLAB`
45 * `cd ~/workspace/SOLVERLAB`
46
47 Download from salome-platform.org
48 * clone the git repository to a folder SOLVERLAB-master:  `git clone http://git.salome-platform.org/gitpub/modules/solverlab.git SOLVERLAB-master`
49
50
51 Set the environment for the compilation of SOLVERLAB
52 ---------------------------------------------
53 Dependencies. The following package list is sufficient on Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04 :
54
55  - `cmake3` (mandatory)
56  - `g++` or another C++ compiler (mandatory)
57  - `python-dev`, `python-numpy` and `swig3`for python scripts (mandatory)
58  - `python-matplotlib` and `paraview` for postprocessing tools such as plotting curves (matplotlib) or generating 3D view images (paraview) (mandatory)
59  - `ffmpeg` and `ffmpeg-devel` to generate an animation from a set of curves (optional)
60  - `doxygen`, `graphviz` and `mscgen`, if you want to generate a nice source code documentation in `~/workspace/SOLVERLAB/SOLVERLAB_install/share/doc/`. Use the compilation option `-DSOLVERLAB_WITH_DOCUMENTATION=ON` (optional).
61  - `libcppunit-dev`, if you want to generate unit tests. Use the compilation option `-DSOLVERLAB_WITH_TESTS=ON` (optional).
62  - `rpm`, if you want to generate RPM installation packages. Use the compilation option `-DSOLVERLAB_WITH_PACKAGE=ON` (optional).
63
64 Directories. Create the suggested build and installation folders:
65 * `cd ~/workspace/SOLVERLAB`
66 * `mkdir SOLVERLAB_build`
67 * `mkdir SOLVERLAB_install`
68 * `cd SOLVERLAB_build`
69
70
71 Compile and install SOLVERLAB
72 --------------------------
73 Simpler build for a minimum version:
74 * `cmake ../SOLVERLAB-master/ -DCMAKE_INSTALL_PREFIX=../SOLVERLAB_install -DCMAKE_BUILD_TYPE=Release `  
75 > This will download and build the following dependencies
76 > - PETSc from http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.14.0.tar.gz
77 > - SLEPc from https://slepc.upv.es/download/distrib/slepc-3.14.0.tar.gz
78 > - F2CBLASLAPACK from http://ftp.mcs.anl.gov/pub/petsc/externalpackages/f2cblaslapack-3.4.2.q4.tar.gz
79 > - HDF5 https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.3/src/hdf5-1.10.3.tar.gz
80 > - MEDFILE from http://files.salome-platform.org/Salome/other/med-4.1.0.tar.gz
81 > - MEDCOUPLING from http://files.salome-platform.org/Salome/other/medCoupling-9.4.0.tar.gz
82
83 If you already have an installation of PETSC, MED and MEDCoupling, you may save computational time and memory by using the advanced build version:
84 * `cmake ../SOLVERLAB-master -DCMAKE_INSTALL_PREFIX=../SOLVERLAB_install -DCMAKE_BUILD_TYPE=Release -G"Eclipse CDT4 - Unix Makefiles" -D_ECLIPSE_VERSION=4.3 -DSOLVERLAB_WITH_DOCUMENTATION=ON -DPETSC_DIR=${PETSC_DIR} -DPETSC_ARCH=${PETSC_ARCH} -DMEDFILE_ROOT_DIR=${MEDFILE_ROOT_DIR} -DMEDCOUPLING_ROOT_DIR=${MEDCOUPLING_ROOT_DIR}`  
85 > This assumes that you have an existing 
86 > - install of PETSc (with submodules SLEPC and HDF5) at the location given by the environment variable PETSC_DIR and the architecture variable PETSC_ARCH  
87 > See the instructions given in [the official documentation](http://www.mcs.anl.gov/petsc/documentation/installation.html)
88 > - install of MED                                    at the location given by the environment variable MEDFILE_ROOT_DIR
89 > - install of MEDCOUPLING                            at the location given by the environment variable MEDCOUPLING_ROOT_DIR
90
91 The 3 dependencies PETSC, MED and MEDCOUPLING should have been compiled with the same version of HDF5  
92 Warning : the linux package libhdf5-dev is generally not compatible with the libraries MED and MEDCoupling  
93 Compile and install:
94 * `make`
95 * `make install`
96
97 Run unit and example tests:
98 * make example
99
100 Run validation tests:
101 * make validation
102
103 Generate documentation of CDMATH module
104 * make docCDMATH
105
106 Generate documentation of CoreFlows module
107 * make docCoreFlows
108
109 Use of SOLVERLAB
110 -------------
111
112 To use SOLVERLAB with your Python code, you can load the SOLVERLAB environment in your terminal using the command
113  * source `~/workspace/SOLVERLAB/SOLVERLAB_install/env_SOLVERLAB.sh`
114 Then in your terminal simply type
115 - `python main.py `
116
117 If performance or parallelism is an issue for your simulations, you can use SOLVERLAB librairies with your C++ code :
118  * C++ libraries: `export LD_LIBRARY_PATH=~/workspace/SOLVERLAB/SOLVERLAB_install/lib`
119  * To know how to include the right libraries for compilation, see the makefiles of the examples. They include the list ` -lmedC -lmedloader -lmedcoupling -lbase -lmesh -llinearsolver`.
120
121 The SOLVERLAB environment variables consist in :
122  * SOLVERLAB C++ library path: `~/workspace/SOLVERLAB/SOLVERLAB_install/lib`
123  * SOLVERLAB Python library paths: `~/workspace/SOLVERLAB/SOLVERLAB_install/lib/SOLVERLAB:~/workspace/SOLVERLAB/SOLVERLAB_install/bin/SOLVERLAB`
124  * PETSc, SLEPc and HDF5 library path: `${PETSC_DIR}/${PETSC_ARCH}/lib`
125  * MED library path: `${MEDFILE_ROOT_DIR}/lib`
126  * MEDCOUPLING library path: `${MEDCOUPLING_ROOT_DIR}/lib`
127