Periodic boundary conditions do not work with Epetra backend and nonlinear solver

Bug #1056106 reported by Patrick Farrell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Won't Fix
Undecided
Unassigned

Bug Description

Hi,

(I know there's a bug about periodic BCs with Epetra not working before, but I think that this is a different case.)

Consider the following code:

from dolfin import *
import random
import sys

parameters["linear_algebra_backend"] = "Epetra"

mesh = UnitInterval(40)
V = FunctionSpace(mesh, "CG", 2)

class PeriodicBoundary(SubDomain):
  def inside(self, x, on_boundary):
    return abs(x[0]) < DOLFIN_EPS and on_boundary

  def map(self, x, y):
    y[0] = x[0] - 1

def main(ic):

  out = Function(V)
  u = TrialFunction(V)
  v = TestFunction(V)
  bc = PeriodicBC(V, PeriodicBoundary())

  solve(inner(u, v)*dx == inner(ic, v)*dx, out, bc)

  F = inner(out, v)*dx - inner(ic, v)*dx
  solve(F == 0, out, bc)

  return out

if __name__ == "__main__":
  ic = Function(V)
  vec = ic.vector()
  for i in range(len(vec)):
    vec[i] = random.random()

  out = main(ic)

The *first* solve, written in the form solve(a == L), works fine.
The *second* solve, written in the form solve(F == 0), fails:
*** -------------------------------------------------------------------------
*** Error: Unable to set block of values for Epetra matrix.
*** Reason: Did not manage to perform Epetra_FECrsMatrix::ReplaceGlobalValues.
*** Where: This error was encountered inside EpetraMatrix.cpp.
*** Process: 0
*** -------------------------------------------------------------------------

With the fenics-dev package 1.0.0-2+bzr6748~ppa1~precise1, if you comment out the Epetra backend, then both solves work fine.

Changed in dolfin:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.