xref: /petsc/src/mat/interface/matregis.c (revision 273d9f13de75c4ed17021f7f2c11eebb99d26f0d)
1*273d9f13SBarry Smith /*$Id: matregis.c,v 1.4 2000/08/24 22:41:43 bsmith Exp bsmith $*/
28a95e4e9SBarry Smith 
3f7cf7585SBarry Smith #include "petscmat.h"  /*I "petscmat.h" I*/
48a95e4e9SBarry Smith 
58a95e4e9SBarry Smith EXTERN_C_BEGIN
6f7cf7585SBarry Smith EXTERN int MatCreate_MAIJ(Mat);
7186905e3SBarry Smith EXTERN int MatCreate_IS(Mat);
8*273d9f13SBarry Smith EXTERN int MatCreate_MPIRowbs(Mat);
9*273d9f13SBarry Smith EXTERN int MatCreate_SeqAIJ(Mat);
10*273d9f13SBarry Smith EXTERN int MatCreate_MPIAIJ(Mat);
11*273d9f13SBarry Smith EXTERN int MatCreate_SeqBAIJ(Mat);
12*273d9f13SBarry Smith EXTERN int MatCreate_MPIBAIJ(Mat);
13*273d9f13SBarry Smith EXTERN int MatCreate_SeqSBAIJ(Mat);
14*273d9f13SBarry Smith EXTERN int MatCreate_MPISBAIJ(Mat);
15*273d9f13SBarry Smith EXTERN int MatCreate_SeqBDiag(Mat);
16*273d9f13SBarry Smith EXTERN int MatCreate_MPIBDiag(Mat);
17*273d9f13SBarry Smith EXTERN int MatCreate_SeqDense(Mat);
18*273d9f13SBarry Smith EXTERN int MatCreate_MPIDense(Mat);
19*273d9f13SBarry Smith EXTERN int MatCreate_MPIAdj(Mat);
20*273d9f13SBarry Smith EXTERN int MatCreate_Shell(Mat);
218a95e4e9SBarry Smith EXTERN_C_END
228a95e4e9SBarry Smith 
238a95e4e9SBarry Smith /*
24f7cf7585SBarry Smith     This is used by MatSetType() to make sure that at least one
25f7cf7585SBarry Smith     MatRegisterAll() is called. In general, if there is more than one
26f7cf7585SBarry Smith     DLL, then MatRegisterAll() may be called several times.
278a95e4e9SBarry Smith */
28f7cf7585SBarry Smith EXTERN PetscTruth MatRegisterAllCalled;
298a95e4e9SBarry Smith 
308a95e4e9SBarry Smith #undef __FUNC__
31f7cf7585SBarry Smith #define __FUNC__ /*<a name="MatRegisterAll"></a>*/"MatRegisterAll"
328a95e4e9SBarry Smith /*@C
33f7cf7585SBarry Smith   MatRegisterAll - Registers all of the matrix types in PETSc
348a95e4e9SBarry Smith 
358a95e4e9SBarry Smith   Not Collective
368a95e4e9SBarry Smith 
378a95e4e9SBarry Smith   Level: advanced
388a95e4e9SBarry Smith 
398a95e4e9SBarry Smith .keywords: KSP, register, all
408a95e4e9SBarry Smith 
41f7cf7585SBarry Smith .seealso:  MatRegisterDestroy()
428a95e4e9SBarry Smith @*/
43f7cf7585SBarry Smith int MatRegisterAll(char *path)
448a95e4e9SBarry Smith {
458a95e4e9SBarry Smith   int ierr;
468a95e4e9SBarry Smith 
478a95e4e9SBarry Smith   PetscFunctionBegin;
48f7cf7585SBarry Smith   MatRegisterAllCalled = PETSC_TRUE;
498a95e4e9SBarry Smith 
50f7cf7585SBarry Smith   ierr = MatRegisterDynamic(MATMPIMAIJ, path,"MatCreate_MAIJ",    MatCreate_MAIJ);CHKERRQ(ierr);
51b9b97703SBarry Smith   ierr = MatRegisterDynamic(MATSEQMAIJ, path,"MatCreate_MAIJ",    MatCreate_MAIJ);CHKERRQ(ierr);
52*273d9f13SBarry Smith 
53186905e3SBarry Smith   ierr = MatRegisterDynamic(MATIS,      path,"MatCreate_IS",      MatCreate_IS);CHKERRQ(ierr);
54*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATSHELL,   path,"MatCreate_Shell",   MatCreate_Shell);CHKERRQ(ierr);
55*273d9f13SBarry Smith #if defined(PETSC_HAVE_BLOCKSOLVE)
56*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPIROWBS,path,"MatCreate_MPIRowbs",MatCreate_MPIRowbs);CHKERRQ(ierr);
57*273d9f13SBarry Smith #endif
58*273d9f13SBarry Smith 
59*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPIAIJ,  path,"MatCreate_MPIAIJ",  MatCreate_MPIAIJ);CHKERRQ(ierr);
60*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATSEQAIJ,  path,"MatCreate_SeqAIJ",  MatCreate_SeqAIJ);CHKERRQ(ierr);
61*273d9f13SBarry Smith 
62*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPIBAIJ,  path,"MatCreate_MPIBAIJ",  MatCreate_MPIBAIJ);CHKERRQ(ierr);
63*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATSEQBAIJ,  path,"MatCreate_SeqBAIJ",  MatCreate_SeqBAIJ);CHKERRQ(ierr);
64*273d9f13SBarry Smith 
65*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPISBAIJ,  path,"MatCreate_MPISBAIJ",  MatCreate_MPISBAIJ);CHKERRQ(ierr);
66*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATSEQSBAIJ,  path,"MatCreate_SeqSBAIJ",  MatCreate_SeqSBAIJ);CHKERRQ(ierr);
67*273d9f13SBarry Smith 
68*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPIBDIAG,  path,"MatCreate_MPIBDiag",  MatCreate_MPIBDiag);CHKERRQ(ierr);
69*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATSEQBDIAG,  path,"MatCreate_SeqBDiag",  MatCreate_SeqBDiag);CHKERRQ(ierr);
70*273d9f13SBarry Smith 
71*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPIDENSE,  path,"MatCreate_MPIDense",  MatCreate_MPIDense);CHKERRQ(ierr);
72*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATSEQDENSE,  path,"MatCreate_SeqDense",  MatCreate_SeqDense);CHKERRQ(ierr);
73*273d9f13SBarry Smith 
74*273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPIADJ,    path,"MatCreate_MPIAdj",    MatCreate_MPIAdj);CHKERRQ(ierr);
758a95e4e9SBarry Smith   PetscFunctionReturn(0);
768a95e4e9SBarry Smith }
77f7cf7585SBarry Smith 
78