MoReFEM
|
A HPC finite element library developed for the implementation of the models of M3DISIM Inria team.
MoReFEM relies on modern C++ and required features shipped with standard C++ 20 (only for a few of them at the time of this writing - April 2022 - due to lack of widespread support for some expected features). It is routinely tested with very recent versions of gcc, clang and AppleClang.
Some of MoReFEM third party dependencies also require a Fortran compiler.
You may find more about required compilers and how to install them on this dedicated page.
MoReFEM relies on several third party libraries:
There is so far one optional dependency:
--morefem_with_slepc=True
when calling _configure_cmake.py
script.The ThirdPartyCompilationFactory project on gitlab provides smooth ways to install these dependencies: either by running directly a Python script or by using one of the given Docker images.
MoReFEM is now compiled only through CMake: the XCode project which was there since the beginning was rather difficult to keep up-to-date, and there were painful issues when merging different branches that had modified it. It is however possible to generate a working XCode project through CMake (see below).
To compile the code:
cmake/PreCache
directory and have a look at the predefined files. You may either copy one and modify what you need in the copy directly, or use one of them directly if it suits your needs.build
directory at the root of MoReFEM library) and run the command (here for a single static MoReFEM library built for macOS with AppleClang compiler in debug mode):This command calls the adequate CMake command which will configure your project; it will especially create a PreCache file which will keep your actual settings and install it along with the library. The command above uses up Ninja build (which is said to be one of the most efficient - and so far I have no reason to doubt it) but you can specify another generator - if you skip entirely the cmake_args
option above Makefiles will be used.
The option morefem_with_slepc
is optional; if skip False is assumed.
To compile the project, proceed with your chosen generator, e.g. for the command above:
Once done, you should first check the tests run correctly:
From v18.16 onward, a CTest integration has been introduced. So once your code is compiled, you should run:
and both unit tests, integration tests and sanity checks for the basic models should be run. Those tests are designed to run in few minutes (with of course strong dependency of the compilation mode chosen).
If you want to use XCode as IDE, some work has been done so that CMake may generate a usable project through:
If you do not want to be overwhelmed by the tests (there is one XCode scheme per test...) you may deactivate them in the project:
If this didn't work due to a message
error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
use the following commands to fix it (from this GitHub issue):
Please notice the generated XCode project may not display all the warnings: for some reason CMake XCode generator enables or disables some warnings regardless of the CMakeLists.txt content (see this StackOverflow question for more details). I have performed a work around to try to stay as close as possible to the expected behaviour (you make have a look at this dedicated file to see how I did it) but it is not entirely future-proof with future versions of XCode; if at some point a warning found in CI or command line wasn't found within XCode the command line should be trusted more (and the aforementioned file should be updated to mirror the command line behaviour).
Recently, we started releasing Docker images at each tag.
Currently they are located in a sibling project; they should be in registry of current project as soon as the functionality is available in Gitlab (ticket #1509).
We have identified 4 levels of users:
Sources/ModelInstances
, or some external ones in the dedicated Model group on Gitlab) and provides their own Lua file to compute on their own data.If you intend to be a contributor, make sure to run first:
which will set things up such as providing minimal git configuration (if no gitconfig file present on your account) or providing the XCode templates for new files if you're working on macOS.
Most users so far belong to the Model developer category; a lengthy tutorial has been devised to present how to construct a model which solves the Elac
MoReFEM is a library made from several modules; it may be compiled either as a single library (if BUILD_MOREFEM_UNIQUE_LIBRARY is set to True) or as 10 different libraries with a hierarchy (the exact structure of the library and its module is detailed in a dedicated page).
Upon build, ancillary libraries (for post-processing for instance) and executables (test and basic models) are also constructed; more information are provided on the aforementioned page.
As explained earlier, most of the time you shouldn't have to contribute directly to the library and should be able to define locally in your own model what you need.
However, if you have some fixes to provide or maybe something to share (for instance if you're an advanced model developer and have written a new operator that may be of interest for other models), feel free to submit it through a merge request on our gitlab.
Please check your branch passes correctly the continuous integration before issuing the merge request.
MoReFEM follows the integration manager workflow: merge requests are reviewed by the integration manager and integrated in the subsequent release if accepted.
Doxygen documentation is comprehensive and up-to-date; there are actually three flavors of them. For more information, see the dedicated README.md.
Version generated at the last MoreFEM tag is available at this address; this version features the complete documentation.
Some talks done to present the library are available in a dedicated Gitlab project.
Already mentioned, but you should really have a look at this tutorial to build from scratch a simple elastic model with constant time step and volumic mass.
Coding standards are provided in Documentation/CodingStandards. They are mostly inspired by those of Verdandi.
The best if you have a specific problem is to simply open an issue about it.
You may also contact engineers currently involved (part-time) on the project, both of which are library developer
If you're part of M3DISIM team, please ask your team leader or Jérôme to add you in the internal Mattermost channel dedicated to the project.