1

I’ve tried to install fenics and use the repository of the paper “Hybrid FEM-NN models: Combining artificial neural networks with the finite element method]” to calculate a linear Physics-Informed Neural Network for a linear problem (https://github.com/sebastkm/hybrid-fem-nn-examples/tree/main/examples/pinn_linear).

I’m using Windows 11 and Python 3.10.4.

To run the script main.py I need to use the fenics package. As usual working in python I did

pip install fenics

which worked without any problems. Trying to run the script prompted the error

from fenics import *
ModuleNotFoundError: No module named 'fenics'

After reading a couple of posts on this issue I made sure there are no other virtual environments anymore and that the path sys.path :

C:\Users\neuma\AppData\Local\Programs\Python\Python310\Lib\site-packages

contains the folder which contains the installed fenics packages:

fenics_dijitso-2019.1.0.dist-info
fenics_ffc-2019.1.0.post0.dist-info
fenics_fiat-2019.1.0.dist-info
fenics_ufl-2019.1.0.dist-info
fenics-2019.1.0.dist-info

I’ve noted that there is no folder named just fenics.

After this attempt did not work I tried to follow the instruction for DOLFINx (https://docs.fenicsproject.org/dolfinx/main/python/installation.html#dependencies) since some posts mentioned dolfinx and fenics are the same.

After installing the docker I followed the instructions on running fenics within the docker (https://fenics.readthedocs.io/projects/containers/en/latest/introduction.html#installing-docker). This at least seemed to work using the Terminal:

C:\Users\neuma>docker run -ti quay.io/fenicsproject/stable:latest
# FEniCS stable version image

Welcome to FEniCS/stable!

This image provides a full-featured and optimized build of the stable
release of FEniCS.

To help you get started this image contains a number of demo
programs. Explore the demos by entering the 'demo' directory, for
example:

cd ~/demo/python/documented/poisson
python3 demo_poisson.py
fenics@9548d966c2fc:~$ cd ~/demo/python/documented/poisson
fenics@9548d966c2fc:~/demo/python/documented/poisson$ python3 demo_poisson.py
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Solving linear variational problem.
To view figure, visit http://0.0.0.0:8000
Press Ctrl+C to stop WebAgg server

Visiting the url prompt the following message:

This page is not working
0.0.0.0 has not sent any data.
ERR_EMPTY_RESPONSE

Since I seem to have tried all possible versions of installation of fenics (and/or Dolfinx) and nothing worked I want to ask here if anyone could help me with the installtion.

I’m pretty confused about how to understand the difference betweend fenics and dolfinx and why I need Ubuntu or Linux and a Docker to run a package which already seems to be installed in python . Maybe this screenshot will make it a little clearer:

PyCharm IDE

If you need any more information just let me know. Would be great if someone could help me out.

Oskar

1 Answers1

0

In case anyone else struggles with this or similiar problems, the solution was given here: https://fenicsproject.discourse.group/t/installation-problems/9041/43