Error in Linear Variational Solver

Shall I autoremove them?

The following packages were automatically installed and are no longer required:
  dolfin-bin libmshr-dev libmshr2018.1 libproj-dev libtet1.5 python3-mshr
Use 'sudo apt autoremove' to remove them.

Go ahead. Doesn’t hurt to keep a clean system.

After following the steps in the order, I still get
python3 -c "import dolfin; print(dolfin.__version__)"
2018.1.0

Steps that I followed

sudo apt-get remove fenics
sudo apt autoremove
sudo apt-get purge fenics
sudo apt-get update
sudo apt-get install fenics

Right. You’ve got an installation of FEniCS 2018.1 in place now, you’re ready to go.

As dokken mentioned, the program runs in 2019.1, not in 2018.1. How to install 2019.1?

Here is what, he said for recap:

However this demo (with the specific parameters) will not run with dolfin 2018.1.0.
You should use the latest stable release:

```
2019.1.0
```

You were asking for help installing any version.

Did you try the script? What does it report?

I tried using version 2018.1.0 and I get this

Pick a demo: 0
Traceback (most recent call last):
  File "ft10_poisson_extended.py", line 759, in <module>
    demos[nr]()
  File "ft10_poisson_extended.py", line 482, in demo_test
    u = solver(kappa, f, u_D, 8, 8, 1)
  File "ft10_poisson_extended.py", line 57, in solver
    prm = LinearVariationalSolver.default_parameters()
AttributeError: type object 'dolfin.cpp.fem.LinearVariationalSolver' has no attribute 'default_parameters'

My apology, I could not convey clearly my intention. I would like to install the lastest version 2019.2 and also let’s say version 2016.2. How do I do it?

If you want both versions available at the same time, you will need to use docker.

Okay. If I would like to replace the current 2018.1.0, with 2019.2, how could I do it?

When using docker, it is as simple as:

docker run -ti -p 127.0.0.1:8000:8000 -v $(pwd):/home/fenics/shared -w /home/fenics/shared quay.io/fenicsproject/dev:latest

Instead of

docker run -ti -p 127.0.0.1:8000:8000 -v $(pwd):/home/fenics/shared -w /home/fenics/shared quay.io/fenicsproject/stable:2018.1.0

Given that you have installed docker.

1 Like

@dokken: It works like a magic. A big thank you!

1.) I have to replace the pwd with the actual directory. Otherwise, I get

docker run -ti -p 127.0.0.1:8000:8000 -v $(pwd):/home/fenics/shared -w /home/fenics/shared quay.io/fenicsproject/stable:2018.1.0
docker: invalid reference format: repository name must be lowercase.
See 'docker run --help'.

Any tips to replace the pwd with variable?

2.) How to I link each FEniCS version with the Spyder IDE? Now that I have 2018.1.0, 2019.1.0 and 2019.2.0.dev0
It is like a linker, loosely speaking, to choose the particular FEniCS version.

See: