~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to site-packages/dolfin/__init__.py

  • Committer: Anders Logg
  • Date: 2008-05-15 16:02:44 UTC
  • Revision ID: logg@simula.no-20080515160244-e2a4wkfxfzmts16s
Add new class SingularSolver:

This class provides a linear solver for singular linear systems
Ax = b where A has a one-dimensional null-space (kernel). This
may happen for example when solving Poisson's equation with
pure Neumann boundary conditions.

The solver attempts to create an extended non-singular system
by adding the constraint [1, 1, 1, ...]^T x = 0.

If an optional mass matrix M is supplied, the solver attempts
to create an extended non-singular system by adding the
constraint m^T x = 0 where m is the lumped mass matrix. This
corresponds to setting the average (integral) of the finite
element function with coefficients x to zero.

The solver makes not attempt to check that the null-space is
indeed one-dimensional. It is also assumed that the system
Ax = b retains its sparsity pattern between calls to solve().

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
#from dolfin import GenericTensor, GenericMatrix, GenericVector
12
12
from dolfin import Matrix, Vector, Scalar
13
13
from dolfin import l1, l2, linf 
14
 
from dolfin import LinearSolver, KrylovSolver, LUSolver
 
14
from dolfin import LinearSolver, KrylovSolver, LUSolver, SingularSolver
15
15
from dolfin import solve, residual
16
16
#from dolfin import ElementLibrary, InvMeshSize
17
17
#from dolfin import Graph, GraphEditor, GraphPartition