2 \page install Installation and use of CoreFlows
5 CDMATH-CoreFlows is currently developped and maintained on Fedora and Ubuntu distributions.
6 CDMATH-CoreFlows relies on the numerical toolbox of the project [CDMATH]((http://cdmath.jimdo.com)) for the handling of meshes and fields, and on the library [PETSC](https://www.mcs.anl.gov/petsc/) for the handling of large sparse matrices.
7 You will need the packages '\a cmake ', '\a gcc', '\a gfortran' and '\a hdf5', plus '\a doxygen' if you want to generate this documentation and '\a swig' if you want to use python scripts.
9 Download and compilation of CDMATH and PETSc
10 --------------------------------------------
11 CDMATH can be downloaded and compiled together with PETSc in a single process, thanks to the cmake option -DCDMATH_WITH_PETSC=ON.
12 First create and enter a working dir
14 mkdir -p ~/workspace/cdmath
18 In order to download the approriate branch of \ref cdmath either unzip the following file to a directory cdmath-master
20 https://github.com/ndjinga/CDMATH/archive/master.zip
22 or clone the git repository to a folder cdmath-master
24 git clone https://github.com/ndjinga/CDMATH.git cdmath-master
27 In order to compile \ref cdmath you will need at least the libraries '\a cmake ', '\a gcc', '\a gfortran' , and '\a hdf5' plus optionally '\a swig' 'python-dev' and '\a numpy' if you intend to use \ref cdmath functions in your python scripts.
29 Create build and install repositories:
31 mkdir cdmath_build cdmath_install
34 Enter the build directory
41 cmake ../cdmath-master/ -DCMAKE_INSTALL_PREFIX=../cdmath_install -DCMAKE_BUILD_TYPE=Release -DCDMATH_WITH_PYTHON=ON -DCDMATH_WITH_PETSC=ON
46 By default, \ref cdmath will compile a new sequential installation of PETSc. If an installation of PETSc (version 3.4 or later) is already available in the system, it is possible to save time by first setting the environment variables PETSC_DIR and PETSC_ARCH to the appropriate values as can be found in petscconf.h, and then running the above cmake command.
48 Download and compilation of CoreFlows
49 ---------------------------------------------
50 First create and access a working directory :
52 mkdir -p ~/workspace/CDMATH-CoreFlows
53 cd ~/workspace/CDMATH-CoreFlows
56 Now create build and install repositories:
58 mkdir CDMATH-CoreFlows_build CDMATH-CoreFlows_install
61 In order to download CDMATH-CoreFlows either unzip the following file to a directory CDMATH-CoreFlows-master
63 https://github.com/ndjinga/CDMATH-CoreFlows/archive/master.zip
65 or clone the git repository to a folder CDMATH-CoreFlows-master
67 git clone https://github.com/ndjinga/CDMATH-CoreFlows.git CDMATH-CoreFlows-master
69 Either of these latter commands results in the creation of a directory `~/workspace/CDMATH-CoreFlows/CDMATH-CoreFlows-master` containing the source files.
71 In the following steps we assume that 'PETSc' (version 3.4 or more recent) has been installed with 'CDMATH' with the process described above.
72 You need to set the following variables
73 - `\a CDMATH_DIR`, the path to your CDMATH installation, for example `~/workspace/cdmath/cdmath_install//share/petsc-3.8.3 `
74 - `\a PETSC_DIR`, the path to your PETSc installation. If PETSc was installed by CDMATH then PETSC_DIR can be defined as `~/workspace/cdmath/cdmath_install`
75 - `\a PETSC_ARCH`, the type of installation used (usually arch-linux2-c-opt or linux-gnu-c-opt)
76 In order to do so, it is sufficient to source the 'CDMATH' environment file. Type in your linux terminal
78 source ~/workspace/cdmath/cdmath_install/env_CDMATH.sh
80 Go to the build directory
82 cd CDMATH-CoreFlows_build
87 ../CDMATH-CoreFlows-master/configure --prefix=../CDMATH-CoreFlows_install/ --with-petsc-dir=$PETSC_DIR --with-petsc-arch=$PETSC_ARCH --with-cdmath-dir=$CDMATH_DIR --with-python --with-doc
90 You can add the following optional commands
91 - `--with-gui`, if you want to use CDMATH-CoreFlows as a Salomé module (you will need to use a Salomé shell)
92 - `--with-debug`, if you want to use CDMATH-CoreFlows in debug mode instead of the default optimised mode
96 First load CoreFlows environment from the CoreFlows_install directory
98 source CoreFlows_install/env_CoreFlows.sh
101 - If you use C language: edit the file CoreFlows-master/main.cxx then in a terminal type
107 Then you can run the simulation in any directory with the command line
112 - If you use python language: edit your own python file my_file.py following for example the pattern of the file CDMATH-CoreFlows-master/main.py. Then in a terminal type
117 - If you use the graphic interface, you need to run a Salomé Unix shell and type the command line
119 runSalome -mCOREFLOWS
121 then click on new study to open CoreFlows interface