Python variational solver interface fails when a form is emty

Bug #846703 reported by Garth Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
Fix Released
High
Garth Wells

Bug Description

The variational solver interface needs to be extended to support linear forms that are empty - this can occur when using lhs/rhs to separate terms in an equation F = 0. A solution would be to create a zero vector that is compatible with the matrix generated by a bilinear form.

Changed in dolfin:
status: New → Confirmed
importance: Undecided → High
milestone: none → 1.0-rc1
Revision history for this message
Anders Logg (logg) wrote : Re: [Bug 846703] [NEW] Python variational solver interface fails when a form is emty

On Sat, Sep 10, 2011 at 11:25:46PM -0000, Garth Wells wrote:
> Public bug reported:
>
> The variational solver interface needs to be extended to support linear
> forms that are empty - this can occur when using lhs/rhs to separate
> terms in an equation F = 0. A solution would be to create a zero vector
> that is compatible with the matrix generated by a bilinear form.
>
> ** Affects: dolfin
> Importance: High
> Status: Confirmed
>
> ** Changed in: dolfin
> Status: New => Confirmed
>
> ** Changed in: dolfin
> Importance: Undecided => High
>
> ** Changed in: dolfin
> Milestone: None => 1.0-rc1

Can you provide an example?

--
Anders

Revision history for this message
Garth Wells (garth-wells) wrote :

Example code:

from dolfin import *

mesh = UnitSquare(32, 32)
V = FunctionSpace(mesh, "Lagrange", 1)

def boundary(x):
    return x[0] < DOLFIN_EPS or x[0] > 1.0 - DOLFIN_EPS
bc = DirichletBC(V, 1.0, boundary)

u, v = TrialFunction(V), TestFunction(V)
F = - inner(grad(u), grad(v))*dx
a, L = lhs(F), rhs(F)

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

Changed in dolfin:
assignee: nobody → Garth Wells (garth-wells)
status: Confirmed → In Progress
Revision history for this message
Garth Wells (garth-wells) wrote :

Fix committed for non-symmetric assembly. WIll register another report for assemble_system.

Changed in dolfin:
status: In Progress → Fix Committed
Anders Logg (logg)
Changed in dolfin:
milestone: 1.0-rc1 → 1.0-beta2
Changed in dolfin:
status: Fix Committed → Fix Released
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.