Unable to create a vector of size 100

Hi all,
I am new to FEniCS and following the tutorial

On page no. 179, the vector is created as x = Vector(100), but I am getting this error when I did it.

Please note that the FEniCS book is now ten years old, and that the API of dolfin has changed a lot since then. There are other resources such as the documentation, including documented demos and the API.

For the 2016.2.0 version, there is the FEniCS tutorial.

and for the development version of FEniCS (FEniCSx) there is the FEniCSx tutorial.

Your particular problem is quite straightforward, as the error shows you taht you need to also include an MPI wrapper:

from dolfin import *
x = Vector(MPI.comm_world, 100)
1 Like