How to add an user module?

53 views
Skip to first unread message

Karol Lewandowski

unread,
Jun 1, 2017, 12:49:29 PM6/1/17
to mofem Group

I want to add an user module (e.g. homogenisation) into my mofem installation, how can I do it?

Lukasz Kaczmraczyk

unread,
Jun 1, 2017, 2:34:29 PM6/1/17
to mofem Group
MoFEM is a core library providing functionality for implementation of user modules where applications for particular finite elements or problems are implemented. User module is an independent repository, private or public and independently managed by its owner. 

User module is added to the project by cloning repository into directory $HOME/mofem-cephas/mofem/users_modules, for example, module for computational homogenisation has repository in Bitbucket and can be added by
cd $HOME/mofem-cephas/mofem/users_modules
git clone https
://lik...@bitbucket.org/likask/mofem_um_homogenisation.git homogenisation
Sometimes users modules depend on other modules, in that case, homogenisation module uses some old obsolete classes (which should not be used in new developments), thus in this particular case addition you have to clone  also obsolete module

Once the module is added, you have to go main build directory where users modules are located and rebuild the code. So you have to do
cd $HOME/mofem_build/um
touch
CMakeCache.txt
make
-j 4
Note the first command is used to trigger reconfiguration of users modules with the new module.

Note, each user module consist InstalledAddModule.cmake, with beginning lines, 
# Check minimum version of MoFEM with this module works
check_mofem_version
(0 5 63)
add_subdirectory
(${PROJECT_SOURCE_DIR}/homogenisation)
In that file minimal version of the core library is given (e.g. v0.5.63). Thus if you have too old version of core lib, it won't be added and cmake will generate an error. In that case, you need to update core library by pulling most recent version from Bitbucket repository and install core library.
Reply all
Reply to author
Forward
0 new messages