xref: /petsc/include/petscmat.h (revision 4e7234bf172ce7019c4948834d73bd3002d026ba)
173f4d377SMatthew Knepley /* $Id: petscmat.h,v 1.228 2001/09/07 20:09:08 bsmith Exp $ */
22eac72dbSBarry Smith /*
32eac72dbSBarry Smith      Include file for the matrix component of PETSc
42eac72dbSBarry Smith */
50a835dfdSSatish Balay #ifndef __PETSCMAT_H
60a835dfdSSatish Balay #define __PETSCMAT_H
70a835dfdSSatish Balay #include "petscvec.h"
82eac72dbSBarry Smith 
9d9274352SBarry Smith /*S
10d9274352SBarry Smith      Mat - Abstract PETSc matrix object
112eac72dbSBarry Smith 
12d91e6319SBarry Smith    Level: beginner
13d91e6319SBarry Smith 
14d9274352SBarry Smith   Concepts: matrix; linear operator
15d9274352SBarry Smith 
16d9274352SBarry Smith .seealso:  MatCreate(), MatType, MatSetType()
17d9274352SBarry Smith S*/
18d9274352SBarry Smith typedef struct _p_Mat*           Mat;
19d9274352SBarry Smith 
20d9274352SBarry Smith /*E
21d9274352SBarry Smith     MatType - String with the name of a PETSc matrix or the creation function
22d9274352SBarry Smith        with an optional dynamic library name, for example
23d9274352SBarry Smith        http://www.mcs.anl.gov/petsc/lib.a:mymatcreate()
24d9274352SBarry Smith 
25d9274352SBarry Smith    Level: beginner
26d9274352SBarry Smith 
27d9274352SBarry Smith .seealso: MatSetType(), Mat
28d91e6319SBarry Smith E*/
29273d9f13SBarry Smith #define MATSAME     "same"
30273d9f13SBarry Smith #define MATSEQMAIJ  "seqmaij"
31273d9f13SBarry Smith #define MATMPIMAIJ  "mpimaij"
32273d9f13SBarry Smith #define MATIS       "is"
33273d9f13SBarry Smith #define MATMPIROWBS "mpirowbs"
34273d9f13SBarry Smith #define MATSEQDENSE "seqdense"
35273d9f13SBarry Smith #define MATSEQAIJ   "seqaij"
36273d9f13SBarry Smith #define MATMPIAIJ   "mpiaij"
37273d9f13SBarry Smith #define MATSHELL    "shell"
38273d9f13SBarry Smith #define MATSEQBDIAG "seqbdiag"
39273d9f13SBarry Smith #define MATMPIBDIAG "mpibdiag"
40273d9f13SBarry Smith #define MATMPIDENSE "mpidense"
41273d9f13SBarry Smith #define MATSEQBAIJ  "seqbaij"
42273d9f13SBarry Smith #define MATMPIBAIJ  "mpibaij"
43273d9f13SBarry Smith #define MATMPIADJ   "mpiadj"
44273d9f13SBarry Smith #define MATSEQSBAIJ "seqsbaij"
45273d9f13SBarry Smith #define MATMPISBAIJ "mpisbaij"
46cebc7f6cSBarry Smith #define MATDAAD     "daad"
47cebc7f6cSBarry Smith #define MATMFFD     "mffd"
486d88219bSBarry Smith #define MATESI      "esi"
496d88219bSBarry Smith #define MATPETSCESI "petscesi"
50c8a8475eSBarry Smith #define MATNORMAL   "normal"
51273d9f13SBarry Smith typedef char* MatType;
52d91e6319SBarry Smith 
53c06d978dSMatthew Knepley #define MAT_SER_SEQAIJ_BINARY "seqaij_binary"
54c06d978dSMatthew Knepley #define MAT_SER_MPIAIJ_BINARY "mpiaij_binary"
55c06d978dSMatthew Knepley typedef char *MatSerializeType;
56c06d978dSMatthew Knepley 
57c06d978dSMatthew Knepley /* Logging support */
58552e946dSBarry Smith #define    MAT_FILE_COOKIE 1211216    /* used to indicate matrices in binary files */
59c06d978dSMatthew Knepley extern int MAT_COOKIE;
6071d41ebeSBarry Smith extern int MATSNESMFCTX_COOKIE;
61c06d978dSMatthew Knepley extern int MAT_FDCOLORING_COOKIE;
628ba1e511SMatthew Knepley extern int MAT_PARTITIONING_COOKIE;
638ba1e511SMatthew Knepley extern int MAT_NULLSPACE_COOKIE;
64d59c15a7SBarry Smith extern int MAT_Mult, MAT_MultMatrixFree, MAT_Mults, MAT_MultConstrained, MAT_MultAdd, MAT_MultTranspose;
65d59c15a7SBarry Smith extern int MAT_MultTransposeConstrained, MAT_MultTransposeAdd, MAT_Solve, MAT_Solves, MAT_SolveAdd, MAT_SolveTranspose;
66d5ba7fb7SMatthew Knepley extern int MAT_SolveTransposeAdd, MAT_Relax, MAT_ForwardSolve, MAT_BackwardSolve, MAT_LUFactor, MAT_LUFactorSymbolic;
67d5ba7fb7SMatthew Knepley extern int MAT_LUFactorNumeric, MAT_CholeskyFactor, MAT_CholeskyFactorSymbolic, MAT_CholeskyFactorNumeric, MAT_ILUFactor;
68d5ba7fb7SMatthew Knepley extern int MAT_ILUFactorSymbolic, MAT_ICCFactorSymbolic, MAT_Copy, MAT_Convert, MAT_Scale, MAT_AssemblyBegin;
69d5ba7fb7SMatthew Knepley extern int MAT_AssemblyEnd, MAT_SetValues, MAT_GetValues, MAT_GetRow, MAT_GetSubMatrices, MAT_GetColoring, MAT_GetOrdering;
70d5ba7fb7SMatthew Knepley extern int MAT_IncreaseOverlap, MAT_Partitioning, MAT_ZeroEntries, MAT_Load, MAT_View, MAT_AXPY, MAT_FDColoringCreate;
7166f9b7ceSBarry Smith extern int MAT_FDColoringApply, MAT_Transpose, MAT_FDColoringFunction;
72c06d978dSMatthew Knepley 
738ba1e511SMatthew Knepley EXTERN int MatInitializePackage(char *);
74c06d978dSMatthew Knepley 
75273d9f13SBarry Smith EXTERN int MatCreate(MPI_Comm,int,int,int,int,Mat*);
76273d9f13SBarry Smith EXTERN int MatSetType(Mat,MatType);
77273d9f13SBarry Smith EXTERN int MatSetFromOptions(Mat);
78273d9f13SBarry Smith EXTERN int MatSetUpPreallocation(Mat);
79273d9f13SBarry Smith EXTERN int MatRegisterAll(char*);
80273d9f13SBarry Smith EXTERN int MatRegister(char*,char*,char*,int(*)(Mat));
81c06d978dSMatthew Knepley EXTERN int MatSerializeRegister(const char [], const char [], const char [], int (*)(MPI_Comm, Mat *, PetscViewer, PetscTruth));
8230de9b25SBarry Smith 
8330de9b25SBarry Smith /*MC
8430de9b25SBarry Smith    MatRegisterDynamic - Adds a new matrix type
8530de9b25SBarry Smith 
8630de9b25SBarry Smith    Synopsis:
8730de9b25SBarry Smith    int MatRegisterDynamic(char *name,char *path,char *name_create,int (*routine_create)(Mat))
8830de9b25SBarry Smith 
8930de9b25SBarry Smith    Not Collective
9030de9b25SBarry Smith 
9130de9b25SBarry Smith    Input Parameters:
9230de9b25SBarry Smith +  name - name of a new user-defined matrix type
9330de9b25SBarry Smith .  path - path (either absolute or relative) the library containing this solver
9430de9b25SBarry Smith .  name_create - name of routine to create method context
9530de9b25SBarry Smith -  routine_create - routine to create method context
9630de9b25SBarry Smith 
9730de9b25SBarry Smith    Notes:
9830de9b25SBarry Smith    MatRegisterDynamic() may be called multiple times to add several user-defined solvers.
9930de9b25SBarry Smith 
10030de9b25SBarry Smith    If dynamic libraries are used, then the fourth input argument (routine_create)
10130de9b25SBarry Smith    is ignored.
10230de9b25SBarry Smith 
10330de9b25SBarry Smith    Sample usage:
10430de9b25SBarry Smith .vb
10530de9b25SBarry Smith    MatRegisterDynamic("my_mat",/home/username/my_lib/lib/libO/solaris/mylib.a,
10630de9b25SBarry Smith                "MyMatCreate",MyMatCreate);
10730de9b25SBarry Smith .ve
10830de9b25SBarry Smith 
10930de9b25SBarry Smith    Then, your solver can be chosen with the procedural interface via
11030de9b25SBarry Smith $     MatSetType(Mat,"my_mat")
11130de9b25SBarry Smith    or at runtime via the option
11230de9b25SBarry Smith $     -mat_type my_mat
11330de9b25SBarry Smith 
11430de9b25SBarry Smith    Level: advanced
11530de9b25SBarry Smith 
11630de9b25SBarry Smith    Notes: ${PETSC_ARCH} and ${BOPT} occuring in pathname will be replaced with appropriate values.
11730de9b25SBarry Smith          If your function is not being put into a shared library then use VecRegister() instead
11830de9b25SBarry Smith 
11930de9b25SBarry Smith .keywords: Mat, register
12030de9b25SBarry Smith 
12130de9b25SBarry Smith .seealso: MatRegisterAll(), MatRegisterDestroy()
12230de9b25SBarry Smith 
12330de9b25SBarry Smith M*/
124273d9f13SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
125273d9f13SBarry Smith #define MatRegisterDynamic(a,b,c,d) MatRegister(a,b,c,0)
126273d9f13SBarry Smith #else
127273d9f13SBarry Smith #define MatRegisterDynamic(a,b,c,d) MatRegister(a,b,c,d)
12830de9b25SBarry Smith #endif
12930de9b25SBarry Smith 
13030de9b25SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
13130de9b25SBarry Smith #define MatSerializeRegisterDynamic(a,b,c,d) MatSerializeRegister(a,b,c,0)
13230de9b25SBarry Smith #else
133c06d978dSMatthew Knepley #define MatSerializeRegisterDynamic(a,b,c,d) MatSerializeRegister(a,b,c,d)
134273d9f13SBarry Smith #endif
13530de9b25SBarry Smith 
136273d9f13SBarry Smith extern PetscTruth MatRegisterAllCalled;
137b0a32e0cSBarry Smith extern PetscFList MatList;
13828988994SBarry Smith 
139c06d978dSMatthew Knepley EXTERN PetscFList MatSerializeList;
140c06d978dSMatthew Knepley EXTERN int MatSerializeRegisterAll(const char []);
14165804fbbSSatish Balay EXTERN int MatSerializeRegisterDestroy(void);
142c06d978dSMatthew Knepley EXTERN int MatSerializeRegisterAllCalled;
143c06d978dSMatthew Knepley EXTERN int MatSerialize(MPI_Comm, Mat *, PetscViewer, PetscTruth);
144c06d978dSMatthew Knepley EXTERN int MatSetSerializeType(Mat, MatSerializeType);
145c06d978dSMatthew Knepley 
146ca01db9bSBarry Smith EXTERN int MatCreateSeqDense(MPI_Comm,int,int,PetscScalar[],Mat*);
147ca01db9bSBarry Smith EXTERN int MatCreateMPIDense(MPI_Comm,int,int,int,int,PetscScalar[],Mat*);
148ca01db9bSBarry Smith EXTERN int MatCreateSeqAIJ(MPI_Comm,int,int,int,const int[],Mat*);
149ca01db9bSBarry Smith EXTERN int MatCreateMPIAIJ(MPI_Comm,int,int,int,int,int,const int[],int,const int[],Mat*);
150ca01db9bSBarry Smith EXTERN int MatCreateMPIRowbs(MPI_Comm,int,int,int,const int[],Mat*);
151ca01db9bSBarry Smith EXTERN int MatCreateSeqBDiag(MPI_Comm,int,int,int,int,const int[],PetscScalar*[],Mat*);
152ca01db9bSBarry Smith EXTERN int MatCreateMPIBDiag(MPI_Comm,int,int,int,int,int,const int[],PetscScalar*[],Mat*);
153ca01db9bSBarry Smith EXTERN int MatCreateSeqBAIJ(MPI_Comm,int,int,int,int,const int[],Mat*);
154ca01db9bSBarry Smith EXTERN int MatCreateMPIBAIJ(MPI_Comm,int,int,int,int,int,int,const int[],int,const int[],Mat*);
155ca01db9bSBarry Smith EXTERN int MatCreateMPIAdj(MPI_Comm,int,int,int[],int[],int[],Mat*);
156ca01db9bSBarry Smith EXTERN int MatCreateSeqSBAIJ(MPI_Comm,int,int,int,int,const int[],Mat*);
157ca01db9bSBarry Smith EXTERN int MatCreateMPISBAIJ(MPI_Comm,int,int,int,int,int,int,const int[],int,const int[],Mat*);
158ca44d042SBarry Smith EXTERN int MatCreateShell(MPI_Comm,int,int,int,int,void *,Mat*);
1593a7fca6bSBarry Smith EXTERN int MatCreateAdic(MPI_Comm,int,int,int,int,int,void (*)(void),Mat*);
160c8a8475eSBarry Smith EXTERN int MatCreateNormal(Mat,Mat*);
161435da068SBarry Smith EXTERN int MatDestroy(Mat);
16221c89e3eSBarry Smith 
163ca44d042SBarry Smith EXTERN int MatPrintHelp(Mat);
1648a124369SBarry Smith EXTERN int MatGetPetscMaps(Mat,PetscMap*,PetscMap*);
165ec0117caSBarry Smith 
1668ed539a5SBarry Smith /* ------------------------------------------------------------*/
167f15d580aSBarry Smith EXTERN int MatSetValues(Mat,int,const int[],int,const int[],const PetscScalar[],InsertMode);
168f15d580aSBarry Smith EXTERN int MatSetValuesBlocked(Mat,int,const int[],int,const int[],const PetscScalar[],InsertMode);
16984cb2905SBarry Smith 
1702ef4de8bSBarry Smith /*S
1712ef4de8bSBarry Smith      MatStencil - Data structure (C struct) for storing information about a single row or
1722ef4de8bSBarry Smith         column of a matrix as index on an associated grid.
1732ef4de8bSBarry Smith 
1742ef4de8bSBarry Smith    Level: beginner
1752ef4de8bSBarry Smith 
1762ef4de8bSBarry Smith   Concepts: matrix; linear operator
1772ef4de8bSBarry Smith 
1782ef4de8bSBarry Smith .seealso:  MatSetValuesStencil(), MatSetStencil()
1792ef4de8bSBarry Smith S*/
180435da068SBarry Smith typedef struct {
181435da068SBarry Smith   int k,j,i,c;
182435da068SBarry Smith } MatStencil;
1832ef4de8bSBarry Smith 
184f15d580aSBarry Smith EXTERN int MatSetValuesStencil(Mat,int,const MatStencil[],int,const MatStencil[],const PetscScalar[],InsertMode);
185f15d580aSBarry Smith EXTERN int MatSetValuesBlockedStencil(Mat,int,const MatStencil[],int,const MatStencil[],const PetscScalar[],InsertMode);
186f15d580aSBarry Smith EXTERN int MatSetStencil(Mat,int,const int[],const int[],int);
187435da068SBarry Smith 
1883a7fca6bSBarry Smith EXTERN int MatSetColoring(Mat,ISColoring);
1893a7fca6bSBarry Smith EXTERN int MatSetValuesAdic(Mat,void*);
1903a7fca6bSBarry Smith EXTERN int MatSetValuesAdifor(Mat,int,void*);
1913a7fca6bSBarry Smith 
192d91e6319SBarry Smith /*E
193d91e6319SBarry Smith     MatAssemblyType - Indicates if the matrix is now to be used, or if you plan
194d91e6319SBarry Smith      to continue to add values to it
195d91e6319SBarry Smith 
196d91e6319SBarry Smith     Level: beginner
197d91e6319SBarry Smith 
198d91e6319SBarry Smith .seealso: MatAssemblyBegin(), MatAssemblyEnd()
199d91e6319SBarry Smith E*/
2006d4a8577SBarry Smith typedef enum {MAT_FLUSH_ASSEMBLY=1,MAT_FINAL_ASSEMBLY=0} MatAssemblyType;
201ca44d042SBarry Smith EXTERN int MatAssemblyBegin(Mat,MatAssemblyType);
202ca44d042SBarry Smith EXTERN int MatAssemblyEnd(Mat,MatAssemblyType);
203ca44d042SBarry Smith EXTERN int MatAssembled(Mat,PetscTruth*);
2044f9c727eSBarry Smith 
20530de9b25SBarry Smith /*MC
20630de9b25SBarry Smith    MatSetValue - Set a single entry into a matrix.
20730de9b25SBarry Smith 
20830de9b25SBarry Smith    Synopsis:
20930de9b25SBarry Smith    int MatSetValue(Mat m,int row,int col,PetscScalar value,InsertMode mode);
21030de9b25SBarry Smith 
21130de9b25SBarry Smith    Not collective
21230de9b25SBarry Smith 
21330de9b25SBarry Smith    Input Parameters:
21430de9b25SBarry Smith +  m - the matrix
21530de9b25SBarry Smith .  row - the row location of the entry
21630de9b25SBarry Smith .  col - the column location of the entry
21730de9b25SBarry Smith .  value - the value to insert
21830de9b25SBarry Smith -  mode - either INSERT_VALUES or ADD_VALUES
21930de9b25SBarry Smith 
22030de9b25SBarry Smith    Notes:
22130de9b25SBarry Smith    For efficiency one should use MatSetValues() and set several or many
22230de9b25SBarry Smith    values simultaneously if possible.
22330de9b25SBarry Smith 
22430de9b25SBarry Smith    Note that MatSetValue() does NOT return an error code (since this
22530de9b25SBarry Smith    is checked internally).
22630de9b25SBarry Smith 
22730de9b25SBarry Smith    Level: beginner
22830de9b25SBarry Smith 
22930de9b25SBarry Smith .seealso: MatSetValues(), MatSetValueLocal()
23030de9b25SBarry Smith M*/
231b951964fSBarry Smith #define MatSetValue(v,i,j,va,mode) \
232ea709b57SSatish Balay 0; {int _ierr,_row = i,_col = j; PetscScalar _va = va; \
233b951964fSBarry Smith   _ierr = MatSetValues(v,1,&_row,1,&_col,&_va,mode);CHKERRQ(_ierr); \
234b951964fSBarry Smith }
23530de9b25SBarry Smith 
236ea06a074SBarry Smith #define MatGetValue(v,i,j,va) \
237d91e6319SBarry Smith 0; {int _ierr,_row = i,_col = j; \
238ea06a074SBarry Smith   _ierr = MatGetValues(v,1,&_row,1,&_col,&va);CHKERRQ(_ierr); \
239ea06a074SBarry Smith }
24030de9b25SBarry Smith 
241d91e6319SBarry Smith #define MatSetValueLocal(v,i,j,va,mode) \
242ea709b57SSatish Balay 0; {int _ierr,_row = i,_col = j; PetscScalar _va = va; \
243d91e6319SBarry Smith   _ierr = MatSetValuesLocal(v,1,&_row,1,&_col,&_va,mode);CHKERRQ(_ierr); \
244d91e6319SBarry Smith }
24530de9b25SBarry Smith 
246d91e6319SBarry Smith /*E
247d91e6319SBarry Smith     MatOption - Options that may be set for a matrix and its behavior or storage
248d91e6319SBarry Smith 
249d91e6319SBarry Smith     Level: beginner
250d91e6319SBarry Smith 
2510a835dfdSSatish Balay    Any additions/changes here MUST also be made in include/finclude/petscmat.h
252d91e6319SBarry Smith 
253d91e6319SBarry Smith .seealso: MatSetOption()
254d91e6319SBarry Smith E*/
2556d4a8577SBarry Smith typedef enum {MAT_ROW_ORIENTED=1,MAT_COLUMN_ORIENTED=2,MAT_ROWS_SORTED=4,
2566d4a8577SBarry Smith               MAT_COLUMNS_SORTED=8,MAT_NO_NEW_NONZERO_LOCATIONS=16,
2576d4a8577SBarry Smith               MAT_YES_NEW_NONZERO_LOCATIONS=32,MAT_SYMMETRIC=64,
2586ca9ecd3SBarry Smith               MAT_STRUCTURALLY_SYMMETRIC=65,MAT_NO_NEW_DIAGONALS=66,
2596ca9ecd3SBarry Smith               MAT_YES_NEW_DIAGONALS=67,MAT_INODE_LIMIT_1=68,MAT_INODE_LIMIT_2=69,
2606ca9ecd3SBarry Smith               MAT_INODE_LIMIT_3=70,MAT_INODE_LIMIT_4=71,MAT_INODE_LIMIT_5=72,
2616ca9ecd3SBarry Smith               MAT_IGNORE_OFF_PROC_ENTRIES=73,MAT_ROWS_UNSORTED=74,
2624787f768SSatish Balay               MAT_COLUMNS_UNSORTED=75,MAT_NEW_NONZERO_LOCATION_ERR=76,
2637c922b88SBarry Smith               MAT_NEW_NONZERO_ALLOCATION_ERR=77,MAT_USE_HASH_TABLE=78,
2642bad1931SBarry Smith               MAT_KEEP_ZEROED_ROWS=79,MAT_IGNORE_ZERO_ENTRIES=80,MAT_USE_INODES=81,
265123145dfSKris Buschelman               MAT_DO_NOT_USE_INODES=82} MatOption;
266ca44d042SBarry Smith EXTERN int MatSetOption(Mat,MatOption);
267273d9f13SBarry Smith EXTERN int MatGetType(Mat,MatType*);
26884cb2905SBarry Smith 
269f15d580aSBarry Smith EXTERN int MatGetValues(Mat,int,const int[],int,const int[],PetscScalar[]);
270f15d580aSBarry Smith EXTERN int MatGetRow(Mat,int,int *,int *[],PetscScalar*[]);
271f15d580aSBarry Smith EXTERN int MatRestoreRow(Mat,int,int *,int *[],PetscScalar*[]);
272*4e7234bfSBarry Smith EXTERN int MatGetColumn(Mat,int,int *,int *[],PetscScalar*[]);
273*4e7234bfSBarry Smith EXTERN int MatRestoreColumn(Mat,int,int *,int *[],PetscScalar*[]);
274ca44d042SBarry Smith EXTERN int MatGetColumnVector(Mat,Vec,int);
275*4e7234bfSBarry Smith EXTERN int MatGetArray(Mat,PetscScalar *[]);
276*4e7234bfSBarry Smith EXTERN int MatRestoreArray(Mat,PetscScalar *[]);
277ca44d042SBarry Smith EXTERN int MatGetBlockSize(Mat,int *);
2787b80b807SBarry Smith 
279ca44d042SBarry Smith EXTERN int MatMult(Mat,Vec,Vec);
280ca44d042SBarry Smith EXTERN int MatMultAdd(Mat,Vec,Vec,Vec);
281ca44d042SBarry Smith EXTERN int MatMultTranspose(Mat,Vec,Vec);
282cd0d46ebSvictorle EXTERN int MatIsSymmetric(Mat,Mat,PetscTruth*);
283ca44d042SBarry Smith EXTERN int MatMultTransposeAdd(Mat,Vec,Vec,Vec);
284c06d978dSMatthew Knepley EXTERN int MatMultConstrained(Mat,Vec,Vec);
2856d0dc95fSMatthew Knepley EXTERN int MatMultTransposeConstrained(Mat,Vec,Vec);
2862eac72dbSBarry Smith 
287d91e6319SBarry Smith /*E
288d91e6319SBarry Smith     MatDuplicateOption - Indicates if a duplicated sparse matrix should have
289d91e6319SBarry Smith   its numerical values copied over or just its nonzero structure.
290d91e6319SBarry Smith 
291d91e6319SBarry Smith     Level: beginner
292d91e6319SBarry Smith 
293d91e6319SBarry Smith    Any additions/changes here MUST also be made in include/finclude/petscmat.h
294d91e6319SBarry Smith 
295d91e6319SBarry Smith .seealso: MatDuplicate()
296d91e6319SBarry Smith E*/
2972e8a6d31SBarry Smith typedef enum {MAT_DO_NOT_COPY_VALUES,MAT_COPY_VALUES} MatDuplicateOption;
2982e8a6d31SBarry Smith 
299273d9f13SBarry Smith EXTERN int MatConvertRegister(char*,char*,char*,int (*)(Mat,MatType,Mat*));
300273d9f13SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
301273d9f13SBarry Smith #define MatConvertRegisterDynamic(a,b,c,d) MatConvertRegister(a,b,c,0)
302273d9f13SBarry Smith #else
303273d9f13SBarry Smith #define MatConvertRegisterDynamic(a,b,c,d) MatConvertRegister(a,b,c,d)
304273d9f13SBarry Smith #endif
305273d9f13SBarry Smith EXTERN int        MatConvertRegisterAll(char*);
306273d9f13SBarry Smith EXTERN int        MatConvertRegisterDestroy(void);
307273d9f13SBarry Smith extern PetscTruth MatConvertRegisterAllCalled;
308b0a32e0cSBarry Smith extern PetscFList MatConvertList;
309ca44d042SBarry Smith EXTERN int        MatConvert(Mat,MatType,Mat*);
310ca44d042SBarry Smith EXTERN int        MatDuplicate(Mat,MatDuplicateOption,Mat*);
31194a9d846SBarry Smith 
312d91e6319SBarry Smith /*E
313d91e6319SBarry Smith     MatStructure - Indicates if the matrix has the same nonzero structure
314d91e6319SBarry Smith 
315d91e6319SBarry Smith     Level: beginner
316d91e6319SBarry Smith 
317d91e6319SBarry Smith    Any additions/changes here MUST also be made in include/finclude/petscmat.h
318d91e6319SBarry Smith 
319d91e6319SBarry Smith .seealso: MatCopy(), SLESSetOperators(), PCSetOperators()
320d91e6319SBarry Smith E*/
321c537a176SHong Zhang typedef enum {SAME_NONZERO_PATTERN,DIFFERENT_NONZERO_PATTERN,SAME_PRECONDITIONER,SUBSET_NONZERO_PATTERN} MatStructure;
322cb5b572fSBarry Smith 
323ca44d042SBarry Smith EXTERN int MatCopy(Mat,Mat,MatStructure);
324b0a32e0cSBarry Smith EXTERN int MatView(Mat,PetscViewer);
325273d9f13SBarry Smith 
326b0a32e0cSBarry Smith EXTERN int MatLoadRegister(char*,char*,char*,int (*)(PetscViewer,MatType,Mat*));
327273d9f13SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
328273d9f13SBarry Smith #define MatLoadRegisterDynamic(a,b,c,d) MatLoadRegister(a,b,c,0)
329273d9f13SBarry Smith #else
330273d9f13SBarry Smith #define MatLoadRegisterDynamic(a,b,c,d) MatLoadRegister(a,b,c,d)
331273d9f13SBarry Smith #endif
332273d9f13SBarry Smith EXTERN int        MatLoadRegisterAll(char*);
333273d9f13SBarry Smith EXTERN int        MatLoadRegisterDestroy(void);
334273d9f13SBarry Smith extern PetscTruth MatLoadRegisterAllCalled;
335b0a32e0cSBarry Smith extern PetscFList MatLoadList;
336b0a32e0cSBarry Smith EXTERN int        MatLoad(PetscViewer,MatType,Mat*);
33751dd7536SBarry Smith EXTERN int        MatMerge(MPI_Comm,Mat,Mat*);
3387b80b807SBarry Smith 
339*4e7234bfSBarry Smith EXTERN int MatGetRowIJ(Mat,int,PetscTruth,int*,int *[],int *[],PetscTruth *);
340*4e7234bfSBarry Smith EXTERN int MatRestoreRowIJ(Mat,int,PetscTruth,int *,int *[],int *[],PetscTruth *);
341*4e7234bfSBarry Smith EXTERN int MatGetColumnIJ(Mat,int,PetscTruth,int*,int *[],int *[],PetscTruth *);
342*4e7234bfSBarry Smith EXTERN int MatRestoreColumnIJ(Mat,int,PetscTruth,int *,int *[],int *[],PetscTruth *);
343d4fbbf0eSBarry Smith 
344d91e6319SBarry Smith /*S
345d91e6319SBarry Smith      MatInfo - Context of matrix information, used with MatGetInfo()
346d91e6319SBarry Smith 
347d91e6319SBarry Smith    In Fortran this is simply a double precision array of dimension MAT_INFO_SIZE
348d91e6319SBarry Smith 
349d91e6319SBarry Smith    Level: intermediate
350d91e6319SBarry Smith 
351d91e6319SBarry Smith   Concepts: matrix^nonzero information
352d91e6319SBarry Smith 
353d9274352SBarry Smith .seealso:  MatGetInfo(), MatInfoType
354d91e6319SBarry Smith S*/
3554e220ebcSLois Curfman McInnes typedef struct {
356b0a32e0cSBarry Smith   PetscLogDouble rows_global,columns_global;         /* number of global rows and columns */
357b0a32e0cSBarry Smith   PetscLogDouble rows_local,columns_local;           /* number of local rows and columns */
358b0a32e0cSBarry Smith   PetscLogDouble block_size;                         /* block size */
359b0a32e0cSBarry Smith   PetscLogDouble nz_allocated,nz_used,nz_unneeded;   /* number of nonzeros */
360b0a32e0cSBarry Smith   PetscLogDouble memory;                             /* memory allocated */
361b0a32e0cSBarry Smith   PetscLogDouble assemblies;                         /* number of matrix assemblies called */
362b0a32e0cSBarry Smith   PetscLogDouble mallocs;                            /* number of mallocs during MatSetValues() */
363b0a32e0cSBarry Smith   PetscLogDouble fill_ratio_given,fill_ratio_needed; /* fill ratio for LU/ILU */
364b0a32e0cSBarry Smith   PetscLogDouble factor_mallocs;                     /* number of mallocs during factorization */
3654e220ebcSLois Curfman McInnes } MatInfo;
3664e220ebcSLois Curfman McInnes 
367d9274352SBarry Smith /*E
368d9274352SBarry Smith     MatInfoType - Indicates if you want information about the local part of the matrix,
369d9274352SBarry Smith      the entire parallel matrix or the maximum over all the local parts.
370d9274352SBarry Smith 
371d9274352SBarry Smith     Level: beginner
372d9274352SBarry Smith 
373d9274352SBarry Smith    Any additions/changes here MUST also be made in include/finclude/petscmat.h
374d9274352SBarry Smith 
375d9274352SBarry Smith .seealso: MatGetInfo(), MatInfo
376d9274352SBarry Smith E*/
3777b80b807SBarry Smith typedef enum {MAT_LOCAL=1,MAT_GLOBAL_MAX=2,MAT_GLOBAL_SUM=3} MatInfoType;
378ca44d042SBarry Smith EXTERN int MatGetInfo(Mat,MatInfoType,MatInfo*);
379ca44d042SBarry Smith EXTERN int MatValid(Mat,PetscTruth*);
380ca44d042SBarry Smith EXTERN int MatGetDiagonal(Mat,Vec);
381273d9f13SBarry Smith EXTERN int MatGetRowMax(Mat,Vec);
382ca44d042SBarry Smith EXTERN int MatTranspose(Mat,Mat*);
383ca44d042SBarry Smith EXTERN int MatPermute(Mat,IS,IS,Mat *);
384bf1d55d4SSatish Balay EXTERN int MatPermuteSparsify(Mat,int,PetscReal,PetscReal,IS,IS,Mat *);
385ca44d042SBarry Smith EXTERN int MatDiagonalScale(Mat,Vec,Vec);
38606ef90c2SBarry Smith EXTERN int MatDiagonalSet(Mat,Vec,InsertMode);
387ca44d042SBarry Smith EXTERN int MatEqual(Mat,Mat,PetscTruth*);
3887b80b807SBarry Smith 
38987828ca2SBarry Smith EXTERN int MatNorm(Mat,NormType,PetscReal *);
390ca44d042SBarry Smith EXTERN int MatZeroEntries(Mat);
391268466fbSBarry Smith EXTERN int MatZeroRows(Mat,IS,const PetscScalar*);
392268466fbSBarry Smith EXTERN int MatZeroColumns(Mat,IS,const PetscScalar*);
3937b80b807SBarry Smith 
394ca44d042SBarry Smith EXTERN int MatUseScaledForm(Mat,PetscTruth);
395ca44d042SBarry Smith EXTERN int MatScaleSystem(Mat,Vec,Vec);
396ca44d042SBarry Smith EXTERN int MatUnScaleSystem(Mat,Vec,Vec);
3975ef9f2a5SBarry Smith 
398ca44d042SBarry Smith EXTERN int MatGetSize(Mat,int*,int*);
399ca44d042SBarry Smith EXTERN int MatGetLocalSize(Mat,int*,int*);
400ca44d042SBarry Smith EXTERN int MatGetOwnershipRange(Mat,int*,int*);
4017b80b807SBarry Smith 
402d91e6319SBarry Smith /*E
403d91e6319SBarry Smith     MatReuse - Indicates if matrices obtained from a previous call to MatGetSubMatrices()
404d91e6319SBarry Smith      or MatGetSubMatrix() are to be reused to store the new matrix values.
405d91e6319SBarry Smith 
406d91e6319SBarry Smith     Level: beginner
407d91e6319SBarry Smith 
408d91e6319SBarry Smith    Any additions/changes here MUST also be made in include/finclude/petscmat.h
409d91e6319SBarry Smith 
410d91e6319SBarry Smith .seealso: MatGetSubMatrices(), MatGetSubMatrix(), MatDestroyMatrices()
411d91e6319SBarry Smith E*/
4127b2a1423SBarry Smith typedef enum {MAT_INITIAL_MATRIX,MAT_REUSE_MATRIX} MatReuse;
413268466fbSBarry Smith EXTERN int MatGetSubMatrices(Mat,int,const IS[],const IS[],MatReuse,Mat *[]);
414268466fbSBarry Smith EXTERN int MatDestroyMatrices(int,Mat *[]);
415ca44d042SBarry Smith EXTERN int MatGetSubMatrix(Mat,IS,IS,int,MatReuse,Mat *);
4168efafbd8SBarry Smith 
417268466fbSBarry Smith EXTERN int MatIncreaseOverlap(Mat,int,IS[],int);
4187b80b807SBarry Smith 
419268466fbSBarry Smith EXTERN int MatAXPY(const PetscScalar *,Mat,Mat,MatStructure);
420268466fbSBarry Smith EXTERN int MatAYPX(const PetscScalar *,Mat,Mat);
421ca44d042SBarry Smith EXTERN int MatCompress(Mat);
4227b80b807SBarry Smith 
423268466fbSBarry Smith EXTERN int MatScale(const PetscScalar *,Mat);
424268466fbSBarry Smith EXTERN int MatShift(const PetscScalar *,Mat);
425052efed2SBarry Smith 
426ca44d042SBarry Smith EXTERN int MatSetLocalToGlobalMapping(Mat,ISLocalToGlobalMapping);
427ca44d042SBarry Smith EXTERN int MatSetLocalToGlobalMappingBlock(Mat,ISLocalToGlobalMapping);
428268466fbSBarry Smith EXTERN int MatZeroRowsLocal(Mat,IS,const PetscScalar*);
429f15d580aSBarry Smith EXTERN int MatSetValuesLocal(Mat,int,const int[],int,const int[],const PetscScalar[],InsertMode);
430f15d580aSBarry Smith EXTERN int MatSetValuesBlockedLocal(Mat,int,const int[],int,const int[],const PetscScalar[],InsertMode);
43190f02eecSBarry Smith 
432ca44d042SBarry Smith EXTERN int MatSetStashInitialSize(Mat,int,int);
433649db694SBarry Smith 
434ca44d042SBarry Smith EXTERN int MatInterpolateAdd(Mat,Vec,Vec,Vec);
435ca44d042SBarry Smith EXTERN int MatInterpolate(Mat,Vec,Vec);
436ca44d042SBarry Smith EXTERN int MatRestrict(Mat,Vec,Vec);
4377c922b88SBarry Smith 
438bd481603SBarry Smith 
439bd481603SBarry Smith /*MC
440bd481603SBarry Smith    MatPreallocInitialize - Begins the block of code that will count the number of nonzeros per
441bd481603SBarry Smith        row in a matrix providing the data that one can use to correctly preallocate the matrix.
442bd481603SBarry Smith 
443bd481603SBarry Smith    Synopsis:
444bd481603SBarry Smith    int MatPreallocateInitialize(MPI_Comm comm, int nrows, int ncols, int *dnz, int *onz)
445bd481603SBarry Smith 
446bd481603SBarry Smith    Collective on MPI_Comm
447bd481603SBarry Smith 
448bd481603SBarry Smith    Input Parameters:
449bd481603SBarry Smith +  comm - the communicator that will share the eventually allocated matrix
450bd481603SBarry Smith .  nrows - the number of rows in the matrix
451bd481603SBarry Smith -  ncols - the number of columns in the matrix
452bd481603SBarry Smith 
453bd481603SBarry Smith    Output Parameters:
454bd481603SBarry Smith +  dnz - the array that will be passed to the matrix preallocation routines
455bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
456bd481603SBarry Smith 
457bd481603SBarry Smith 
458bd481603SBarry Smith    Level: intermediate
459bd481603SBarry Smith 
460bd481603SBarry Smith    Notes:
461bd481603SBarry Smith    See the chapter in the users manual on performance for more details
462bd481603SBarry Smith 
463bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
464bd481603SBarry Smith 
465bd481603SBarry Smith    Use MatPreallocateInitializeSymmetric() for symmetric matrices (MPISBAIJ matrices)
466bd481603SBarry Smith 
467bd481603SBarry Smith   Concepts: preallocation^Matrix
468bd481603SBarry Smith 
469bd481603SBarry Smith .seealso: MatPreallocateFinalize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateSetLocal(),
470bd481603SBarry Smith           MatPreallocateInitializeSymmetric(), MatPreallocateSymmetricSetLocal()
471bd481603SBarry Smith M*/
472c4f061fbSSatish Balay #define MatPreallocateInitialize(comm,nrows,ncols,dnz,onz) 0; \
4737c922b88SBarry Smith { \
474ef66eb69SBarry Smith   int _4_ierr,__tmp = (nrows),__ctmp = (ncols),__rstart,__start,__end; \
475ef66eb69SBarry Smith   _4_ierr = PetscMalloc(2*__tmp*sizeof(int),&dnz);CHKERRQ(_4_ierr);onz = dnz + __tmp;\
476ef66eb69SBarry Smith   _4_ierr = PetscMemzero(dnz,2*__tmp*sizeof(int));CHKERRQ(_4_ierr);\
477ef66eb69SBarry Smith   _4_ierr = MPI_Scan(&__ctmp,&__end,1,MPI_INT,MPI_SUM,comm);CHKERRQ(_4_ierr); __start = __end - __ctmp;\
478ef66eb69SBarry Smith   _4_ierr = MPI_Scan(&__tmp,&__rstart,1,MPI_INT,MPI_SUM,comm);CHKERRQ(_4_ierr); __rstart = __rstart - __tmp;
4797c922b88SBarry Smith 
480bd481603SBarry Smith /*MC
481bd481603SBarry Smith    MatPreallocSymmetricInitialize - Begins the block of code that will count the number of nonzeros per
482bd481603SBarry Smith        row in a matrix providing the data that one can use to correctly preallocate the matrix.
483bd481603SBarry Smith 
484bd481603SBarry Smith    Synopsis:
485bd481603SBarry Smith    int MatPreallocateSymmetricInitialize(MPI_Comm comm, int nrows, int ncols, int *dnz, int *onz)
486bd481603SBarry Smith 
487bd481603SBarry Smith    Collective on MPI_Comm
488bd481603SBarry Smith 
489bd481603SBarry Smith    Input Parameters:
490bd481603SBarry Smith +  comm - the communicator that will share the eventually allocated matrix
491bd481603SBarry Smith .  nrows - the number of rows in the matrix
492bd481603SBarry Smith -  ncols - the number of columns in the matrix
493bd481603SBarry Smith 
494bd481603SBarry Smith    Output Parameters:
495bd481603SBarry Smith +  dnz - the array that will be passed to the matrix preallocation routines
496bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
497bd481603SBarry Smith 
498bd481603SBarry Smith 
499bd481603SBarry Smith    Level: intermediate
500bd481603SBarry Smith 
501bd481603SBarry Smith    Notes:
502bd481603SBarry Smith    See the chapter in the users manual on performance for more details
503bd481603SBarry Smith 
504bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
505bd481603SBarry Smith 
506bd481603SBarry Smith   Concepts: preallocation^Matrix
507bd481603SBarry Smith 
508bd481603SBarry Smith .seealso: MatPreallocateFinalize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateSetLocal(),
509bd481603SBarry Smith           MatPreallocateInitialize(), MatPreallocateSymmetricSetLocal()
510bd481603SBarry Smith M*/
511222b16d4SBarry Smith #define MatPreallocateSymmetricInitialize(comm,nrows,ncols,dnz,onz) 0; \
512222b16d4SBarry Smith { \
513222b16d4SBarry Smith   int _4_ierr,__tmp = (nrows),__ctmp = (ncols),__rstart,__end; \
514222b16d4SBarry Smith   _4_ierr = PetscMalloc(2*__tmp*sizeof(int),&dnz);CHKERRQ(_4_ierr);onz = dnz + __tmp;\
515222b16d4SBarry Smith   _4_ierr = PetscMemzero(dnz,2*__tmp*sizeof(int));CHKERRQ(_4_ierr);\
516222b16d4SBarry Smith   _4_ierr = MPI_Scan(&__ctmp,&__end,1,MPI_INT,MPI_SUM,comm);CHKERRQ(_4_ierr);\
517222b16d4SBarry Smith   _4_ierr = MPI_Scan(&__tmp,&__rstart,1,MPI_INT,MPI_SUM,comm);CHKERRQ(_4_ierr); __rstart = __rstart - __tmp;
518222b16d4SBarry Smith 
519bd481603SBarry Smith /*MC
520bd481603SBarry Smith    MatPreallocateSetLocal - Indicates the locations (rows and columns) in the matrix where nonzeros will be
521bd481603SBarry Smith        inserted using a local number of the rows and columns
522bd481603SBarry Smith 
523bd481603SBarry Smith    Synopsis:
524bd481603SBarry Smith    int MatPreallocateSetLocal(ISLocalToGlobalMappping map,int nrows, int *rows,int ncols, int *cols,int *dnz, int *onz)
525bd481603SBarry Smith 
526bd481603SBarry Smith    Not Collective
527bd481603SBarry Smith 
528bd481603SBarry Smith    Input Parameters:
529bd481603SBarry Smith +  map - the mapping between local numbering and global numbering
530bd481603SBarry Smith .  nrows - the number of rows indicated
531bd481603SBarry Smith .  rows - the indices of the rows (these will be mapped in the
532bd481603SBarry Smith .  ncols - the number of columns in the matrix
533bd481603SBarry Smith .  cols - the columns indicated
534bd481603SBarry Smith .  dnz - the array that will be passed to the matrix preallocation routines
535bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
536bd481603SBarry Smith 
537bd481603SBarry Smith 
538bd481603SBarry Smith    Level: intermediate
539bd481603SBarry Smith 
540bd481603SBarry Smith    Notes:
541bd481603SBarry Smith    See the chapter in the users manual on performance for more details
542bd481603SBarry Smith 
543bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
544bd481603SBarry Smith 
545bd481603SBarry Smith   Concepts: preallocation^Matrix
546bd481603SBarry Smith 
547bd481603SBarry Smith .seealso: MatPreallocateFinalize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateInitialize(),
548bd481603SBarry Smith           MatPreallocateInitialize(), MatPreallocateSymmetricSetLocal()
549bd481603SBarry Smith M*/
550c4f061fbSSatish Balay #define MatPreallocateSetLocal(map,nrows,rows,ncols,cols,dnz,onz) 0;\
551c4f061fbSSatish Balay {\
552c4f061fbSSatish Balay   int __l;\
553ef66eb69SBarry Smith   _4_ierr = ISLocalToGlobalMappingApply(map,nrows,rows,rows);CHKERRQ(_4_ierr);\
554ef66eb69SBarry Smith   _4_ierr = ISLocalToGlobalMappingApply(map,ncols,cols,cols);CHKERRQ(_4_ierr);\
555c4f061fbSSatish Balay   for (__l=0;__l<nrows;__l++) {\
556ef66eb69SBarry Smith     _4_ierr = MatPreallocateSet((rows)[__l],ncols,cols,dnz,onz);CHKERRQ(_4_ierr);\
557c4f061fbSSatish Balay   }\
558c4f061fbSSatish Balay }
559c4f061fbSSatish Balay 
560bd481603SBarry Smith /*MC
561bd481603SBarry Smith    MatPreallocateSymmetricSetLocal - Indicates the locations (rows and columns) in the matrix where nonzeros will be
562bd481603SBarry Smith        inserted using a local number of the rows and columns
563bd481603SBarry Smith 
564bd481603SBarry Smith    Synopsis:
565bd481603SBarry Smith    int MatPreallocateSymmetricSetLocal(ISLocalToGlobalMappping map,int nrows, int *rows,int ncols, int *cols,int *dnz, int *onz)
566bd481603SBarry Smith 
567bd481603SBarry Smith    Not Collective
568bd481603SBarry Smith 
569bd481603SBarry Smith    Input Parameters:
570bd481603SBarry Smith +  map - the mapping between local numbering and global numbering
571bd481603SBarry Smith .  nrows - the number of rows indicated
572bd481603SBarry Smith .  rows - the indices of the rows (these will be mapped in the
573bd481603SBarry Smith .  ncols - the number of columns in the matrix
574bd481603SBarry Smith .  cols - the columns indicated
575bd481603SBarry Smith .  dnz - the array that will be passed to the matrix preallocation routines
576bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
577bd481603SBarry Smith 
578bd481603SBarry Smith 
579bd481603SBarry Smith    Level: intermediate
580bd481603SBarry Smith 
581bd481603SBarry Smith    Notes:
582bd481603SBarry Smith    See the chapter in the users manual on performance for more details
583bd481603SBarry Smith 
584bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
585bd481603SBarry Smith 
586bd481603SBarry Smith   Concepts: preallocation^Matrix
587bd481603SBarry Smith 
588bd481603SBarry Smith .seealso: MatPreallocateFinalize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateInitialize(),
589bd481603SBarry Smith           MatPreallocateInitialize(), MatPreallocateSymmetricSetLocal(), MatPreallocateSetLocal()
590bd481603SBarry Smith M*/
591d3d32019SBarry Smith #define MatPreallocateSymmetricSetLocal(map,nrows,rows,ncols,cols,dnz,onz) 0;\
592d3d32019SBarry Smith {\
593d3d32019SBarry Smith   int __l;\
594d3d32019SBarry Smith   _4_ierr = ISLocalToGlobalMappingApply(map,nrows,rows,rows);CHKERRQ(_4_ierr);\
595d3d32019SBarry Smith   _4_ierr = ISLocalToGlobalMappingApply(map,ncols,cols,cols);CHKERRQ(_4_ierr);\
596d3d32019SBarry Smith   for (__l=0;__l<nrows;__l++) {\
597d3d32019SBarry Smith     _4_ierr = MatPreallocateSymmetricSet((rows)[__l],ncols,cols,dnz,onz);CHKERRQ(_4_ierr);\
598d3d32019SBarry Smith   }\
599d3d32019SBarry Smith }
600d3d32019SBarry Smith 
601bd481603SBarry Smith /*MC
602bd481603SBarry Smith    MatPreallocateSet - Indicates the locations (rows and columns) in the matrix where nonzeros will be
603bd481603SBarry Smith        inserted using a local number of the rows and columns
604bd481603SBarry Smith 
605bd481603SBarry Smith    Synopsis:
606bd481603SBarry Smith    int MatPreallocateSet(int nrows, int *rows,int ncols, int *cols,int *dnz, int *onz)
607bd481603SBarry Smith 
608bd481603SBarry Smith    Not Collective
609bd481603SBarry Smith 
610bd481603SBarry Smith    Input Parameters:
611bd481603SBarry Smith +  nrows - the number of rows indicated
612bd481603SBarry Smith .  rows - the indices of the rows (these will be mapped in the
613bd481603SBarry Smith .  ncols - the number of columns in the matrix
614bd481603SBarry Smith .  cols - the columns indicated
615bd481603SBarry Smith .  dnz - the array that will be passed to the matrix preallocation routines
616bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
617bd481603SBarry Smith 
618bd481603SBarry Smith 
619bd481603SBarry Smith    Level: intermediate
620bd481603SBarry Smith 
621bd481603SBarry Smith    Notes:
622bd481603SBarry Smith    See the chapter in the users manual on performance for more details
623bd481603SBarry Smith 
624bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
625bd481603SBarry Smith 
626bd481603SBarry Smith   Concepts: preallocation^Matrix
627bd481603SBarry Smith 
628bd481603SBarry Smith .seealso: MatPreallocateFinalize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateInitialize(),
629bd481603SBarry Smith           MatPreallocateInitialize(), MatPreallocateSymmetricSetLocal(), MatPreallocateSetLocal()
630bd481603SBarry Smith M*/
631c4f061fbSSatish Balay #define MatPreallocateSet(row,nc,cols,dnz,onz) 0;\
6327c922b88SBarry Smith { int __i; \
6337c922b88SBarry Smith   for (__i=0; __i<nc; __i++) {\
6347c922b88SBarry Smith     if (cols[__i] < __start || cols[__i] >= __end) onz[row - __rstart]++; \
6357c922b88SBarry Smith   }\
6367c922b88SBarry Smith   dnz[row - __rstart] = nc - onz[row - __rstart];\
6377c922b88SBarry Smith }
6387c922b88SBarry Smith 
639bd481603SBarry Smith /*MC
640bd481603SBarry Smith    MatPreallocateSymmetricSet - Indicates the locations (rows and columns) in the matrix where nonzeros will be
641bd481603SBarry Smith        inserted using a local number of the rows and columns
642bd481603SBarry Smith 
643bd481603SBarry Smith    Synopsis:
644bd481603SBarry Smith    int MatPreallocateSymmetricSet(int nrows, int *rows,int ncols, int *cols,int *dnz, int *onz)
645bd481603SBarry Smith 
646bd481603SBarry Smith    Not Collective
647bd481603SBarry Smith 
648bd481603SBarry Smith    Input Parameters:
649bd481603SBarry Smith +  nrows - the number of rows indicated
650bd481603SBarry Smith .  rows - the indices of the rows (these will be mapped in the
651bd481603SBarry Smith .  ncols - the number of columns in the matrix
652bd481603SBarry Smith .  cols - the columns indicated
653bd481603SBarry Smith .  dnz - the array that will be passed to the matrix preallocation routines
654bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
655bd481603SBarry Smith 
656bd481603SBarry Smith 
657bd481603SBarry Smith    Level: intermediate
658bd481603SBarry Smith 
659bd481603SBarry Smith    Notes:
660bd481603SBarry Smith    See the chapter in the users manual on performance for more details
661bd481603SBarry Smith 
662bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
663bd481603SBarry Smith 
664bd481603SBarry Smith   Concepts: preallocation^Matrix
665bd481603SBarry Smith 
666bd481603SBarry Smith .seealso: MatPreallocateFinalize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateInitialize(),
667bd481603SBarry Smith           MatPreallocateInitialize(), MatPreallocateSymmetricSetLocal(), MatPreallocateSetLocal()
668bd481603SBarry Smith M*/
669d3d32019SBarry Smith #define MatPreallocateSymmetricSet(row,nc,cols,dnz,onz) 0;\
670d3d32019SBarry Smith { int __i; \
671d3d32019SBarry Smith   for (__i=0; __i<nc; __i++) {\
672d3d32019SBarry Smith     if (cols[__i] >= __end) onz[row - __rstart]++; \
673d3d32019SBarry Smith     else if (cols[__i] >= row) dnz[row - __rstart]++;\
674d3d32019SBarry Smith   }\
675d3d32019SBarry Smith }
676d3d32019SBarry Smith 
677bd481603SBarry Smith /*MC
678bd481603SBarry Smith    MatPreallocFinalize - Ends the block of code that will count the number of nonzeros per
679bd481603SBarry Smith        row in a matrix providing the data that one can use to correctly preallocate the matrix.
680bd481603SBarry Smith 
681bd481603SBarry Smith    Synopsis:
682bd481603SBarry Smith    int MatPreallocateFinalize(int *dnz, int *onz)
683bd481603SBarry Smith 
684bd481603SBarry Smith    Collective on MPI_Comm
685bd481603SBarry Smith 
686bd481603SBarry Smith    Input Parameters:
687bd481603SBarry Smith +  dnz - the array that will be passed to the matrix preallocation routines
688bd481603SBarry Smith -  ozn - the other array passed to the matrix preallocation routines
689bd481603SBarry Smith 
690bd481603SBarry Smith 
691bd481603SBarry Smith    Level: intermediate
692bd481603SBarry Smith 
693bd481603SBarry Smith    Notes:
694bd481603SBarry Smith    See the chapter in the users manual on performance for more details
695bd481603SBarry Smith 
696bd481603SBarry Smith    Do not malloc or free dnz and onz that is handled internally by these routines
697bd481603SBarry Smith 
698bd481603SBarry Smith   Concepts: preallocation^Matrix
699bd481603SBarry Smith 
700bd481603SBarry Smith .seealso: MatPreallocateInitialize(), MatPreallocateSet(), MatPreallocateSymmetricSet(), MatPreallocateSetLocal(),
701bd481603SBarry Smith           MatPreallocateSymmetricInitialize(), MatPreallocateSymmetricSetLocal()
702bd481603SBarry Smith M*/
703ef66eb69SBarry Smith #define MatPreallocateFinalize(dnz,onz) 0;_4_ierr = PetscFree(dnz);CHKERRQ(_4_ierr);}
7047c922b88SBarry Smith 
705bd481603SBarry Smith 
706bd481603SBarry Smith 
7077b80b807SBarry Smith /* Routines unique to particular data structures */
708435da068SBarry Smith EXTERN int MatShellGetContext(Mat,void **);
709435da068SBarry Smith 
710268466fbSBarry Smith EXTERN int MatBDiagGetData(Mat,int*,int*,int*[],int*[],PetscScalar***);
711ca01db9bSBarry Smith EXTERN int MatSeqAIJSetColumnIndices(Mat,int[]);
712ca01db9bSBarry Smith EXTERN int MatSeqBAIJSetColumnIndices(Mat,int[]);
713ca01db9bSBarry Smith EXTERN int MatCreateSeqAIJWithArrays(MPI_Comm,int,int,int[],int[],PetscScalar[],Mat*);
7147b80b807SBarry Smith 
715ca01db9bSBarry Smith EXTERN int MatSeqBAIJSetPreallocation(Mat,int,int,const int[]);
716ca01db9bSBarry Smith EXTERN int MatSeqSBAIJSetPreallocation(Mat,int,int,const int[]);
717ca01db9bSBarry Smith EXTERN int MatSeqAIJSetPreallocation(Mat,int,const int[]);
718ca01db9bSBarry Smith EXTERN int MatSeqDensePreallocation(Mat,PetscScalar[]);
719ca01db9bSBarry Smith EXTERN int MatSeqBDiagSetPreallocation(Mat,int,int,const int[],PetscScalar*[]);
720ca01db9bSBarry Smith EXTERN int MatSeqDenseSetPreallocation(Mat,PetscScalar[]);
721273d9f13SBarry Smith 
722ca01db9bSBarry Smith EXTERN int MatMPIBAIJSetPreallocation(Mat,int,int,const int[],int,const int[]);
723ca01db9bSBarry Smith EXTERN int MatMPISBAIJSetPreallocation(Mat,int,int,const int[],int,const int[]);
724ca01db9bSBarry Smith EXTERN int MatMPIAIJSetPreallocation(Mat,int,const int[],int,const int[]);
725ca01db9bSBarry Smith EXTERN int MatMPIDensePreallocation(Mat,PetscScalar[]);
726ca01db9bSBarry Smith EXTERN int MatMPIBDiagSetPreallocation(Mat,int,int,const int[],PetscScalar*[]);
727ca01db9bSBarry Smith EXTERN int MatMPIAdjSetPreallocation(Mat,int[],int[],int[]);
728ca01db9bSBarry Smith EXTERN int MatMPIDenseSetPreallocation(Mat,PetscScalar[]);
729ca01db9bSBarry Smith EXTERN int MatMPIRowbsSetPreallocation(Mat,int,const int[]);
730268466fbSBarry Smith EXTERN int MatMPIAIJGetSeqAIJ(Mat,Mat*,Mat*,int*[]);
731268466fbSBarry Smith EXTERN int MatMPIBAIJGetSeqBAIJ(Mat,Mat*,Mat*,int*[]);
7323a7fca6bSBarry Smith EXTERN int MatAdicSetLocalFunction(Mat,void (*)(void));
733273d9f13SBarry Smith 
7341b807ce4Svictorle EXTERN int MatSeqDenseSetLDA(Mat,int);
7351b807ce4Svictorle 
736ca44d042SBarry Smith EXTERN int MatStoreValues(Mat);
737ca44d042SBarry Smith EXTERN int MatRetrieveValues(Mat);
7382e8a6d31SBarry Smith 
7393a7fca6bSBarry Smith EXTERN int MatDAADSetCtx(Mat,void*);
7403a7fca6bSBarry Smith 
7417b80b807SBarry Smith /*
7427b80b807SBarry Smith   These routines are not usually accessed directly, rather solving is
7437b80b807SBarry Smith   done through the SLES, KSP and PC interfaces.
7447b80b807SBarry Smith */
7457b80b807SBarry Smith 
746d9274352SBarry Smith /*E
747d9274352SBarry Smith     MatOrderingType - String with the name of a PETSc matrix ordering or the creation function
748d9274352SBarry Smith        with an optional dynamic library name, for example
749d9274352SBarry Smith        http://www.mcs.anl.gov/petsc/lib.a:orderingcreate()
750d9274352SBarry Smith 
751d9274352SBarry Smith    Level: beginner
752d9274352SBarry Smith 
753d9274352SBarry Smith .seealso: MatGetOrdering()
754d9274352SBarry Smith E*/
755b12f92e5SBarry Smith typedef char* MatOrderingType;
756b12f92e5SBarry Smith #define MATORDERING_NATURAL   "natural"
757b12f92e5SBarry Smith #define MATORDERING_ND        "nd"
758b12f92e5SBarry Smith #define MATORDERING_1WD       "1wd"
759b12f92e5SBarry Smith #define MATORDERING_RCM       "rcm"
760b12f92e5SBarry Smith #define MATORDERING_QMD       "qmd"
761b12f92e5SBarry Smith #define MATORDERING_ROWLENGTH "rowlength"
76262152c8bSBarry Smith #define MATORDERING_DSC_ND    "dsc_nd"
76362152c8bSBarry Smith #define MATORDERING_DSC_MMD   "dsc_mmd"
76462152c8bSBarry Smith #define MATORDERING_DSC_MDF   "dsc_mdf"
765c06d978dSMatthew Knepley #define MATORDERING_CONSTRAINED "constrained"
766c06d978dSMatthew Knepley #define MATORDERING_IDENTITY  "identity"
767c06d978dSMatthew Knepley #define MATORDERING_REVERSE   "reverse"
768b12f92e5SBarry Smith 
769ca44d042SBarry Smith EXTERN int MatGetOrdering(Mat,MatOrderingType,IS*,IS*);
770ca44d042SBarry Smith EXTERN int MatOrderingRegister(char*,char*,char*,int(*)(Mat,MatOrderingType,IS*,IS*));
77130de9b25SBarry Smith 
77230de9b25SBarry Smith /*MC
77330de9b25SBarry Smith    MatOrderingRegisterDynamic - Adds a new sparse matrix ordering to the
77430de9b25SBarry Smith                                matrix package.
77530de9b25SBarry Smith 
77630de9b25SBarry Smith    Synopsis:
77730de9b25SBarry Smith    int MatOrderingRegisterDynamic(char *name_ordering,char *path,char *name_create,int (*routine_create)(MatOrdering))
77830de9b25SBarry Smith 
77930de9b25SBarry Smith    Not Collective
78030de9b25SBarry Smith 
78130de9b25SBarry Smith    Input Parameters:
78230de9b25SBarry Smith +  sname - name of ordering (for example MATORDERING_ND)
78330de9b25SBarry Smith .  path - location of library where creation routine is
78430de9b25SBarry Smith .  name - name of function that creates the ordering type,a string
78530de9b25SBarry Smith -  function - function pointer that creates the ordering
78630de9b25SBarry Smith 
78730de9b25SBarry Smith    Level: developer
78830de9b25SBarry Smith 
78930de9b25SBarry Smith    If dynamic libraries are used, then the fourth input argument (function)
79030de9b25SBarry Smith    is ignored.
79130de9b25SBarry Smith 
79230de9b25SBarry Smith    Sample usage:
79330de9b25SBarry Smith .vb
79430de9b25SBarry Smith    MatOrderingRegisterDynamic("my_order",/home/username/my_lib/lib/libO/solaris/mylib.a,
79530de9b25SBarry Smith                "MyOrder",MyOrder);
79630de9b25SBarry Smith .ve
79730de9b25SBarry Smith 
79830de9b25SBarry Smith    Then, your partitioner can be chosen with the procedural interface via
79930de9b25SBarry Smith $     MatOrderingSetType(part,"my_order)
80030de9b25SBarry Smith    or at runtime via the option
80130de9b25SBarry Smith $     -pc_ilu_mat_ordering_type my_order
80230de9b25SBarry Smith $     -pc_lu_mat_ordering_type my_order
80330de9b25SBarry Smith 
80430de9b25SBarry Smith    ${PETSC_ARCH} and ${BOPT} occuring in pathname will be replaced with appropriate values.
80530de9b25SBarry Smith 
80630de9b25SBarry Smith .keywords: matrix, ordering, register
80730de9b25SBarry Smith 
80830de9b25SBarry Smith .seealso: MatOrderingRegisterDestroy(), MatOrderingRegisterAll()
80930de9b25SBarry Smith M*/
810aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
811f1af5d2fSBarry Smith #define MatOrderingRegisterDynamic(a,b,c,d) MatOrderingRegister(a,b,c,0)
812b12f92e5SBarry Smith #else
813f1af5d2fSBarry Smith #define MatOrderingRegisterDynamic(a,b,c,d) MatOrderingRegister(a,b,c,d)
814b12f92e5SBarry Smith #endif
81530de9b25SBarry Smith 
816ca44d042SBarry Smith EXTERN int        MatOrderingRegisterDestroy(void);
817ca44d042SBarry Smith EXTERN int        MatOrderingRegisterAll(char*);
8182bad1931SBarry Smith extern PetscTruth MatOrderingRegisterAllCalled;
819b0a32e0cSBarry Smith extern PetscFList MatOrderingList;
820d4fbbf0eSBarry Smith 
82187828ca2SBarry Smith EXTERN int MatReorderForNonzeroDiagonal(Mat,PetscReal,IS,IS);
822a2ce50c7SBarry Smith 
823d91e6319SBarry Smith /*S
82415e8a5b3SHong Zhang    MatFactorInfo - Data based into the matrix factorization routines
825b00f7748SHong Zhang 
82615e8a5b3SHong Zhang    In Fortran these are simply double precision arrays of size MAT_FACTORINFO_SIZE
827b00f7748SHong Zhang 
82815e8a5b3SHong Zhang    Notes: These are not usually directly used by users, instead use PC type of LU, ILU, CHOLESKY or ICC.
829b00f7748SHong Zhang 
830b00f7748SHong Zhang    Level: developer
831b00f7748SHong Zhang 
832b380c88cSHong Zhang .seealso: MatLUFactorSymbolic(), MatILUFactorSymbolic(), MatCholeskyFactorSymbolic(), MatICCFactorSymbolic(), MatICCFactor()
833b00f7748SHong Zhang 
834b00f7748SHong Zhang S*/
835b00f7748SHong Zhang typedef struct {
83615e8a5b3SHong Zhang   PetscReal     damping;        /* scaling of identity added to matrix to prevent zero pivots */
8372cea7109SBarry Smith   PetscReal     shift;          /* if true, shift until positive pivots */
8382cea7109SBarry Smith   PetscReal     shift_fraction; /* record shift fraction taken */
83915e8a5b3SHong Zhang   PetscReal     diagonal_fill;  /* force diagonal to fill in if initially not filled */
84015e8a5b3SHong Zhang   PetscReal     dt;             /* drop tolerance */
841b00f7748SHong Zhang   PetscReal     dtcol;          /* tolerance for pivoting */
84215e8a5b3SHong Zhang   PetscReal     dtcount;        /* maximum nonzeros to be allowed per row */
843f6275e2eSBarry Smith   PetscReal     fill;           /* expected fill; nonzeros in factored matrix/nonzeros in original matrix*/
844348344bbSBarry Smith   PetscReal     levels;         /* ICC/ILU(levels) */
845bcd9e38bSBarry Smith   PetscReal     pivotinblocks;  /* for BAIJ and SBAIJ matrices pivot in factorization on blocks, default 1.0
846bcd9e38bSBarry Smith                                    factorization may be faster if do not pivot */
84715e8a5b3SHong Zhang   PetscReal     zeropivot;      /* pivot is called zero if less than this */
84815e8a5b3SHong Zhang } MatFactorInfo;
849ffa6d0a5SLois Curfman McInnes 
85015e8a5b3SHong Zhang EXTERN int MatCholeskyFactor(Mat,IS,MatFactorInfo*);
85115e8a5b3SHong Zhang EXTERN int MatCholeskyFactorSymbolic(Mat,IS,MatFactorInfo*,Mat*);
85215e8a5b3SHong Zhang EXTERN int MatCholeskyFactorNumeric(Mat,Mat*);
853b380c88cSHong Zhang EXTERN int MatLUFactor(Mat,IS,IS,MatFactorInfo*);
854b380c88cSHong Zhang EXTERN int MatILUFactor(Mat,IS,IS,MatFactorInfo*);
855b380c88cSHong Zhang EXTERN int MatLUFactorSymbolic(Mat,IS,IS,MatFactorInfo*,Mat*);
856b380c88cSHong Zhang EXTERN int MatILUFactorSymbolic(Mat,IS,IS,MatFactorInfo*,Mat*);
85715e8a5b3SHong Zhang EXTERN int MatICCFactorSymbolic(Mat,IS,MatFactorInfo*,Mat*);
85815e8a5b3SHong Zhang EXTERN int MatICCFactor(Mat,IS,MatFactorInfo*);
859ca44d042SBarry Smith EXTERN int MatLUFactorNumeric(Mat,Mat*);
860b380c88cSHong Zhang EXTERN int MatILUDTFactor(Mat,MatFactorInfo*,IS,IS,Mat *);
8613e0d88b5SBarry Smith EXTERN int MatGetInertia(Mat,int*,int*,int*);
862ca44d042SBarry Smith EXTERN int MatSolve(Mat,Vec,Vec);
863ca44d042SBarry Smith EXTERN int MatForwardSolve(Mat,Vec,Vec);
864ca44d042SBarry Smith EXTERN int MatBackwardSolve(Mat,Vec,Vec);
865ca44d042SBarry Smith EXTERN int MatSolveAdd(Mat,Vec,Vec,Vec);
866ca44d042SBarry Smith EXTERN int MatSolveTranspose(Mat,Vec,Vec);
867ca44d042SBarry Smith EXTERN int MatSolveTransposeAdd(Mat,Vec,Vec,Vec);
868d59c15a7SBarry Smith EXTERN int MatSolves(Mat,Vecs,Vecs);
8698ed539a5SBarry Smith 
870ca44d042SBarry Smith EXTERN int MatSetUnfactored(Mat);
871bb5a7306SBarry Smith 
872d91e6319SBarry Smith /*E
873d91e6319SBarry Smith     MatSORType - What type of (S)SOR to perform
874bb1eb677SSatish Balay 
875d91e6319SBarry Smith     Level: beginner
876d91e6319SBarry Smith 
877d9274352SBarry Smith    May be bitwise ORd together
878d9274352SBarry Smith 
879d91e6319SBarry Smith    Any additions/changes here MUST also be made in include/finclude/petscmat.h
880d91e6319SBarry Smith 
881*4e7234bfSBarry Smith    MatSORType may be bitwise ORd together, so do not change the numbers
882*4e7234bfSBarry Smith 
883d91e6319SBarry Smith .seealso: MatRelax()
884d91e6319SBarry Smith E*/
885ee50ffe9SBarry Smith typedef enum {SOR_FORWARD_SWEEP=1,SOR_BACKWARD_SWEEP=2,SOR_SYMMETRIC_SWEEP=3,
886ee50ffe9SBarry Smith               SOR_LOCAL_FORWARD_SWEEP=4,SOR_LOCAL_BACKWARD_SWEEP=8,
887ee50ffe9SBarry Smith               SOR_LOCAL_SYMMETRIC_SWEEP=12,SOR_ZERO_INITIAL_GUESS=16,
88884cb2905SBarry Smith               SOR_EISENSTAT=32,SOR_APPLY_UPPER=64,SOR_APPLY_LOWER=128} MatSORType;
889c14dc6b6SHong Zhang EXTERN int MatRelax(Mat,Vec,PetscReal,MatSORType,PetscReal,int,int,Vec);
8908ed539a5SBarry Smith 
891d4fbbf0eSBarry Smith /*
892639f9d9dSBarry Smith     These routines are for efficiently computing Jacobians via finite differences.
893639f9d9dSBarry Smith */
894b12f92e5SBarry Smith 
895d9274352SBarry Smith /*E
896d9274352SBarry Smith     MatColoringType - String with the name of a PETSc matrix coloring or the creation function
897d9274352SBarry Smith        with an optional dynamic library name, for example
898d9274352SBarry Smith        http://www.mcs.anl.gov/petsc/lib.a:coloringcreate()
899d9274352SBarry Smith 
900d9274352SBarry Smith    Level: beginner
901d9274352SBarry Smith 
902d9274352SBarry Smith .seealso: MatGetColoring()
903d9274352SBarry Smith E*/
904b12f92e5SBarry Smith typedef char* MatColoringType;
905b12f92e5SBarry Smith #define MATCOLORING_NATURAL "natural"
906b12f92e5SBarry Smith #define MATCOLORING_SL      "sl"
907b12f92e5SBarry Smith #define MATCOLORING_LF      "lf"
908b12f92e5SBarry Smith #define MATCOLORING_ID      "id"
909b12f92e5SBarry Smith 
910ca44d042SBarry Smith EXTERN int MatGetColoring(Mat,MatColoringType,ISColoring*);
911ca44d042SBarry Smith EXTERN int MatColoringRegister(char*,char*,char*,int(*)(Mat,MatColoringType,ISColoring *));
91230de9b25SBarry Smith 
91330de9b25SBarry Smith /*MC
91430de9b25SBarry Smith    MatColoringRegisterDynamic - Adds a new sparse matrix coloring to the
91530de9b25SBarry Smith                                matrix package.
91630de9b25SBarry Smith 
91730de9b25SBarry Smith    Synopsis:
91830de9b25SBarry Smith    int MatColoringRegisterDynamic(char *name_coloring,char *path,char *name_create,int (*routine_create)(MatColoring))
91930de9b25SBarry Smith 
92030de9b25SBarry Smith    Not Collective
92130de9b25SBarry Smith 
92230de9b25SBarry Smith    Input Parameters:
92330de9b25SBarry Smith +  sname - name of Coloring (for example MATCOLORING_SL)
92430de9b25SBarry Smith .  path - location of library where creation routine is
92530de9b25SBarry Smith .  name - name of function that creates the Coloring type, a string
92630de9b25SBarry Smith -  function - function pointer that creates the coloring
92730de9b25SBarry Smith 
92830de9b25SBarry Smith    Level: developer
92930de9b25SBarry Smith 
93030de9b25SBarry Smith    If dynamic libraries are used, then the fourth input argument (function)
93130de9b25SBarry Smith    is ignored.
93230de9b25SBarry Smith 
93330de9b25SBarry Smith    Sample usage:
93430de9b25SBarry Smith .vb
93530de9b25SBarry Smith    MatColoringRegisterDynamic("my_color",/home/username/my_lib/lib/libO/solaris/mylib.a,
93630de9b25SBarry Smith                "MyColor",MyColor);
93730de9b25SBarry Smith .ve
93830de9b25SBarry Smith 
93930de9b25SBarry Smith    Then, your partitioner can be chosen with the procedural interface via
94030de9b25SBarry Smith $     MatColoringSetType(part,"my_color")
94130de9b25SBarry Smith    or at runtime via the option
94230de9b25SBarry Smith $     -mat_coloring_type my_color
94330de9b25SBarry Smith 
94430de9b25SBarry Smith    $PETSC_ARCH and $BOPT occuring in pathname will be replaced with appropriate values.
94530de9b25SBarry Smith 
94630de9b25SBarry Smith .keywords: matrix, Coloring, register
94730de9b25SBarry Smith 
94830de9b25SBarry Smith .seealso: MatColoringRegisterDestroy(), MatColoringRegisterAll()
94930de9b25SBarry Smith M*/
950aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
951f1af5d2fSBarry Smith #define MatColoringRegisterDynamic(a,b,c,d) MatColoringRegister(a,b,c,0)
952b12f92e5SBarry Smith #else
953f1af5d2fSBarry Smith #define MatColoringRegisterDynamic(a,b,c,d) MatColoringRegister(a,b,c,d)
954b12f92e5SBarry Smith #endif
95530de9b25SBarry Smith 
956ca44d042SBarry Smith EXTERN int        MatColoringRegisterAll(char *);
9572bad1931SBarry Smith extern PetscTruth MatColoringRegisterAllCalled;
958ca44d042SBarry Smith EXTERN int        MatColoringRegisterDestroy(void);
959*4e7234bfSBarry Smith EXTERN int        MatColoringPatch(Mat,int,int,const ISColoringValue[],ISColoring*);
960639f9d9dSBarry Smith 
961d9274352SBarry Smith /*S
962d9274352SBarry Smith      MatFDColoring - Object for computing a sparse Jacobian via finite differences
963d9274352SBarry Smith         and coloring
964639f9d9dSBarry Smith 
965d9274352SBarry Smith    Level: beginner
966d9274352SBarry Smith 
967d9274352SBarry Smith   Concepts: coloring, sparse Jacobian, finite differences
968d9274352SBarry Smith 
969d9274352SBarry Smith .seealso:  MatFDColoringCreate()
970d9274352SBarry Smith S*/
971e2a1c21fSSatish Balay typedef struct _p_MatFDColoring *MatFDColoring;
972639f9d9dSBarry Smith 
973ca44d042SBarry Smith EXTERN int MatFDColoringCreate(Mat,ISColoring,MatFDColoring *);
974ca44d042SBarry Smith EXTERN int MatFDColoringDestroy(MatFDColoring);
975b0a32e0cSBarry Smith EXTERN int MatFDColoringView(MatFDColoring,PetscViewer);
976ca44d042SBarry Smith EXTERN int MatFDColoringSetFunction(MatFDColoring,int (*)(void),void*);
97787828ca2SBarry Smith EXTERN int MatFDColoringSetParameters(MatFDColoring,PetscReal,PetscReal);
978ca44d042SBarry Smith EXTERN int MatFDColoringSetFrequency(MatFDColoring,int);
979ca44d042SBarry Smith EXTERN int MatFDColoringGetFrequency(MatFDColoring,int*);
980ca44d042SBarry Smith EXTERN int MatFDColoringSetFromOptions(MatFDColoring);
981ca44d042SBarry Smith EXTERN int MatFDColoringApply(Mat,MatFDColoring,Vec,MatStructure*,void *);
98287828ca2SBarry Smith EXTERN int MatFDColoringApplyTS(Mat,MatFDColoring,PetscReal,Vec,MatStructure*,void *);
98362152c8bSBarry Smith EXTERN int MatFDColoringSetRecompute(MatFDColoring);
9843a7fca6bSBarry Smith EXTERN int MatFDColoringSetF(MatFDColoring,Vec);
985*4e7234bfSBarry Smith EXTERN int MatFDColoringGetPerturbedColumns(MatFDColoring,int*,int*[]);
986639f9d9dSBarry Smith /*
9870752156aSBarry Smith     These routines are for partitioning matrices: currently used only
9883eda8832SBarry Smith   for adjacency matrix, MatCreateMPIAdj().
9890752156aSBarry Smith */
990ca161407SBarry Smith 
991d9274352SBarry Smith /*S
992d9274352SBarry Smith      MatPartitioning - Object for managing the partitioning of a matrix or graph
993d9274352SBarry Smith 
994d9274352SBarry Smith    Level: beginner
995d9274352SBarry Smith 
996d9274352SBarry Smith   Concepts: partitioning
997d9274352SBarry Smith 
998743a1026Svictorle .seealso:  MatPartitioningCreate(), MatPartitioningType
999d9274352SBarry Smith S*/
100091e9ee9fSBarry Smith typedef struct _p_MatPartitioning *MatPartitioning;
1001d9274352SBarry Smith 
1002d9274352SBarry Smith /*E
10035bc6e7ccSvictorle     MatPartitioningType - String with the name of a PETSc matrix partitioning or the creation function
1004d9274352SBarry Smith        with an optional dynamic library name, for example
1005d9274352SBarry Smith        http://www.mcs.anl.gov/petsc/lib.a:partitioningcreate()
1006d9274352SBarry Smith 
1007d9274352SBarry Smith    Level: beginner
1008d9274352SBarry Smith 
1009b547a13bSvictorle .seealso: MatPartitioningCreate(), MatPartitioning
1010d9274352SBarry Smith E*/
10112aabb6bbSBarry Smith typedef char* MatPartitioningType;
10128ba1e511SMatthew Knepley #define MAT_PARTITIONING_CURRENT  "current"
10138ba1e511SMatthew Knepley #define MAT_PARTITIONING_PARMETIS "parmetis"
1014ca161407SBarry Smith 
1015ca44d042SBarry Smith EXTERN int MatPartitioningCreate(MPI_Comm,MatPartitioning*);
1016ca44d042SBarry Smith EXTERN int MatPartitioningSetType(MatPartitioning,MatPartitioningType);
10175bc6e7ccSvictorle EXTERN int MatPartitioningSetNParts(MatPartitioning,int);
1018ca44d042SBarry Smith EXTERN int MatPartitioningSetAdjacency(MatPartitioning,Mat);
1019*4e7234bfSBarry Smith EXTERN int MatPartitioningSetVertexWeights(MatPartitioning,const int[]);
1020*4e7234bfSBarry Smith EXTERN int MatPartitioningSetPartitionWeights(MatPartitioning,const PetscReal []);
1021ca44d042SBarry Smith EXTERN int MatPartitioningApply(MatPartitioning,IS*);
1022ca44d042SBarry Smith EXTERN int MatPartitioningDestroy(MatPartitioning);
10232aabb6bbSBarry Smith 
1024ca44d042SBarry Smith EXTERN int MatPartitioningRegister(char*,char*,char*,int(*)(MatPartitioning));
102530de9b25SBarry Smith 
102630de9b25SBarry Smith /*MC
102730de9b25SBarry Smith    MatPartitioningRegisterDynamic - Adds a new sparse matrix partitioning to the
102830de9b25SBarry Smith    matrix package.
102930de9b25SBarry Smith 
103030de9b25SBarry Smith    Synopsis:
103130de9b25SBarry Smith    int MatPartitioningRegisterDynamic(char *name_partitioning,char *path,char *name_create,int (*routine_create)(MatPartitioning))
103230de9b25SBarry Smith 
103330de9b25SBarry Smith    Not Collective
103430de9b25SBarry Smith 
103530de9b25SBarry Smith    Input Parameters:
103630de9b25SBarry Smith +  sname - name of partitioning (for example MAT_PARTITIONING_CURRENT) or parmetis
103730de9b25SBarry Smith .  path - location of library where creation routine is
103830de9b25SBarry Smith .  name - name of function that creates the partitioning type, a string
103930de9b25SBarry Smith -  function - function pointer that creates the partitioning type
104030de9b25SBarry Smith 
104130de9b25SBarry Smith    Level: developer
104230de9b25SBarry Smith 
104330de9b25SBarry Smith    If dynamic libraries are used, then the fourth input argument (function)
104430de9b25SBarry Smith    is ignored.
104530de9b25SBarry Smith 
104630de9b25SBarry Smith    Sample usage:
104730de9b25SBarry Smith .vb
104830de9b25SBarry Smith    MatPartitioningRegisterDynamic("my_part",/home/username/my_lib/lib/libO/solaris/mylib.a,
104930de9b25SBarry Smith                "MyPartCreate",MyPartCreate);
105030de9b25SBarry Smith .ve
105130de9b25SBarry Smith 
105230de9b25SBarry Smith    Then, your partitioner can be chosen with the procedural interface via
105330de9b25SBarry Smith $     MatPartitioningSetType(part,"my_part")
105430de9b25SBarry Smith    or at runtime via the option
105530de9b25SBarry Smith $     -mat_partitioning_type my_part
105630de9b25SBarry Smith 
105730de9b25SBarry Smith    $PETSC_ARCH and $BOPT occuring in pathname will be replaced with appropriate values.
105830de9b25SBarry Smith 
105930de9b25SBarry Smith .keywords: matrix, partitioning, register
106030de9b25SBarry Smith 
106130de9b25SBarry Smith .seealso: MatPartitioningRegisterDestroy(), MatPartitioningRegisterAll()
106230de9b25SBarry Smith M*/
1063aa482453SBarry Smith #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
1064f1af5d2fSBarry Smith #define MatPartitioningRegisterDynamic(a,b,c,d) MatPartitioningRegister(a,b,c,0)
10652aabb6bbSBarry Smith #else
1066f1af5d2fSBarry Smith #define MatPartitioningRegisterDynamic(a,b,c,d) MatPartitioningRegister(a,b,c,d)
10672aabb6bbSBarry Smith #endif
10682aabb6bbSBarry Smith 
1069ca44d042SBarry Smith EXTERN int        MatPartitioningRegisterAll(char *);
10702bad1931SBarry Smith extern PetscTruth MatPartitioningRegisterAllCalled;
1071ca44d042SBarry Smith EXTERN int        MatPartitioningRegisterDestroy(void);
10722bad1931SBarry Smith 
1073b0a32e0cSBarry Smith EXTERN int MatPartitioningView(MatPartitioning,PetscViewer);
1074ca44d042SBarry Smith EXTERN int MatPartitioningSetFromOptions(MatPartitioning);
1075ca44d042SBarry Smith EXTERN int MatPartitioningGetType(MatPartitioning,MatPartitioningType*);
1076ca161407SBarry Smith 
1077ca44d042SBarry Smith EXTERN int MatPartitioningParmetisSetCoarseSequential(MatPartitioning);
10780752156aSBarry Smith 
10790752156aSBarry Smith /*
10800a835dfdSSatish Balay     If you add entries here you must also add them to finclude/petscmat.h
1081d4fbbf0eSBarry Smith */
10821c1c02c0SLois Curfman McInnes typedef enum { MATOP_SET_VALUES=0,
10831c1c02c0SLois Curfman McInnes                MATOP_GET_ROW=1,
10841c1c02c0SLois Curfman McInnes                MATOP_RESTORE_ROW=2,
10851c1c02c0SLois Curfman McInnes                MATOP_MULT=3,
10861c1c02c0SLois Curfman McInnes                MATOP_MULT_ADD=4,
10877c922b88SBarry Smith                MATOP_MULT_TRANSPOSE=5,
10887c922b88SBarry Smith                MATOP_MULT_TRANSPOSE_ADD=6,
10891c1c02c0SLois Curfman McInnes                MATOP_SOLVE=7,
10901c1c02c0SLois Curfman McInnes                MATOP_SOLVE_ADD=8,
10917c922b88SBarry Smith                MATOP_SOLVE_TRANSPOSE=9,
10927c922b88SBarry Smith                MATOP_SOLVE_TRANSPOSE_ADD=10,
10931c1c02c0SLois Curfman McInnes                MATOP_LUFACTOR=11,
10941c1c02c0SLois Curfman McInnes                MATOP_CHOLESKYFACTOR=12,
10951c1c02c0SLois Curfman McInnes                MATOP_RELAX=13,
10961c1c02c0SLois Curfman McInnes                MATOP_TRANSPOSE=14,
10971c1c02c0SLois Curfman McInnes                MATOP_GETINFO=15,
10981c1c02c0SLois Curfman McInnes                MATOP_EQUAL=16,
10991c1c02c0SLois Curfman McInnes                MATOP_GET_DIAGONAL=17,
11001c1c02c0SLois Curfman McInnes                MATOP_DIAGONAL_SCALE=18,
11011c1c02c0SLois Curfman McInnes                MATOP_NORM=19,
11021c1c02c0SLois Curfman McInnes                MATOP_ASSEMBLY_BEGIN=20,
11031c1c02c0SLois Curfman McInnes                MATOP_ASSEMBLY_END=21,
11041c1c02c0SLois Curfman McInnes                MATOP_COMPRESS=22,
11051c1c02c0SLois Curfman McInnes                MATOP_SET_OPTION=23,
11061c1c02c0SLois Curfman McInnes                MATOP_ZERO_ENTRIES=24,
11071c1c02c0SLois Curfman McInnes                MATOP_ZERO_ROWS=25,
11081c1c02c0SLois Curfman McInnes                MATOP_LUFACTOR_SYMBOLIC=26,
11091c1c02c0SLois Curfman McInnes                MATOP_LUFACTOR_NUMERIC=27,
11101c1c02c0SLois Curfman McInnes                MATOP_CHOLESKY_FACTOR_SYMBOLIC=28,
11111c1c02c0SLois Curfman McInnes                MATOP_CHOLESKY_FACTOR_NUMERIC=29,
1112d643ce63SMatthew Knepley                MATOP_SETUP_PREALLOCATION=30,
1113d643ce63SMatthew Knepley                MATOP_ILUFACTOR_SYMBOLIC=31,
1114d643ce63SMatthew Knepley                MATOP_ICCFACTOR_SYMBOLIC=32,
1115d643ce63SMatthew Knepley                MATOP_GET_ARRAY=33,
1116d643ce63SMatthew Knepley                MATOP_RESTORE_ARRAY=34,
1117d643ce63SMatthew Knepley                MATOP_DUPLCIATE=35,
1118d643ce63SMatthew Knepley                MATOP_FORWARD_SOLVE=36,
1119d643ce63SMatthew Knepley                MATOP_BACKWARD_SOLVE=37,
1120d643ce63SMatthew Knepley                MATOP_ILUFACTOR=38,
1121d643ce63SMatthew Knepley                MATOP_ICCFACTOR=39,
1122d643ce63SMatthew Knepley                MATOP_AXPY=40,
1123d643ce63SMatthew Knepley                MATOP_GET_SUBMATRICES=41,
1124d643ce63SMatthew Knepley                MATOP_INCREASE_OVERLAP=42,
1125d643ce63SMatthew Knepley                MATOP_GET_VALUES=43,
1126d643ce63SMatthew Knepley                MATOP_COPY=44,
1127d643ce63SMatthew Knepley                MATOP_PRINT_HELP=45,
1128d643ce63SMatthew Knepley                MATOP_SCALE=46,
1129d643ce63SMatthew Knepley                MATOP_SHIFT=47,
1130d643ce63SMatthew Knepley                MATOP_DIAGONAL_SHIFT=48,
1131d643ce63SMatthew Knepley                MATOP_ILUDT_FACTOR=49,
1132d643ce63SMatthew Knepley                MATOP_GET_BLOCK_SIZE=50,
1133d643ce63SMatthew Knepley                MATOP_GET_ROW_IJ=51,
1134d643ce63SMatthew Knepley                MATOP_RESTORE_ROW_IJ=52,
1135d643ce63SMatthew Knepley                MATOP_GET_COLUMN_IJ=53,
1136d643ce63SMatthew Knepley                MATOP_RESTORE_COLUMN_IJ=54,
1137d643ce63SMatthew Knepley                MATOP_FDCOLORING_CREATE=55,
1138d643ce63SMatthew Knepley                MATOP_COLORING_PATCH=56,
1139d643ce63SMatthew Knepley                MATOP_SET_UNFACTORED=57,
1140d643ce63SMatthew Knepley                MATOP_PERMUTE=58,
1141d643ce63SMatthew Knepley                MATOP_SET_VALUES_BLOCKED=59,
1142d643ce63SMatthew Knepley                MATOP_GET_SUBMATRIX=60,
1143d643ce63SMatthew Knepley                MATOP_DESTROY=61,
1144d643ce63SMatthew Knepley                MATOP_VIEW=62,
1145d643ce63SMatthew Knepley                MATOP_GET_MAPS=63,
1146d643ce63SMatthew Knepley                MATOP_USE_SCALED_FORM=64,
1147d643ce63SMatthew Knepley                MATOP_SCALE_SYSTEM=65,
1148d643ce63SMatthew Knepley                MATOP_UNSCALE_SYSTEM=66,
1149d643ce63SMatthew Knepley                MATOP_SET_LOCAL_TO_GLOBAL_MAPPING=67,
1150d643ce63SMatthew Knepley                MATOP_SET_VALUES_LOCAL=68,
1151d643ce63SMatthew Knepley                MATOP_ZERO_ROWS_LOCAL=69,
1152d643ce63SMatthew Knepley                MATOP_GET_ROW_MAX=70,
1153d643ce63SMatthew Knepley                MATOP_CONVERT=71,
1154d643ce63SMatthew Knepley                MATOP_SET_COLORING=72,
1155d643ce63SMatthew Knepley                MATOP_SET_VALUES_ADIC=73,
1156d643ce63SMatthew Knepley                MATOP_SET_VALUES_ADIFOR=74,
1157d643ce63SMatthew Knepley                MATOP_FD_COLORING_APPLY=75,
1158d643ce63SMatthew Knepley                MATOP_SET_FROM_OPTIONS=76,
1159d643ce63SMatthew Knepley                MATOP_MULT_CONSTRAINED=77,
1160d643ce63SMatthew Knepley                MATOP_MULT_TRANSPOSE_CONSTRAINED=78,
1161d643ce63SMatthew Knepley                MATOP_ILU_FACTOR_SYMBOLIC_CONSTRAINED=79,
1162d643ce63SMatthew Knepley                MATOP_PERMUTE_SPARSIFY=80,
1163d643ce63SMatthew Knepley                MATOP_MULT_MULTIPLE=81,
1164d643ce63SMatthew Knepley                MATOP_SOLVE_MULTIPLE=82
1165fae171e0SBarry Smith              } MatOperation;
1166ca44d042SBarry Smith EXTERN int MatHasOperation(Mat,MatOperation,PetscTruth*);
1167ff8b7a98SSatish Balay EXTERN int MatShellSetOperation(Mat,MatOperation,void(*)(void));
1168ff8b7a98SSatish Balay EXTERN int MatShellGetOperation(Mat,MatOperation,void(**)(void));
1169273d9f13SBarry Smith EXTERN int MatShellSetContext(Mat,void*);
1170112a2221SBarry Smith 
117190ace30eSBarry Smith /*
117290ace30eSBarry Smith    Codes for matrices stored on disk. By default they are
117390ace30eSBarry Smith  stored in a universal format. By changing the format with
1174fb9695e5SSatish Balay  PetscViewerSetFormat(viewer,PETSC_VIEWER_BINARY_NATIVE); the matrices will
117590ace30eSBarry Smith  be stored in a way natural for the matrix, for example dense matrices
117690ace30eSBarry Smith  would be stored as dense. Matrices stored this way may only be
117790ace30eSBarry Smith  read into matrices of the same time.
117890ace30eSBarry Smith */
117990ace30eSBarry Smith #define MATRIX_BINARY_FORMAT_DENSE -1
118090ace30eSBarry Smith 
11816d053be9SSatish Balay EXTERN int MatMPIBAIJSetHashTableFactor(Mat,PetscReal);
1182ca44d042SBarry Smith EXTERN int MatSeqAIJGetInodeSizes(Mat,int *,int *[],int *);
118308918a0eSSatish Balay EXTERN int MatMPIRowbsGetColor(Mat,ISColoring *);
1184860d1616SSatish Balay 
1185d9274352SBarry Smith /*S
1186d9274352SBarry Smith      MatNullSpace - Object that removes a null space from a vector, i.e.
1187d9274352SBarry Smith          orthogonalizes the vector to a subsapce
1188d9274352SBarry Smith 
1189f7a9e4ceSBarry Smith    Level: advanced
1190d9274352SBarry Smith 
1191d9274352SBarry Smith   Concepts: matrix; linear operator, null space
1192d9274352SBarry Smith 
11936e1639daSBarry Smith   Users manual sections:
11946e1639daSBarry Smith .   sec_singular
11956e1639daSBarry Smith 
1196d9274352SBarry Smith .seealso:  MatNullSpaceCreate()
1197d9274352SBarry Smith S*/
119874637425SBarry Smith typedef struct _p_MatNullSpace* MatNullSpace;
1199d9274352SBarry Smith 
1200*4e7234bfSBarry Smith EXTERN int MatNullSpaceCreate(MPI_Comm,int,int,const Vec[],MatNullSpace*);
120174637425SBarry Smith EXTERN int MatNullSpaceDestroy(MatNullSpace);
120274637425SBarry Smith EXTERN int MatNullSpaceRemove(MatNullSpace,Vec,Vec*);
120374637425SBarry Smith EXTERN int MatNullSpaceAttach(Mat,MatNullSpace);
120474637425SBarry Smith EXTERN int MatNullSpaceTest(MatNullSpace,Mat);
120574637425SBarry Smith 
1206273d9f13SBarry Smith EXTERN int MatReorderingSeqSBAIJ(Mat A,IS isp);
1207273d9f13SBarry Smith EXTERN int MatMPISBAIJSetHashTableFactor(Mat,PetscReal);
1208273d9f13SBarry Smith EXTERN int MatSeqSBAIJSetColumnIndices(Mat,int *);
1209273d9f13SBarry Smith 
12105c66b693SKris Buschelman EXTERN int MatMatMult(Mat A,Mat B, Mat *C);
12115c66b693SKris Buschelman EXTERN int MatMatMultSymbolic(Mat A,Mat B,Mat *C);
12125c66b693SKris Buschelman EXTERN int MatMatMultNumeric(Mat A,Mat B,Mat C);
12133f1d51d7SBarry Smith 
1214f069c275SSatish Balay EXTERN int MatCreateMAIJ(Mat,int,Mat*);
1215c4f061fbSSatish Balay EXTERN int MatMAIJRedimension(Mat,int,Mat*);
1216c4f061fbSSatish Balay EXTERN int MatMAIJGetAIJ(Mat,Mat*);
1217c4f061fbSSatish Balay 
1218b0a32e0cSBarry Smith EXTERN int MatComputeExplicitOperator(Mat,Mat*);
1219b0a32e0cSBarry Smith 
122024a595ddSBarry Smith EXTERN int MatESISetType(Mat,char*);
122124a595ddSBarry Smith EXTERN int MatESISetFromOptions(Mat);
122224a595ddSBarry Smith 
12232cd6534aSBarry Smith EXTERN int MatDiagonalScaleLocal(Mat,Vec);
122404f1ad80SBarry Smith 
12257dbadf16SMatthew Knepley EXTERN int PetscViewerMathematicaPutMatrix(PetscViewer, int, int, PetscReal *);
12267dbadf16SMatthew Knepley EXTERN int PetscViewerMathematicaPutCSRMatrix(PetscViewer, int, int, int *, int *, PetscReal *);
12277dbadf16SMatthew Knepley 
1228e82a3eeeSBarry Smith EXTERN int MatUseSpooles_SeqAIJ(Mat);
1229e82a3eeeSBarry Smith EXTERN int MatUseUMFPACK_SeqAIJ(Mat);
1230e82a3eeeSBarry Smith EXTERN int MatUseSuperLU_SeqAIJ(Mat);
1231e82a3eeeSBarry Smith EXTERN int MatUseEssl_SeqAIJ(Mat);
1232e82a3eeeSBarry Smith EXTERN int MatUseLUSOL_SeqAIJ(Mat);
1233e82a3eeeSBarry Smith EXTERN int MatUseMatlab_SeqAIJ(Mat);
1234e82a3eeeSBarry Smith EXTERN int MatUseDXML_SeqAIJ(Mat);
12350889b5dcSvictorle EXTERN int MatUsePETSc_SeqAIJ(Mat);
1236e82a3eeeSBarry Smith EXTERN int MatUseSuperLU_DIST_MPIAIJ(Mat);
1237e82a3eeeSBarry Smith EXTERN int MatUseSpooles_MPIAIJ(Mat);
1238e82a3eeeSBarry Smith EXTERN int MatUseSpooles_SeqSBAIJ(Mat);
1239eee76cafSHong Zhang EXTERN int MatUseSpooles_MPISBAIJ(Mat);
1240eee76cafSHong Zhang EXTERN int MatUseMUMPS_MPIAIJ(Mat);
1241e82a3eeeSBarry Smith 
12422eac72dbSBarry Smith #endif
12432eac72dbSBarry Smith 
12442eac72dbSBarry Smith 
12459d00d63dSBarry Smith 
1246