[petsc-users] Assembling primal Schur matrix in FETI-DP method

Thomas Witkowski Thomas.Witkowski at tu-dresden.de
Mon Nov 21 09:41:38 CST 2011


Zitat von Barry Smith <bsmith at mcs.anl.gov>:

>
> On Nov 21, 2011, at 9:11 AM, Jed Brown wrote:
>
>
>    From the FAQ I pointed you to earlier
>
> How can I compute the Schur complement, Kbb - Kab * inverse(Kbb) *   
> Kba in PETSc?
>
> It is very expensive to compute the Schur complement of a matrix and  
>  very rarely needed in practice. We highly recommend avoiding    
> algorithms that need it. The Schur complement of a matrix (dense or   
> sparse) is essentially always dense, so begin by
> 	• forming a dense matrix Kba,
> 	• also create another dense matrix T of the same size.
> 	• Then factor the matrix Kaa  with MatLUFactor() or   
> MatCholeskyFactor(), call the result A.
> 	• Then call MatMatSolve(A,Kba,T).
> 	• Then call MatMatMult(Kab,T,MAT_INITIAL_MATRIX,1.0,&S).
> 	• Now call MatAXPY(S,-1.0,Kbb,MAT_SUBSET_NONZERO).
> 	• Followed by MatScale(S,-1.0);
>
> Note there is never a reason to use KSP to do the solve because for   
> the many solves needed a direct solver will always win over using an  
>  iterative solver and since the result is dense it doesn't make  
> sense  to do this computation with huge matrices.
>
>    Barry
>
> If you want to use an external LU solver (it will not be faster than  
>  PETSc's so why bother). You would use MatGetFactor() then   
> MatLUFactorSymbolic() followed by MatLUFactorNumeric().
>
>
>


In my case the Schur complemt should be quite sparse, so I want to  
build it explicitly. My main problem is still how to compute

inverse(Kbb) * Kba

Sorry for asking again, but no of the solutions seems to be  
sastisfying. When I understood you (and Jed) right, there are two  
general ways: either I define inverse(Kbb) either as a Mat object and  
use MatMatSolve or via KSP and using KSPSolve. The first option seems  
fine, but one of you noted that it is not possible to reuse the LU  
factorization. The would be a huge drawback as I have to use  
inverse(Kbb) in different context. When defining inverse(Kbb) via KSP,  
as I do it at the moment (and yes, I want to use here direct solvers  
only), I must store Kba either column wise or in a dense way. Both is  
not really feasible.

Have I missed something to solve this problem?

Thomas


More information about the petsc-users mailing list