Getting started
FEniCS is a finite element solver for PDEs that can be used with Python or C++. Here is how you can install FEniCS on different operating systems (more details at https://fenicsproject.org/download/):
Last updated
FEniCS is a finite element solver for PDEs that can be used with Python or C++. Here is how you can install FEniCS on different operating systems (more details at https://fenicsproject.org/download/):
Last updated
The easiest way to use FEniCS is by creating and activating a conda environment containing the FEniCS package:
Another way is to download the FEniCS Docker image and set up a Docker container. Please note that there are additional steps if you wish to use Jupyter Notebook inside a Docker container.
Installing Docker is pretty straightforward on MacOS:
After installing Docker, download the FEniCS Docker image from your terminal:
Using this image, create a container named fenics-container (or name it however you like) that shares files with your local directory:
Navigate to your desired local directory and start the Docker container:
This is what you can expect on your terminal. Notice that the shared directory in the container shares the same files as your local directory.
Run your python scripts normally using python3. When you are finished, first exit the container using exit, then stop the Docker container:
Docker for Windows requires Windows 10 Pro/Enterprise/Education or Home. After installation, follow the steps above to create a FEniCS container. Docker for Windows can be a bit finicky since it uses Hyper-V or WSL2 to run the Linux images. If you've tried this installation and failed, I would recommend using Ubuntu.
There are many ways to use Ubuntu on a Windows PC (via virtual machine, dual booting, cloud, etc.). If you don't have a preference, I would recommend setting up an Ubuntu virtual machine.
First install Virtualbox:
Then follow these instructions to set up a Ubuntu virtual machine:
Finally, install FEniCS on the Ubuntu VM using the instructions in the Ubuntu section.
Install FEniCS by running this on the terminal:
If line 4 fails, try running lines 3 and 4 again.