On Thu, Nov 1, 2012 at 7:52 AM, Anders Logg <l...@simula.no> wrote: > On Thu, Nov 01, 2012 at 07:49:03AM +0000, Garth N. Wells wrote: >> I've added a demo for solving singular systems using a Krylov solver via >> PETSc: >> >> demo/undocumented/singular >> >> This can provide a good alternative to, for example, pinning the >> pressure in a Stokes problem or using a global Lagrange multiplier. In >> contrast to pinning or Lagrange multipliers, it doesn't mess up >> preconditioners or introduce a global row to the matrix. > > Very useful. What is exactly the logic of > > null_space = Vector(u.vector()) > V.dofmap().set(null_space, 1.0) > solver.set_nullspace([null_space]) > > ? > > Why does the dofmap need to be involved? >
Because I don't otherwise know how to build the null space for multi-field problems, e.g. elasticity which has six vectors in the null space. The dofmap can set the entries in a vector that correspond to a given field to a specified value. In the case of 3D Stokes, V.sub(3).dofmap().set(null_space, 1.0) would build the null space for the pressure. The demo is simple because the null space is spanned by just the constant vector. I may add an option to GenericLinearSolver::set_nullspace to add a constant without having to build it explicitly. Garth >> Does anyone know if Trilinos/AztecOO has similar functionality to >> PETSc for solving singular problems? > > No idea. > > -- > Anders _______________________________________________ Mailing list: https://launchpad.net/~dolfin Post to : dolfin@lists.launchpad.net Unsubscribe : https://launchpad.net/~dolfin More help : https://help.launchpad.net/ListHelp