suanPan

An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework

View on GitHub

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

DOI License: GPL v3 release suanpan download C/C++ CI AppVeyor branch AppVeyor branch Build Status Build Status codecov Codacy Badge CodeFactor Language grade: C/C++ language GitHub top language code-size GitHub issues Total alerts Gitter

asciicast

Intro

🧮 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.

suanPan is partially influenced by popular (non-)commercial FEA packages, such as ABAQUS UNIFIED FEA, ANSYS and OpenSees.

Documentation is available.

an example of simulation of particle collision

Features

The highlights of suanPan are

Download Binaries

Linux users are strongly recommended to obtain the binaries via snap. The snap supports visualization and uses MKL for linear algebra.

Get it from the Snap Store

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 .sp and .supan files, please run the AddAssociation.bat file with admin privilege.

How to Compile

Overview

As suanPan uses new language features, please use compilers that support C++17 standard. For example,

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.

Windows

The package is tested under Windows with MSVC++ and GNU GCC. The libraries (only 64-bit, no 32-bit support anymore) currently used:

are bundled with the source code package.

Visual Studio

The solution file under MSVC can be compiled directly. The Release and 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-MKL and Release-GPU, you need to set VTK_INC and 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.

/Libs/gcc-win/*.dll

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.

GNU GCC

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

Ubuntu

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

Mac OS

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

Dependency

Additional libraries that are used in suanPan are

Additional tools may be used by suanPan, they are

Those libraries may depend on the libraries that are used in the project, such as