Installation of mgis

Hello there, I’m trying to install mgis.fenics, and i would like to know what is the better way to install it, because when i tried to install Mfront, it didn’t work.

I followed the instructions:

$ sudo apt install python3 python3-numpy libboost-all-dev cmake g++ gfortran
The next step is to get the TFEL source code:

$ cd <where_you_want_to_download_the_source>
$ mkdir -p TFEL && cd TFEL
$ git clone https://github.com/thelfer/tfel.git
This will download the current development version of TFEL.

Then we create a build directory and call ccmake.

$ mkdir build && cd build
$ ccmake ../tfel
ccmake allows to select various options. In this tutorial, we choose the following options:

  CMAKE_INSTALL_PREFIX    ~/.local
  TFEL_APPEND_VERSION           ON
  enable-numpy-support          ON
  enable-python                 ON
  enable-python-bindings        ON
The TFEL_APPEND_VERSION allows to install different versions of TFEL at the same location.

Then configure twice [c],[c] and generate [g]. Once done, just type:

$ make
$ make install
Finally, add the paths in your local .bashrc file:

export PATH=$PATH:~.local/bin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:~/.local/lib
export PYTHONPATH=${PYTHONPATH}:~/.local/lib/python3.8/site-packages
Now you can use the local TFEL binaries such as mfront-X.Y.Z-dev and mtest-X.Y.Z-dev or define some global alias names for them.

<!– # Windows MINGW – >

But, when I tried:

import mgis.fenics as mf
Traceback (most recent call last):
  File "/home/philip/Documents/math-programming/MATH code/First FEM approx/brittle_1.py", line 3, in <module>
    import mgis.fenics as mf
ModuleNotFoundError: No module named 'mgis'

What it could be?

Hi. Regular user here (don’t blame FEniCS developers for my ignorance), but should you may be consult Issues · thelfer/MFrontGenericInterfaceSupport · GitHub ? (not that I recommend you to have an account with GitHub).

Ok, I’ll try it too, thanks. I tried to discuss here because I thought that it could be an error because I’m using the legacy version.

This indicates that mgis cannot be loaded, disregarding the version of FEniCS.

I think that if the issue was with FEniCS, you would get some other type of error, but I could be wrong. I don’t know if MGIS’ installation wraps FEniCS inside (but nothing indicates that in what you shared). The import mgis.xxxx does not mean that you would have xxxx installed, just that the mgis module has something with that name. In this case, it happens to be mgis.fenics, but for what I understand MFront is a different project. Good luck!