Matlab version to run FEniCS.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Matlab version to run FEniCS.

Rafael Ferro
Esteemed,

I installed FEniCS using anaconda. And the matlab I'm using is the 2020 version (I've already tested it in the 2017 version too). However, in neither version does the FEniCS run.

Finally, when installing FEATool the following message appears: "Warning: Incompatible MEX files detected (for additional linear solvers) .Full functionality should still be available with the built-in solvers."

And looking at this link: http://forum.featool.com/Error-with-Matlab-mex-files-for-linear-solvers-td891.html#a892, I saw that only the versions mentioned that would be the ones that have compatibility, Could this be the problem with installing FEniCS?

note: I use MacOS.
Reply | Threaded
Open this post in threaded view
|

Re: Matlab version to run FEniCS.

Precise Simulation
Administrator
Rafael,

If you have installed FEniCS correctly in a compatible way, calling:

  >> system('dolfin-version')

from the MATLAB command line should return a string with the FEniCS version, for example '2019.2.0.dev0', which is the version that will be displayed when selecting "System Info..." > "FEniCS Version" from the "Help" menu.

To solve a model with FEniCS, MATLAB must be able to make system calls to "bash" scripts which contain calls to the python interpreter (or aliased python3) with the FEniCS installation. You can test if this works by running the MATLAB command:

  >> system('bash -c "python -c ''import fenics''"')

If any of the above returns errors, you must fix and correct your FEniCS installation correspondingly.
Reply | Threaded
Open this post in threaded view
|

Re: Matlab version to run FEniCS.

Rafael Ferro
Esteemed,

I appreciate the feedback. However, matlab does not "see" the fenics, see below:

>> system ('dolfin version')
/ bin / bash: dolfin-version: command not found
ans =
     127

>> system ('bash -c "python -c' 'import fenics' '"')
Traceback (most recent call last):
   File "<string>", line 1, in <module>
ImportError: No module named fenics
ans =
      1

And remembering again that I use a MacBook, where the installation was done through the Anaconda platform. (https://docs.continuum.io/anaconda/install/)

Thus, after installing ancaconda, the Fenics installation commands are:

conda create -n fenicsproject -c conda-forge fenics
source activate fenicsproject

Where a fenicsproject "env" is created, and thus, fenics works normally.

So, wouldn't it be necessary to indicate in the matlab that the fenics are inside the anaconda? But I don't know how to do this.
Reply | Threaded
Open this post in threaded view
|

Re: Matlab version to run FEniCS.

Precise Simulation
Administrator
This does not seem to be either a Matlab, FEATool, or OS/system problem, but an issue with your specific FEniCS installation. If the

  bash -c "dolfin-version"

command does not work, then you most likely either have a too old FEniCS version, not activated your conda Python environment before/in the Matlab session, or installed FEniCS incorrectly/in an incompatible way.
Reply | Threaded
Open this post in threaded view
|

Re: Matlab version to run FEniCS.

Rafael Ferro
See the image below!

When the command (bash -c "dolfin-version") is inserted in the terminal without performing the initialization of fenics by the command (source activate fenicsproject) it doesn't really work.

But when fenics activation is done, as indicated on the fenics website itself for those installing via Anaconda, the fenics version appears, which in this case is 2019.1.0

I've been working with fenics using anaconda / spyder for a year, and I always run my models smoothly.

Again, wouldn't it be necessary to check how to initialize fenics in matlab, just as it is done in the terminal itself?