Actual source code: matregis.c

petsc-master 2020-06-05
Report Typos and Errors

  2:  #include <petsc/private/matimpl.h>

  4: PETSC_EXTERN PetscErrorCode MatCreate_MFFD(Mat);
  5: PETSC_EXTERN PetscErrorCode MatCreate_MAIJ(Mat);
  6: PETSC_EXTERN PetscErrorCode MatCreate_KAIJ(Mat);
  7: PETSC_EXTERN PetscErrorCode MatCreate_IS(Mat);

  9: PETSC_EXTERN PetscErrorCode MatCreate_SeqAIJ(Mat);
 10: PETSC_EXTERN PetscErrorCode MatCreate_MPIAIJ(Mat);

 12: PETSC_EXTERN PetscErrorCode MatCreate_SeqBAIJ(Mat);
 13: PETSC_EXTERN PetscErrorCode MatCreate_MPIBAIJ(Mat);

 15: PETSC_EXTERN PetscErrorCode MatCreate_SeqSBAIJ(Mat);
 16: PETSC_EXTERN PetscErrorCode MatCreate_MPISBAIJ(Mat);

 18: PETSC_EXTERN PetscErrorCode MatCreate_SeqDense(Mat);
 19: PETSC_EXTERN PetscErrorCode MatCreate_MPIDense(Mat);
 20: #if defined(PETSC_HAVE_CUDA)
 21: PETSC_EXTERN PetscErrorCode MatCreate_SeqDenseCUDA(Mat);
 22: PETSC_EXTERN PetscErrorCode MatCreate_MPIDenseCUDA(Mat);
 23: #endif

 25: PETSC_EXTERN PetscErrorCode MatCreate_MPIAdj(Mat);
 26: PETSC_EXTERN PetscErrorCode MatCreate_Shell(Mat);
 27: PETSC_EXTERN PetscErrorCode MatCreate_Composite(Mat);

 29: PETSC_EXTERN PetscErrorCode MatCreate_SeqAIJPERM(Mat);
 30: PETSC_EXTERN PetscErrorCode MatCreate_MPIAIJPERM(Mat);

 32: PETSC_EXTERN PetscErrorCode MatCreate_SeqAIJSELL(Mat);
 33: PETSC_EXTERN PetscErrorCode MatCreate_MPIAIJSELL(Mat);

 35: #if defined(PETSC_HAVE_MKL_SPARSE)
 36: PETSC_EXTERN PetscErrorCode MatCreate_SeqAIJMKL(Mat);
 37: PETSC_EXTERN PetscErrorCode MatCreate_MPIAIJMKL(Mat);
 38: #endif

 40: #if defined(PETSC_HAVE_MKL_SPARSE_OPTIMIZE)
 41: PETSC_EXTERN PetscErrorCode MatCreate_SeqBAIJMKL(Mat);
 42: PETSC_EXTERN PetscErrorCode MatCreate_MPIBAIJMKL(Mat);
 43: #endif

 45: PETSC_EXTERN PetscErrorCode MatCreate_SeqAIJCRL(Mat);
 46: PETSC_EXTERN PetscErrorCode MatCreate_MPIAIJCRL(Mat);

 48: PETSC_EXTERN PetscErrorCode MatCreate_Scatter(Mat);
 49: PETSC_EXTERN PetscErrorCode MatCreate_BlockMat(Mat);
 50: PETSC_EXTERN PetscErrorCode MatCreate_Nest(Mat);

 52: PETSC_EXTERN PetscErrorCode MatCreate_SeqSELL(Mat);
 53: PETSC_EXTERN PetscErrorCode MatCreate_MPISELL(Mat);

 55: #if defined(PETSC_HAVE_CUDA)
 56: PETSC_EXTERN PetscErrorCode MatCreate_SeqAIJCUSPARSE(Mat);
 57: PETSC_EXTERN PetscErrorCode MatCreate_MPIAIJCUSPARSE(Mat);
 58: #endif

 60: #if defined(PETSC_HAVE_VIENNACL)
 61: PETSC_EXTERN PetscErrorCode MatCreate_SeqAIJViennaCL(Mat);
 62: PETSC_EXTERN PetscErrorCode MatCreate_MPIAIJViennaCL(Mat);
 63: #endif

 65: #if defined(PETSC_HAVE_FFTW)
 66: PETSC_EXTERN PetscErrorCode MatCreate_FFTW(Mat);
 67: #endif
 68: PETSC_EXTERN PetscErrorCode MatCreate_Elemental(Mat);

 70: PETSC_EXTERN PetscErrorCode MatCreate_Preallocator(Mat);
 71: PETSC_EXTERN PetscErrorCode MatCreate_Dummy(Mat);

 73: #if defined(PETSC_HAVE_HYPRE)
 74: PETSC_EXTERN PetscErrorCode MatCreate_HYPRE(Mat);
 75: #endif

 77: PETSC_EXTERN PetscErrorCode MatCreate_ConstantDiagonal(Mat);

 79: #if defined(PETSC_HAVE_HARA)
 80: PETSC_EXTERN PetscErrorCode MatCreate_HARA(Mat);
 81: #endif

 83: /*@C
 84:   MatRegisterAll - Registers all of the matrix types in PETSc

 86:   Not Collective

 88:   Level: advanced

 90: .seealso:  MatRegister()
 91: @*/
 92: PetscErrorCode  MatRegisterAll(void)
 93: {

 97:   if (MatRegisterAllCalled) return(0);
 98:   MatRegisterAllCalled = PETSC_TRUE;

100:   MatRegister(MATMFFD,           MatCreate_MFFD);

102:   MatRegister(MATMPIMAIJ,        MatCreate_MAIJ);
103:   MatRegister(MATSEQMAIJ,        MatCreate_MAIJ);
104:   MatRegister(MATMAIJ,           MatCreate_MAIJ);

106:   MatRegister(MATMPIKAIJ,        MatCreate_KAIJ);
107:   MatRegister(MATSEQKAIJ,        MatCreate_KAIJ);
108:   MatRegister(MATKAIJ,           MatCreate_KAIJ);

110:   MatRegister(MATIS,             MatCreate_IS);
111:   MatRegister(MATSHELL,          MatCreate_Shell);
112:   MatRegister(MATCOMPOSITE,      MatCreate_Composite);

114:   MatRegisterRootName(MATAIJ,MATSEQAIJ,MATMPIAIJ);
115:   MatRegister(MATMPIAIJ,         MatCreate_MPIAIJ);
116:   MatRegister(MATSEQAIJ,         MatCreate_SeqAIJ);

118:   MatRegisterRootName(MATAIJPERM,MATSEQAIJPERM,MATMPIAIJPERM);
119:   MatRegister(MATMPIAIJPERM,     MatCreate_MPIAIJPERM);
120:   MatRegister(MATSEQAIJPERM,     MatCreate_SeqAIJPERM);

122:   MatRegisterRootName(MATAIJSELL,MATSEQAIJSELL,MATMPIAIJSELL);
123:   MatRegister(MATMPIAIJSELL,     MatCreate_MPIAIJSELL);
124:   MatRegister(MATSEQAIJSELL,     MatCreate_SeqAIJSELL);

126: #if defined(PETSC_HAVE_MKL_SPARSE)
127:   MatRegisterRootName(MATAIJMKL, MATSEQAIJMKL,MATMPIAIJMKL);
128:   MatRegister(MATMPIAIJMKL,      MatCreate_MPIAIJMKL);
129:   MatRegister(MATSEQAIJMKL,      MatCreate_SeqAIJMKL);
130: #endif

132: #if defined(PETSC_HAVE_MKL_SPARSE_OPTIMIZE)
133:   MatRegisterRootName(MATBAIJMKL,MATSEQBAIJMKL,MATMPIBAIJMKL);
134:   MatRegister(MATMPIBAIJMKL,      MatCreate_MPIBAIJMKL);
135:   MatRegister(MATSEQBAIJMKL,      MatCreate_SeqBAIJMKL);
136: #endif

138:   MatRegisterRootName(MATAIJCRL,MATSEQAIJCRL,MATMPIAIJCRL);
139:   MatRegister(MATSEQAIJCRL,      MatCreate_SeqAIJCRL);
140:   MatRegister(MATMPIAIJCRL,      MatCreate_MPIAIJCRL);

142:   MatRegisterRootName(MATBAIJ,MATSEQBAIJ,MATMPIBAIJ);
143:   MatRegister(MATMPIBAIJ,        MatCreate_MPIBAIJ);
144:   MatRegister(MATSEQBAIJ,        MatCreate_SeqBAIJ);

146:   MatRegisterRootName(MATSBAIJ,MATSEQSBAIJ,MATMPISBAIJ);
147:   MatRegister(MATMPISBAIJ,       MatCreate_MPISBAIJ);
148:   MatRegister(MATSEQSBAIJ,       MatCreate_SeqSBAIJ);

150:   MatRegisterRootName(MATDENSE,MATSEQDENSE,MATMPIDENSE);
151:   MatRegister(MATMPIDENSE,       MatCreate_MPIDense);
152:   MatRegister(MATSEQDENSE,       MatCreate_SeqDense);
153: #if defined(PETSC_HAVE_CUDA)
154:   MatRegisterRootName(MATDENSECUDA,MATSEQDENSECUDA,MATMPIDENSECUDA);
155:   MatRegister(MATSEQDENSECUDA,   MatCreate_SeqDenseCUDA);
156:   MatRegister(MATMPIDENSECUDA,   MatCreate_MPIDenseCUDA);
157: #endif

159:   MatRegister(MATMPIADJ,         MatCreate_MPIAdj);
160:   MatRegister(MATSCATTER,        MatCreate_Scatter);
161:   MatRegister(MATBLOCKMAT,       MatCreate_BlockMat);
162:   MatRegister(MATNEST,           MatCreate_Nest);

164:   MatRegisterRootName(MATSELL,MATSEQSELL,MATMPISELL);
165:   MatRegister(MATMPISELL,         MatCreate_MPISELL);
166:   MatRegister(MATSEQSELL,         MatCreate_SeqSELL);

168: #if defined(PETSC_HAVE_CUDA)
169:   MatRegisterRootName(MATAIJCUSPARSE,MATSEQAIJCUSPARSE,MATMPIAIJCUSPARSE);
170:   MatRegister(MATSEQAIJCUSPARSE, MatCreate_SeqAIJCUSPARSE);
171:   MatRegister(MATMPIAIJCUSPARSE, MatCreate_MPIAIJCUSPARSE);
172: #endif

174: #if defined(PETSC_HAVE_VIENNACL)
175:   MatRegisterRootName(MATAIJVIENNACL,MATSEQAIJVIENNACL,MATMPIAIJVIENNACL);
176:   MatRegister(MATSEQAIJVIENNACL, MatCreate_SeqAIJViennaCL);
177:   MatRegister(MATMPIAIJVIENNACL, MatCreate_MPIAIJViennaCL);
178: #endif

180: #if defined(PETSC_HAVE_FFTW)
181:   MatRegister(MATFFTW,           MatCreate_FFTW);
182: #endif
183: #if defined(PETSC_HAVE_ELEMENTAL)
184:   MatRegister(MATELEMENTAL,      MatCreate_Elemental);
185: #endif

187:   MatRegister(MATPREALLOCATOR,   MatCreate_Preallocator);
188:   MatRegister(MATDUMMY,          MatCreate_Dummy);

190:   MatRegister(MATCONSTANTDIAGONAL,MatCreate_ConstantDiagonal);

192: #if defined(PETSC_HAVE_HYPRE)
193:   MatRegister(MATHYPRE,          MatCreate_HYPRE);
194: #endif

196: #if defined(PETSC_HAVE_HARA)
197:   MatRegister(MATHARA,           MatCreate_HARA);
198: #endif
199:   return(0);
200: }