µSpectre is hosted on a git repository on gitlab. To clone it, run
$ git clone https://gitlab.com/muspectre/muspectre.git
or if you prefer identifying yourself using a public ssh-key, run
$ git clone firstname.lastname@example.org:muspectre/muspectre.git
The latter option requires you to have a user account on gitlab (create).
You can compile µSpectre using CMake (3.1.0 or higher). The current (and possibly incomplete list of) dependencies are
CMake (3.1.0 or higher)
Python3 including the header files.
Sphinx and Breathe (necessary if you want to build the documentation (turned off by default)
Eigen (3.3.0 or higher). If you do not install this, it will be downloaded automatically at configuration time, so this is not strictly necessary. The download can be slow, though, so we recommend installing it on your system.
The CMake curses graphical user interface (
- µSpectre requires a relatively modern compiler as it makes heavy use of C++14
features. It has successfully been compiled and tested using the following compilers under Linux
and using clang-4.0 under MacOS.
It does not compile on Intel’s most recent compiler, as it is still lacking some C++14 support. Work-arounds are planned, but will have to wait for someone to pick up the task.
To compile, create a build folder and configure the CMake project. If you do this in the folder you cloned in the previous step, it can look for instance like this:
$ mkdir build-release $ cd build-release $ ccmake ..
Then, set the build type to
Release to produce optimised code. µSpectre
makes heavy use of expression templates, so optimisation is paramount. (As an
example, the performance difference between code compiled in
Release is about a factor 40 in simple linear elasticity.)
Finally, compile the library and the tests by running
$ make -j <NB-OF-PROCESSES>
When using the
-j option to compile, be aware that compiling µSpectre
uses quite a bit of RAM. If your machine start swapping at compile time,
reduce the number of parallel compilations
The easiest and intended way of using µSpectre is through its Python bindings. The following simple example computes the response of a two-dimensional stretched periodic RVE cell. The cell consist of a soft matrix with a circular hard inclusion.
More examples both python and c++ executables can be found in the
If you think you found a bug, you are probably right. Please report it! The
preferred way is for you to create a task on µSpectre’s workboard and assign it to user
junge. Include steps to reproduce the bug if possible. Someone will answer
as soon as possible.
We welcome contributions both for new features and bug fixes. New features must be documented and have unit tests. Please submit merge requests for review. More detailed guidelines for submissions will follow soonᵀᴹ.