<div class="gmail_quote">On Tue, Apr 3, 2012 at 01:02, Karin&amp;NiKo <span dir="ltr">&lt;<a href="mailto:niko.karin@gmail.com">niko.karin@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div id=":13f">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. <br>Considering ML, one must also set the &quot;num_PDEs&quot; attribute, mustn&#39;t he? But it seems to me that this attribute cannot be set in the PETSc interface.<br>

Am I wrong?</div></blockquote></div><br><div>It is set using the &quot;block size&quot; 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).</div>
<div><br></div><div><div>  ierr = DMDAGetCoordinates(elas_da,&amp;vel_coords);CHKERRQ(ierr);</div><div>  ierr = MatNullSpaceCreateRigidBody(vel_coords,&amp;matnull);CHKERRQ(ierr);</div><div>  ierr = MatSetNearNullSpace(A,matnull);CHKERRQ(ierr);</div>
<div>  ierr = MatNullSpaceDestroy(&amp;matnull);CHKERRQ(ierr);</div></div><div><br></div>