[petsc-users] ML and linear elasticity

Jed Brown jedbrown at mcs.anl.gov
Tue Apr 3 08:21:47 CDT 2012


On Tue, Apr 3, 2012 at 01:02, Karin&NiKo <niko.karin at gmail.com> wrote:

> I am not sure if the definition of the near null space of the operator
> suffice in order to get an optimal preconditioner for linear elasticity.
> Considering ML, one must also set the "num_PDEs" attribute, mustn't he?
> But it seems to me that this attribute cannot be set in the PETSc interface.
> Am I wrong?
>

It is set using the "block size" of the matrix (MatSetBlockSize()). But
that is only part of the game. For robustness, you should also provide null
space information. Here is an example of using a coordinate Vec to create a
MatNullSpace defining the rigid body modes and passing it along (from
src/ksp/ksp/examples/tutorials/ex49.c).

  ierr = DMDAGetCoordinates(elas_da,&vel_coords);CHKERRQ(ierr);
  ierr = MatNullSpaceCreateRigidBody(vel_coords,&matnull);CHKERRQ(ierr);
  ierr = MatSetNearNullSpace(A,matnull);CHKERRQ(ierr);
  ierr = MatNullSpaceDestroy(&matnull);CHKERRQ(ierr);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120403/32ae6df8/attachment.htm>


More information about the petsc-users mailing list