Problem running a simulation

My point is that solver_par is not part of the dolfin namespace, thus you, i.e.

from dolfin import *
print(solver_par)

returns

Traceback (most recent call last):
  File "glob_facets.py", line 3, in <module>
    print(solver_par)
NameError: name 'solver_par' is not defined

Thus, you have not given enough information to reproduce your issue.
For instance, if you have a look at:

you can reduce it to the following:

from fenics import *
set_log_level(LogLevel.DEBUG)
mesh = UnitSquareMesh(10, 10)
V = FunctionSpace(mesh, 'P', 1)

def boundary(x, on_boundary):
    return on_boundary
u_D = Expression('1 + x[0]*x[0] + 2*x[1]*x[1]', degree=2)
bc = DirichletBC(V, u_D, boundary)

# Define variational problem
kappa = Expression('x[0] + x[1]', degree=1)
f = Expression('-8*x[0] - 10*x[1]', degree=1)
u = TrialFunction(V)
v = TestFunction(V)
a = kappa*dot(grad(u), grad(v))*dx
L = f*v*dx

# Set linear solver parameters
prm = LinearVariationalSolver.default_parameters()
if MPI.comm_world.size > 1:
    prm["linear_solver"] = 'mumps'
else:
    prm["linear_solver"] = 'umfpack'

# Compute solution
u = Function(V)
solve(a == L, u, bc, solver_parameters=prm)

1 Like