← Back to team overview

fenics team mailing list archive

Problems with Example Script

 

Dear All,
I have recently installed fenics on my machine (Ubuntu 9.10 amd64 architecture), following the instructions at

http://www.fenics.org/wiki/Download


However, when I try running the first example script from the excellent tutorial

http://www.fenics.org/pub/documents/fenics/tutorial/fenics-tutorial.pdf

which I paste at the end of the email (saved as fenics-test.py), this is the output I get


$ python fenics-test.py
Fatal error in MPI_Comm_size: Invalid communicator, error stack:
MPI_Comm_size(111): MPI_Comm_size(comm=0x227101c0, size=0x7fff9ea355ec) failed
MPI_Comm_size(69).: Invalid communicator

I am using a multicore machine and it looks like that something related to MPI is a problem. I am not really knowledgeable about parallelization and I am not interested (as for now) in running fenics in parallel, but I simply would like to be able to play a bit with this example script.
Any help is really appreciated.
Cheers

Lorenzo

####################################################


from dolfin import *
# Create mesh and define function space
mesh = UnitSquare(6, 4)
V = FunctionSpace(mesh, "CG", 1)
# Define boundary conditions
u0 = Expression("1 + x[0]*x[0] + 2*x[1]*x[1]", V=V)
class Boundary(SubDomain): # define the Dirichlet boundary
   def inside(self, x, on_boundary):
       return on_boundary
u0_boundary = Boundary()
bc = DirichletBC(V, u0, u0_boundary)
# Define variational problem
v = TestFunction(V)
u = TrialFunction(V)
f = Constant(mesh, -6.0)
a = dot(grad(u), grad(v))*dx
L = f*v*dx
# Compute solution
problem = VariationalProblem(a, L, bc)
u = problem.solve()
# Plot solution and mesh
plot(u)
plot(mesh)
# Dump solution to file in VTK format
file = File("poisson.pvd")
file << u
# Hold plot
interactive()



Follow ups