github.com/weihuayi/fealpy
We want to develop an efficient and easy to use finite element software package to support our teach and research work.
We still have lot work to do.
In fealpy/
, run the following command
sudo pip install .
whill copy the fealpy into /usr/local/lib/python3.x/dist-packages/
In the fealpy/
, run the following command:
sudo pip install -e .
which will create a link in /usr/local/lib/python3.x/dist-packages/
.
sudo apt-get install python3 python3-pip ipython3
sudo apt-get install python3-numpy
sudo apt-get install python3-scipy
sudo -H pip3 install matplotlib
sudo -H pip3 install plotly
sudo apt-get install petsc-dev
sudo -H pip3 install petsc4py
sudo apt-get install python3-skimage
Install mesh generation package meshpy
:
ububtu 18.04 install meshpy
sudo apt-get install libboost-python-dev
sudo -H pip3 install meshpy
Install "metis"
sudo apt-get install metis
sudo apt-get install python3-numexpr
The following can install by pip3
sudo -H pip3 install pyamg
sudo -H pip3 install pycuda
sudo -H pip3 install mpi4py
sudo -H pip3 install pymetis
sudo -H pip3 install PySPH
sudo -H pip3 install nipy
sudo -H pip3 install pygmsh
conda install pyamg
conda install -c conda-forge pytools
from https://www.lfd.uci.edu/~gohlke/pythonlibs/#meshpy, dowload
'MeshPy‑2018.1‑cp36‑cp36m‑win_amd64.whl'
pip install msgpack
pip install MeshPy‑2018.1‑cp36‑cp36m‑win_amd64.whl
Dowload the latest boost from http://www.boost.org/.
./bootstrap.sh --with-python=python3
./b2
Here we install boost into /usr/local
directory.
We also use VTK Python 3 wrapper, one can clone VTK from github
first:
git clone https://github.com/Kitware/VTK.git
cd VTK
Then check out the latest stable version:
git archive v7.1.0 --prefix=vtk7.1.0/ --format=zip > ../vtk7.1.0.zip
Unzip the vtk7.1.0.zip
, then cd the source code file:
cd ..
unzip vtk7.1.0.zip
cd vtk7.1.0/
Create a build
directory, then cd into it and run cmake-gui ..
mkdir build
cd build/
cmake-gui ..
You can see the GUI of cmake, then:
- check the
Advanced
option - Press
Configure
button, and a dialog box will pop up - Press the
Finish
button on the dialog box - When configure completed, input
test
insearch
input box, uncheckBUILD_TESTING
. If you check this argument, vtk will dowload many data which is very slow. - Then, replace keyword
test
bypython
insearch
input box- Set
PYTHON_EXECUTABLE
as/usr/bin/python3.5
- Set
VTK_PYTHON_VERSION
as3.5
- Check
VTK_WRAP_PYTHON
- Set
- Press
Configure
button again - When configure completed, press
Generate
button - When generate process completed, just close the GUI of cmake
Finally, we can compile VTK by make
command
make -j8 # parallel compile with 8 thread (My laptop have 8 core)
sudo make install # it will intsall vtk into /usr/local/
Then one should append the following lines into your bashrc file:
# if you install vtk into /usr/local
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.5/site-packages
# if you install vtk into /home/why/software/vtk/7.1.0/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/why/software/vtk/7.1.0/lib
export PYTHONPATH=$PYTHONPATH:/home/why/software/vtk/7.1.0/lib/python3.5/site-packages
After you update your bashrc file, please source it:
source ~/.bashrc
Then you can use vtk in your python 3 program or ipython3
, just:
import vtk
At last, one can intall mayavi
, but one should change into root user first:
$ sudo -s
# export PYTHONPATH=$PYTHONPATH:/home/why/software/vtk/7.1.0/lib/python3.5/site-packages
# pip3 install mayavi
sudo apt-get install python3-dbg
Debug python program:
$ gdb python3
...
(gdb) run <programname>.py <arguments>