v0.14.0 |
This tutorial assumes that you have installed MoFEM with developer version using either instructions in Installation with Docker - JupyterHub or the script provided in Installation with Spack (Scripts). Therefore, you should have paths for the source code and the binary files (e.g. for the Release
build type) of the Core Library and Users Modules as follows:
$HOME/mofem_install/mofem-cephas/
$HOME/mofem_install/mofem-cephas/core-build-Release-*
$HOME/mofem_install/mofem-cephas/mofem/users_modules/
$HOME/mofem_install/mofem-cephas/mofem/users_modules/um-build-Release-*
In build directories described above, symbol
*
stands for thehash
of the particular build, e.g.5sehreo
To add a new MoFEM module that is already developed, for example Solid Shell Module, you may wish to follow these steps
If you have several builds of the Users Modules, e.g.
Debug
andRelease
, you will need to substitute the symbol*
in the command above by thehash
of the build you want to recompile.
um-build-Release-*
If you did everything correctly, you should see the paths for MoFEM Solid Shell Module are as follows
$HOME/mofem_install/mofem-cephas/mofem/users_modules/mofem_um_solid_shell_prism_element
$HOME/mofem_install/mofem-cephas/mofem/users_modules/um-build-Release-*/mofem_um_solid_shell_prism_element
The quickest way to create your own module is to replicate a module that is already available in MoFEM and then replace the existing source codes with your own. For example, you can replicate MoFEM Solid Shell Module following general steps as follows:
CMakeLists.txt
, InstalledAddModule.cmake
. Make sure all the names and paths are consistent with the new module name of your choiceThe quickest way to add a new program to an existing module in your MoFEM installation directory is to replicate a program that already available in the same module of your choice. For example, you can replicate vec-0
program in MoFEM tutorials following general steps as follows
$HOME/mofem_install/mofem-cephas/mofem/users_modules/tutorials/
vec-0
and paste it in the same placeCMakeLists.txt
. Make sure all the names and paths are consistent with the program name of your choice