Actual source code: sbaijspooles.c
1: /*$Id: sbaijspooles.c,v 1.10 2001/08/15 15:56:50 bsmith Exp $*/
2: /*
3: Provides an interface to the Spooles serial sparse solver
4: */
6: #include src/mat/impls/sbaij/seq/sbaij.h
8: #if defined(PETSC_HAVE_SPOOLES) && !defined(PETSC_USE_SINGLE) && !defined(PETSC_USE_COMPLEX)
9: #include src/mat/impls/aij/seq/spooles.h
10: /* Note the Petsc r permutation is ignored */
11: int MatCholeskyFactorSymbolic_SeqSBAIJ_Spooles(Mat A,IS r,PetscReal f,Mat *F)
12: {
13: Mat_Spooles *lu;
14: int ierr,m=A->m,n=A->n;
17: /* Create the factorization matrix F */
18: MatCreateSeqAIJ(A->comm,m,n,PETSC_NULL,PETSC_NULL,F);
20: (*F)->ops->choleskyfactornumeric = MatFactorNumeric_SeqAIJ_Spooles;
21: (*F)->factor = FACTOR_CHOLESKY;
23: ierr = PetscNew(Mat_Spooles,&lu);
24: (*F)->spptr = (void*)lu;
25: lu->options.symflag = SPOOLES_SYMMETRIC;
26: lu->options.pivotingflag = SPOOLES_NO_PIVOTING;
27: lu->flg = DIFFERENT_NONZERO_PATTERN;
29: return(0);
30: }
32: int MatUseSpooles_SeqSBAIJ(Mat A)
33: {
34: Mat_SeqSBAIJ *sbaij = (Mat_SeqSBAIJ*)A->data;
35: int bs = sbaij->bs;
38: if (bs > 1) SETERRQ1(1,"Block size %d not supported by Spooles",bs);
39: A->ops->choleskyfactorsymbolic = MatCholeskyFactorSymbolic_SeqSBAIJ_Spooles;
40: return(0);
41: }
43: #else
45: int MatUseSpooles_SeqSBAIJ(Mat A)
46: {
48: return(0);
49: }
51: #endif