Actual source code: clique.cxx
1: #include <../src/mat/impls/aij/mpi/clique/matcliqueimpl.h>
3: /*
4: MatConvertToSparseElemental: Convert Petsc aij matrix to sparse elemental matrix
6: input:
7: + A - matrix in seqaij or mpiaij format
8: - reuse - denotes if the destination matrix is to be created or reused.
9: Use MAT_INPLACE_MATRIX for inplace conversion, otherwise use MAT_INITIAL_MATRIX or MAT_REUSE_MATRIX.
11: output:
12: . cliq - Clique context
13: */
14: PetscErrorCode MatConvertToSparseElemental(Mat A, MatReuse reuse, Mat_SparseElemental *cliq)
15: {
16: return 0;
17: }
19: PetscErrorCode MatView_SparseElemental(Mat A, PetscViewer viewer)
20: {
21: PetscBool iascii;
23: PetscObjectTypeCompare((PetscObject)viewer, PETSCVIEWERASCII, &iascii);
24: if (iascii) {
25: PetscViewerFormat format;
26: PetscViewerGetFormat(viewer, &format);
27: if (format == PETSC_VIEWER_ASCII_INFO) {
28: PetscViewerASCIIPrintf(viewer, "SparseElemental run parameters:\n");
29: } else if (format == PETSC_VIEWER_DEFAULT) { /* matrix A is factored matrix, remove this block */
30: Mat Aaij;
31: PetscViewerASCIIUseTabs(viewer, PETSC_FALSE);
32: PetscViewerASCIIUseTabs(viewer, PETSC_TRUE);
33: PetscPrintf(PetscObjectComm((PetscObject)viewer), "SparseElemental matrix\n");
34: MatComputeOperator(A, MATAIJ, &Aaij);
35: MatView(Aaij, viewer);
36: MatDestroy(&Aaij);
37: }
38: }
39: return 0;
40: }
42: PetscErrorCode MatDestroy_SparseElemental(Mat A)
43: {
44: PetscObjectComposeFunction((PetscObject)A, "MatFactorGetSolverType_C", NULL);
45: return 0;
46: }
48: PetscErrorCode MatSolve_SparseElemental(Mat A, Vec B, Vec X)
49: {
50: return 0;
51: }
53: PetscErrorCode MatCholeskyFactorNumeric_SparseElemental(Mat F, Mat A, const MatFactorInfo *info)
54: {
55: return 0;
56: }
58: PetscErrorCode MatCholeskyFactorSymbolic_SparseElemental(Mat F, Mat A, IS r, const MatFactorInfo *info)
59: {
60: return 0;
61: }
63: /*MC
64: MATSOLVERSPARSEELEMENTAL - A solver package providing direct solvers for sparse distributed
65: and sequential matrices via the external package Elemental
67: Use ./configure --download-elemental to have PETSc installed with Elemental
69: Use -pc_type lu -pc_factor_mat_solver_type sparseelemental to use this direct solver
71: This is currently not supported.
73: Developer Note:
74: Jed Brown made the interface for Clique when it was a standalone package. Later Jack Poulson merged and refactored Clique into
75: Elemental but since the Clique interface was not tested in PETSc the interface was not updated for the new Elemental interface. Later Barry Smith updated
76: all the boilerplate for the Clique interface to SparseElemental but since the solver interface changed dramatically he did not update the code
77: that actually calls the SparseElemental solvers. We are waiting on someone who has a need to complete the SparseElemental interface from PETSc.
79: Level: beginner
81: .seealso: `PCFactorSetMatSolverType()`, `MatSolverType`
82: M*/
84: PetscErrorCode MatFactorGetSolverType_SparseElemental(Mat A, MatSolverType *type)
85: {
86: *type = MATSOLVERSPARSEELEMENTAL;
87: return 0;
88: }
90: static PetscErrorCode MatGetFactor_aij_sparseelemental(Mat A, MatFactorType ftype, Mat *F)
91: {
92: return 0;
93: }
95: PETSC_EXTERN PetscErrorCode MatSolverTypeRegister_SparseElemental(void)
96: {
97: MatSolverTypeRegister(MATSOLVERSPARSEELEMENTAL, MATMPIAIJ, MAT_FACTOR_LU, MatGetFactor_aij_sparseelemental);
98: return 0;
99: }