Periodic boundary conditions do not work with Epetra backend and nonlinear solver
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[
mesh = UnitInterval(40)
V = FunctionSpace(mesh, "CG", 2)
class PeriodicBoundar
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_
*** Where: This error was encountered inside EpetraMatrix.cpp.
*** Process: 0
*** -------
With the fenics-dev package 1.0.0-2+
Changed in dolfin: | |
status: | New → Won't Fix |