xref: /petsc/src/mat/interface/matregis.c (revision c1ef491b2a3fd431d53bb887f352191c31e86747)
173f4d377SMatthew Knepley /*$Id: matregis.c,v 1.10 2001/06/21 21:16:17 bsmith Exp $*/
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);
8273d9f13SBarry Smith EXTERN int MatCreate_MPIRowbs(Mat);
9273d9f13SBarry Smith EXTERN int MatCreate_SeqAIJ(Mat);
10273d9f13SBarry Smith EXTERN int MatCreate_MPIAIJ(Mat);
11273d9f13SBarry Smith EXTERN int MatCreate_SeqBAIJ(Mat);
12273d9f13SBarry Smith EXTERN int MatCreate_MPIBAIJ(Mat);
13273d9f13SBarry Smith EXTERN int MatCreate_SeqSBAIJ(Mat);
14273d9f13SBarry Smith EXTERN int MatCreate_MPISBAIJ(Mat);
15273d9f13SBarry Smith EXTERN int MatCreate_SeqBDiag(Mat);
16273d9f13SBarry Smith EXTERN int MatCreate_MPIBDiag(Mat);
17273d9f13SBarry Smith EXTERN int MatCreate_SeqDense(Mat);
18273d9f13SBarry Smith EXTERN int MatCreate_MPIDense(Mat);
19273d9f13SBarry Smith EXTERN int MatCreate_MPIAdj(Mat);
20273d9f13SBarry Smith EXTERN int MatCreate_Shell(Mat);
21064f8208SBarry Smith #if defined(__cplusplus)
226d88219bSBarry Smith EXTERN int MatCreate_ESI(Mat);
236d88219bSBarry Smith EXTERN int MatCreate_PetscESI(Mat);
246d88219bSBarry Smith #endif
258a95e4e9SBarry Smith EXTERN_C_END
268a95e4e9SBarry Smith 
278a95e4e9SBarry Smith /*
28f7cf7585SBarry Smith     This is used by MatSetType() to make sure that at least one
29f7cf7585SBarry Smith     MatRegisterAll() is called. In general, if there is more than one
30f7cf7585SBarry Smith     DLL, then MatRegisterAll() may be called several times.
318a95e4e9SBarry Smith */
32f7cf7585SBarry Smith EXTERN PetscTruth MatRegisterAllCalled;
338a95e4e9SBarry Smith 
344a2ae208SSatish Balay #undef __FUNCT__
354a2ae208SSatish Balay #define __FUNCT__ "MatRegisterAll"
368a95e4e9SBarry Smith /*@C
37f7cf7585SBarry Smith   MatRegisterAll - Registers all of the matrix types in PETSc
388a95e4e9SBarry Smith 
398a95e4e9SBarry Smith   Not Collective
408a95e4e9SBarry Smith 
418a95e4e9SBarry Smith   Level: advanced
428a95e4e9SBarry Smith 
438a95e4e9SBarry Smith .keywords: KSP, register, all
448a95e4e9SBarry Smith 
45f7cf7585SBarry Smith .seealso:  MatRegisterDestroy()
468a95e4e9SBarry Smith @*/
47f7cf7585SBarry Smith int MatRegisterAll(char *path)
488a95e4e9SBarry Smith {
498a95e4e9SBarry Smith   int ierr;
508a95e4e9SBarry Smith 
518a95e4e9SBarry Smith   PetscFunctionBegin;
52f7cf7585SBarry Smith   MatRegisterAllCalled = PETSC_TRUE;
538a95e4e9SBarry Smith 
54f7cf7585SBarry Smith   ierr = MatRegisterDynamic(MATMPIMAIJ, path,"MatCreate_MAIJ",    MatCreate_MAIJ);CHKERRQ(ierr);
55b9b97703SBarry Smith   ierr = MatRegisterDynamic(MATSEQMAIJ, path,"MatCreate_MAIJ",    MatCreate_MAIJ);CHKERRQ(ierr);
56273d9f13SBarry Smith 
57186905e3SBarry Smith   ierr = MatRegisterDynamic(MATIS,      path,"MatCreate_IS",      MatCreate_IS);CHKERRQ(ierr);
58273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATSHELL,   path,"MatCreate_Shell",   MatCreate_Shell);CHKERRQ(ierr);
5910dfdf27SBarry Smith #if defined(PETSC_HAVE_BLOCKSOLVE) && !defined(__cplusplus)
60273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPIROWBS,path,"MatCreate_MPIRowbs",MatCreate_MPIRowbs);CHKERRQ(ierr);
61273d9f13SBarry Smith #endif
62273d9f13SBarry Smith 
63273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPIAIJ,  path,"MatCreate_MPIAIJ",  MatCreate_MPIAIJ);CHKERRQ(ierr);
64273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATSEQAIJ,  path,"MatCreate_SeqAIJ",  MatCreate_SeqAIJ);CHKERRQ(ierr);
65273d9f13SBarry Smith 
66273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPIBAIJ,  path,"MatCreate_MPIBAIJ",  MatCreate_MPIBAIJ);CHKERRQ(ierr);
67273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATSEQBAIJ,  path,"MatCreate_SeqBAIJ",  MatCreate_SeqBAIJ);CHKERRQ(ierr);
68273d9f13SBarry Smith 
69273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPISBAIJ,  path,"MatCreate_MPISBAIJ",  MatCreate_MPISBAIJ);CHKERRQ(ierr);
70273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATSEQSBAIJ,  path,"MatCreate_SeqSBAIJ",  MatCreate_SeqSBAIJ);CHKERRQ(ierr);
71273d9f13SBarry Smith 
72273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPIBDIAG,  path,"MatCreate_MPIBDiag",  MatCreate_MPIBDiag);CHKERRQ(ierr);
73273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATSEQBDIAG,  path,"MatCreate_SeqBDiag",  MatCreate_SeqBDiag);CHKERRQ(ierr);
74273d9f13SBarry Smith 
75273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPIDENSE,  path,"MatCreate_MPIDense",  MatCreate_MPIDense);CHKERRQ(ierr);
76273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATSEQDENSE,  path,"MatCreate_SeqDense",  MatCreate_SeqDense);CHKERRQ(ierr);
77273d9f13SBarry Smith 
78273d9f13SBarry Smith   ierr = MatRegisterDynamic(MATMPIADJ,    path,"MatCreate_MPIAdj",    MatCreate_MPIAdj);CHKERRQ(ierr);
79*c1ef491bSBarry Smith #if defined(__cplusplus) && !defined(PETSC_USE_COMPLEX) && !defined(PETSC_USE_MATSINGLE) && defined(PETSC_HAVE_CXX_NAMESPACE)
806d88219bSBarry Smith   ierr = MatRegisterDynamic(MATESI,       path,"MatCreate_ESI",    MatCreate_ESI);CHKERRQ(ierr);
816d88219bSBarry Smith   ierr = MatRegisterDynamic(MATPETSCESI,  path,"MatCreate_PetscESI",    MatCreate_PetscESI);CHKERRQ(ierr);
826d88219bSBarry Smith #endif
838a95e4e9SBarry Smith   PetscFunctionReturn(0);
848a95e4e9SBarry Smith }
85f7cf7585SBarry Smith 
863a7fca6bSBarry Smith 
87