[petsc-users] Customizeing MatSetValuesBlocked(...)

Jinquan Zhong jzhong at scsolutions.com
Thu Aug 9 12:02:04 CDT 2012



"mingled" is not a very useful term. How about using an actual equation so we can have some clue what you mean.

o   I agree.  It is hard to have an accurate equation to for the structure of A’.  But if you are familiar with FEM,  you may know global stiffness matrix K=SIGMA_ij( K_ij ), the assembling process of elemental stiffness.  Here A’=K.
This cannot be true because you say A' is the larger part sparse and part dense matrix. Maybe you mean A rather than A'?

**Jed, A’=[A^-1 U B], not the transpose of A.  We need to solve for A’*x=b. A is dense matrix. B is a sparse matrix.  Therefore, A’ is a sparse matrix when the rule K=A’=SIGMA_ij (A^-1_ij)+SIGMA_i’j’(B_i’j’) applies.


o   We partition the FEM domain into two physical pieces due to different operations they are defined for.  After completing each operation, we need to operate on A^-1_ij and B_i’j’ such that we can have K=A’=SIGMA_ij (A^-1_ij)+SIGMA_i’j’(B_i’j’).
The sum of the inverses are not the inverses of the sum. Can you back up further to explain what underlying problem you are trying to solve?

** As I mentioned A’=K is the assembled global matrix using the rule K=A’=SIGMA_ij (A^-1_ij)+SIGMA_i’j’(B_i’j’) from FEM.  Here, SIGMA_ij (A^-1_ij) denotes the assembling process for A^-1_ij  into K according the DOFs of each node in the FEM model, so does SIGMA_i’j’(B_i’j’).  in this application, A^-1 and B have different indices sets.  Some of them may locate at the same locations in K.


If you have an "inverse" floating around, what sort of operator is it the inverse of.

•  A is a double complex matrix we have generated from a practical application using FEM.
Then there is no way A^{-1} should be stored as a dense matrix.

o   It is stored as a dense matrix in scalapack.  It stays in the same way in cores as scalapack finishes its inversion.  We could define A^-1 as dense matrix in PETSc.
It should not be done this way. A^{-1} should not be stored explicitly. Store the sparse finite element matrix A. Then when you want to "apply A^{-1}", solve with the sparse matrix.

 ** Jed, you are getting close to understand the problem related to QA.  A has to be inverted explicitly.  A^-1 has to be known entry by entry such that each entry in B could be assembled with A^-1 to form A’=K.  This is a requirement beyond technical issue.  This is a QA issue.


o   Another constraint we have is we have to use direct solver for QA purposes.  This brings up the needs to convert the dense matrix into MATAIJ or MATMPIAIJ.  However, in PETSc, converting dense matrix-formatted A^-1 into MATAIJ/ MATMPIAIJ also takes lots of time.
Choose the right tool for the job. When I cook dinner tonight, I plan to use a stove and a frying pan instead of a dump truck radiator and 200 feet of 18 gauge copper wire woven into a basket.

**  That why I came here for. PETSc is the right tool for solver in the last step A’*x=b.  However, due to the differences in addressing the matrix between PETSc and ScaLAPACK, I am asking for the kind help from this community to current issue.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120809/18c3ecf1/attachment.html>


More information about the petsc-users mailing list