PLEASE NOTE THIS PROJECT IS UNDER DEVELOPMENT SO CURRENTLY YOU MAY NOT BE ABLE TO FIND SUFFICIENT INFORMATION
PLEASE CHECK EXAMPLE FILES UNDER THE EXAMPLE FOLDER
🧮 suanPan is a finite element method (FEM) simulation platform for applications in solid mechanics, civil/structural/seismic engineering, etc. The name suanPan (in some places such as suffix also it is abbreviated as suPan) comes from the term Suan Pan (算盤), which is Chinese abacus. suanPan is written in high quality C++ code and is targeted to provide an efficient, concise and reliable FEM simulation platform.
Documentation is available.
The highlights of suanPan are
- suanPan is fast, both memory and thread safe.
- suanPan is designed based on the shared memory model and supports parallelism on heterogeneous architectures, for example multi-threaded CPU + optional GPU. The parallelism is available for element updating and global stiffness assembling.
- suanPan is open source and easy to be expanded to incorporate user-defined elements, materials, etc.
- suanPan separates the FEA model part from the linear algebra operation part, which significantly reduces the complexity of development.
- suanPan utilizes the new language features shipped with the latest standards (C++14, C++17, etc.), such as new STL containers, smart pointers and many other features.
- suanPan supports simple visualization via VTK.
Linux users are strongly recommended to obtain the binaries via snap. The snap supports visualization and uses MKL for linear algebra.
The binaries are pre-compiled with OpenBLAS on both Windows and Ubuntu via CI. Please download the file by visiting the release page.
In order to enable GPU support which requires available MAGMA libraries and visualization support which requires VTK libraries, users have to compile the program by them own.
On Windows, to add file associations with
.supan files, please run the
AddAssociation.bat file with admin privilege.
How to Compile
As suanPan uses new language features, please use compilers that support C++17 standard. For example,
- MSVC 14.14 (Visual Studio 2017) and/or later version,
- GNU GCC 8.4 and/or later version.
On Ubuntu, the external libraries are compiled with GCC 9.3. The binaries are automatically uploaded under Releases. On Windows, all libraries are compiled as dynamic libraries with GCC 10.1 in MinGW-w64. To avoid any potential linking error, please use latest versions. WinLibs also provides an easy to use toolkit. The executables with VTK support is also compiled with GitHub Action, please visit the corresponding page to download the archive.
The software is deliberately designed to disable the backward compatibility. suanPan uses CMake to manage builds.
The package is tested under Windows with MSVC++ and GNU GCC. The libraries (only 64-bit, no 32-bit support anymore) currently used:
- ARPACK version 0.96 (optional, need a valid Fortran compiler)
- SuperLU version 5.2.1
- OpenBLAS version 0.3.10
- TBB Threading Building Blocks version 2020U2
- HDF5 version 1.10.6
- MUMPS version 5.2.1 (optional, need a valid Fortran compiler)
- VTK version 8.2
- MAGMA version 2.4.0
are bundled with the source code package.
The solution file under
MSVC can be compiled directly. The
Debug configurations use external OpenBLAS. The
Release-MKL uses Intel MKL, magma and VTK. The
Release-GPU further uses CUDA to offload sparse matrix solving on GPUs. To successfully build
Release-GPU, you need to set
VTK_LIB variables that point to correct location of your VTK distribution. Simply hit
Build (F7) to build the solution. You can change the linked library to other equivalent libraries such as Intel MKL manually, if those libraries are available. The bundled OpenBLAS is compiled with GCC 10.1 and dynamic architecture. If it does not work on your machine, please compile your own version. To do so, you may need to download MSYS, or Cygwin with necessary packages such as gcc and perl.
The compiled program cannot run directly as it depends on other dynamic libraries. Please copy all dynamic link library into the path that can be found by the program.
In addition, the TBB libraries shall be copied as well since by default multithreading is enabled.
/Libs/vs/tbb.dll /Libs/vs/tbbmalloc.dll /Libs/vs/tbbmalloc_proxy.dll
The VS solution can also be generated via CMake.
The solution under
MSVC folder currently pairs Visual Studio 2019.
You are highly recommended to compile your own version of OpenBLAS as the shipped one may not be optimal on your machine.
Use CMake to generate Makefiles, assume current folder is the root of the package and your are using MinGW, the commands should look like this.
# current folder is /suanPan-source-code-path mkdir cmake-build && cd cmake-build cmake -G "MinGW Makefiles" .. make
For MSYS, you may change the generator to “MSYS Makefiles”. The GUI may be a better tool for beginners to configure the build. There are several options provided to build the software with different configurations.
After successful compilation, the executable file is under
/cmake-build folder. The dynamic libraries should also be copied.
# current folder is cmake-build cp ../Libs/gcc-win/*.dll . # run the program ./suanPan.exe
Again, the shipped OpenBLAS may not work on your platform, please compile your own library if any error occurs.
Make sure the compilers are installed.
sudo apt install gcc g++ gfortran binutils cmake
Please do check the versions of those tools. A default configuration is enough for most cases if the platform is not too old. Simply create a build folder next to the source code folder and configure/make the program, such as
# current folder is /suanPan-source-code-path mkdir cmake-build cd cmake-build cmake ../suanPan make
The multi-threaded version uses TBB, the corresponding path can be added.
# current folder cmake-build export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../Libs/gcc-linux # run the program ./suanPan
The compilation on Mac OS is similar to that on Ubuntu. GNU GCC shall be installed.
brew install gcc cmake
Then configure the project by CMake.
# current folder is /suanPan-source-code-path mkdir cmake-build && cd cmake-build cmake -G "Unix Makefiles" ../suanPan make
Additional libraries that are used in suanPan are
Additional tools may be used by suanPan, they are
- UPX — Executable File Packer
Those libraries may depend on the libraries that are used in the project, such as