How to link fenics to FEATool??

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

How to link fenics to FEATool??

aidan123
I recently downloaded FEATool in order to use the fencis pde solver after having no luck with using fenics on other softwares. I want to use fenics with FEATool to solver various pde problems for a research project. I have a Windows 10 computer so therefore I attempted to install fenics using Ubuntu. I used the below commands accoridng to the FEATool website:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get install --no-install-recommends fenics

When I went to solve a basic pde in FEATool it worked when I used the generic solving tool, but when I clicked on the fenics solver it said:

FEniCS solution process failed. Check log file for errors.
fenics: Failed FEniCS installation and version check.
 
When I went to System Info is said "FEniCS Version: Not found". I believe I have fenics downloaded as I followed the instructions above and it appeared to work so I believe my issue is that fenics and FEATool are not linked. Does anyone know how I could set fenics up to work with FEATool? Or if you believe the issue is something else please let me know.

Thank you for the help!
Reply | Threaded
Open this post in threaded view
|

Re: How to link fenics to FEATool??

Precise Simulation
Administrator
This post was updated on .
First verify that your FEniCS installation actually runs and is working by running one of the FEniCS examples in the Ubuntu python interpreter that has FEniCS available.

Have you followed the troubleshooting steps in the corresponding section of the documentation?

https://www.featool.com/doc/fenics.html#fenics_troubleshooting

if so could you report which step failed and the output?

(The troubleshooting suggestions in this thread http://forum.featool.com/Update-to-WSL-Ubuntu-20-04-breaks-Fenics-connection-tp690p696.html may also be applicable)

Importantly, this command run in Matlab:

   system('bash -c "dolfin-version 2>/dev/null || python3 -c ''import dolfin;print(dolfin.__version__)''"')

should return the installed FEniCS version number (assuming 'python3' is aliased to the Python environment with FEniCS installed).
Reply | Threaded
Open this post in threaded view
|

Re: How to link fenics to FEATool??

aidan123
Thank you for your reply!

I was able to test the installation of fenics using the code "python3 -c 'import fenics'" which I got from the fenics tutorial. I got no output which the tutorial says is supposed to happen. When I tried to follow the troubleshooting steps  it went to system info and where is said Fenics version it said "Not Found".

I believe my issue is that I have fenics downloaded somewhere on my comuter but I do not know how to connect it to FEATool/matlab. Is this correct?

Any help would be greatly appreciated. thank you
Reply | Threaded
Open this post in threaded view
|

Re: How to link fenics to FEATool??

Precise Simulation
Administrator
aidan123 wrote
I was able to test the installation of fenics using the code "python3 -c 'import fenics'" which I got from the fenics tutorial. I got no output which the tutorial says is supposed to happen.
This command only loads the fenics module but does not actually run anything. Please also try to run any of the minimal example scripts or tutorials from the FEniCS documentation and website and make sure your get some output and no error messages.

aidan123 wrote
When I tried to follow the troubleshooting steps  it went to system info and where is said Fenics version it said "Not Found".
As suggested, please follow *all* the troubleshooting steps in

https://www.featool.com/doc/fenics.html#fenics_troubleshooting

and report the output.
Reply | Threaded
Open this post in threaded view
|

Re: How to link fenics to FEATool??

aidan123
Thank you for your response. I was able to run a script I created for parallel plates in the Ubuntu command line successfully. This script contained the line "from fenics import *" so I assume that since it ran fenics is installed on Ubuntu. When I tried to run other simple demo programs I found online it did generate some errors but I am not sure of they have to do with the fenics installation. This is one error I got when I tried ot run a poisson program I found on https://fenicsproject.org/olddocs/dolfin/1.3.0/python/demo/index.html:

Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

(PoissonDemoJuly14.py:1175): Gdk-CRITICAL **: 20:36:19.690: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
Solving linear variational problem.

I tried all of the trouble shooting steps that you linked and for each one I got the response:

system('bash -c "python -c ''import dolfin;print(dolfin.__version__)''"')
/bin/bash: python: command not found

ans =

   127

I appreciate all of the assistance. Thank you
Reply | Threaded
Open this post in threaded view
|

Re: How to link fenics to FEATool??

Precise Simulation
Administrator
Thank you for checking, unfortunately it is very hard to tell remotely what could be the issue with your setup. Could you also run the Matlab code below and report the output:

PYTHON_ALIASES = {'python3', 'python'};
[st0,res0] = system(['bash -c "dolfin-version 2>/dev/null'])
for i=1:length(PYTHON_ALIASES)
  py = PYTHON_ALIASES{i}
  [st1,res1] = system(['bash -c "',py,' -V"'])
  [st2,res2] = system(['bash -c "',py,' -c ''import dolfin;print(dolfin.__version__)''"'])
  [st3,res3] = system(['bash -c "',py,' -c ''import fenics''"'])
end
Reply | Threaded
Open this post in threaded view
|

Re: How to link fenics to FEATool??

aidan123
This is the output:

> PYTHON_ALIASES = {'python3', 'python'};
[st0,res0] = system(['bash -c "dolfin-version 2>/dev/null'])
for i=1:length(PYTHON_ALIASES)
  py = PYTHON_ALIASES{i}
  [st1,res1] = system(['bash -c "',py,' -V"'])
  [st2,res2] = system(['bash -c "',py,' -c ''import dolfin;print(dolfin.__version__)''"'])
  [st3,res3] = system(['bash -c "',py,' -c ''import fenics''"'])
end

st0 =

   127

res0 =

  0×0 empty char array

py =

    'python3'

st1 =

   127

res1 =

    '/bin/bash: python3: command not found
     '
st2 =

   127

res2 =

    '/bin/bash: python3: command not found
     '

st3 =

   127

res3 =

    '/bin/bash: python3: command not found
     '
py =

    'python'

st1 =

   127

res1 =

    '/bin/bash: python: command not found
     '


st2 =

   127

res2 =

    '/bin/bash: python: command not found
     '

st3 =

   127

res3 =

    '/bin/bash: python: command not found
     '

Thank you for all of the help! I really appreciate it
Reply | Threaded
Open this post in threaded view
|

Re: How to link fenics to FEATool??

Precise Simulation
Administrator
Ok, so apparently it seems the default "bash" command (which should launch the default WSL Linux distro) does not even find a Python installation. As you have tested that it should exist in the distro you installed FEniCS in, I suspect that either the "bash" command does not launch the WSL bash (if you for example install git or something), or you have several WSL distros installed and the default does not point to the one with FEniCS. So open a Windows command terminal (cmd) and check:

1)

where bash

This should show "C:\Windows\System32\bash.exe" at the top. Otherwise you have some other bash taking precedence which you have to correct first.

2)

wsl -l

This should show which different WSL Linux distributions you have installed. The one marked "default" should be the one which contains your FEniCS installation. If it is not you have to change to it with

wsl -s "my_wsl_linux_distro_with_FEniCS"

After these issues are corrected I believe it should work.
Reply | Threaded
Open this post in threaded view
|

Re: How to link fenics to FEATool??

aidan123
Thank you for all of your help. I managed to get the fenics solver working