62 MFEM_ASSERT(mat,
"Must pass SparseMatrix as Operator");
70 nnz = mat->NumNonZeroElems();
72 const int *Ap = mat->HostReadI();
73 const int *Ai = mat->HostReadJ();
74 const real_t *Ax = mat->HostReadData();
76 csr_rowptr =
new int[m + 1];
77 reordered_csr_colind =
new int[nnz];
78 reordered_csr_nzval =
new real_t[nnz];
80 for (
int i = 0; i <= m; i++)
82 csr_rowptr[i] = Ap[i];
86 mat->SortColumnIndices();
88 for (
int i = 0; i < nnz; i++)
90 reordered_csr_colind[i] = Ai[i];
91 reordered_csr_nzval[i] = Ax[i];
96 PARDISO(pt, &maxfct, &mnum, &mtype, &phase, &m, reordered_csr_nzval, csr_rowptr,
97 reordered_csr_colind, &idum, &nrhs,
98 iparm, &msglvl, &ddum, &ddum, &error);
100 MFEM_ASSERT(error == 0,
"Pardiso symbolic factorization error");
104 PARDISO(pt, &maxfct, &mnum, &mtype, &phase, &m, reordered_csr_nzval, csr_rowptr,
105 reordered_csr_colind, &idum, &nrhs,
106 iparm, &msglvl, &ddum, &ddum, &error);
108 MFEM_ASSERT(error == 0,
"Pardiso numerical factorization error");
115 PARDISO(pt, &maxfct, &mnum, &mtype, &phase, &m, reordered_csr_nzval, csr_rowptr,
116 reordered_csr_colind, &idum, &nrhs,
117 iparm, &msglvl,
b.GetData(), x.
GetData(), &error);
119 MFEM_ASSERT(error == 0,
"Pardiso solve error");
136 PARDISO(pt, &maxfct, &mnum, &mtype, &phase, &m, reordered_csr_nzval, csr_rowptr,
137 reordered_csr_colind, &idum, &nrhs,
138 iparm, &msglvl, &ddum, &ddum, &error);
140 MFEM_ASSERT(error == 0,
"Pardiso free error");
143 delete[] reordered_csr_colind;
144 delete[] reordered_csr_nzval;