On 13.12.2011, at 16:43, Matthew Knepley wrote: > On Tue, Dec 13, 2011 at 9:36 AM, Uwe Schlifkowitz < > uwe.schlifkowitz at uibk.ac.at> wrote: > >> On 12.12.2011, at 20:05, Barry Smith wrote: >> problem as described here: >> http://lists.mcs.anl.gov/pipermail/petsc-users/2011-August/009571.html >> possible, so Clemens (and I) resort to MATSOLVERPETSC to obtain D. >> if you really need it, but what are you using it for? Do you want the >> inertia? We could give that for PETSc factored matrices. >> >> K is an element stiffness matrix. K is related to displacement d and force >> f by K d = f. Since K is not invertible, a solution can be found by means >> of LDL^T decomposition where K = LDL^T . >> >> Here L is the lower triangular matrix and D is the diagonal matrix, which >> is what I am looking for. The number of negative values in D correspond to >> the number of negative eigenvalues of K and serve as an indicator of the >> occurrence of branching points. >> >> I am not sure if this has to do with inertia, but I am fairly new to all >> of this so suggestions are very welcome. > > > Yes, it looks like what you want > > http://en.wikipedia.org/wiki/Sylvester's_law_of_inertia > > Matt >
I found MatGetInertia in petsc's documentation and i am not sure how to use it. I found an old example from petsc-2.3.1 (http://www.mcs.anl.gov/petsc/petsc-2.3.1/src/ksp/ksp/examples/tutorials/ex10.c.html ), but things seem to have changed since that version. Can you give an example? > >> >> Uwe
