Application of BC to matrix with missing diagonal entries fails silently with uBLAS backend

Issue #108 resolved
Jan Blechta created an issue
from dolfin import *
parameters['linear_algebra_backend'] = 'uBLAS'

mesh = UnitSquareMesh(10, 10)
V = FunctionSpace(mesh, "CG", 1)
# initialize mesh connectivity so that Facet.exterior() works
mesh.init()
# define the interior of the domain by looking at each facets
facet_domains = FacetFunction('size_t', mesh)
facet_domains.set_all(0)
for f in facets(mesh):
    if any(ff.exterior() for ff in facets(f)):
        facet_domains[f] = 1

bc_in = DirichletBC(V, Constant(-1.0), facet_domains, 0)

u, v = TestFunction(V), TrialFunction(V)
a = u*v*ds
L = Constant(1.)*v*ds

w = Function(V)
solve(a == L, w, bcs=bc_in)

plot(w, axes=True)
interactive()

Setting some rows to identity fails because diagonal entry is missing in sparsity pattern. The problem is that error is not raised while diagonal entries are not really set to 1. Problem is probably in uBLASMatrix<Mat>::ident.

Comments (3)

  1. Log in to comment