This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

"exterior_facet_domains subdomains " warning when using PETScSnesSolver

+1 vote

I keep getting:
"*** Warning: Bilinear and linear forms do not have same exterior_facet_domains subdomains in SystemAssembler. Taking exterior_facet_domains subdomains from bilinear form"

when I try to use the PETScSNESSolver, but not with nonlinearvariationalsolver. Can anyone help me get ride of this message please?

Thank (example below)

from dolfin import *

class nlp(NonlinearProblem):
    def __init__(self, a, L, bc):
        NonlinearProblem.__init__(self)
        self.L = L
        self.a = a
        self.bc = bc
    def form(self, A, b, x):
        assemble_system(self.a, self.L, self.bc, A_tensor = A, b_tensor = b)
    def F(self, b, x):
        pass
    def J(self, A, x):
        pass

# Create mesh and define function space
mesh = RectangleMesh(0,0,1,1,10,10) #UnitSquareMesh(6, 4)
V = FunctionSpace(mesh, "Lagrange", 1)
u = Function(V)
du = TrialFunction(V)
u_test = TestFunction(V)
def u0_boundary(x, on_boundary): return on_boundary
bc = DirichletBC(V, 0, u0_boundary)
boundaries = FacetFunction('size_t', mesh) 
ds = Measure('ds')[boundaries]

F = inner(nabla_grad(u), nabla_grad(u_test))*dx + 1*u_test*ds

problem = NonlinearVariationalProblem(F, u, bc, derivative(F, u, du)) 
solver = NonlinearVariationalSolver(problem)

# Compute solution
solver.solve()
print 'done'


problem = nlp(derivative(F, u, du), F, bc)
solver = PETScSNESSolver()
solver.solve(problem, u.vector())
asked Sep 17, 2014 by mwelland FEniCS User (8,410 points)

Hi, can you post your DOLFIN version?

Run with 1.4.0

...