[petsc-users] Which type of matrix do I use to define my own interpolation operators in PCMG?

Jed Brown jed at jedbrown.org
Mon Aug 21 17:00:24 CDT 2017


Ben Yee <bcyee at umich.edu> writes:

> Hi,
>
> I was wondering what type of matrix I should use if I want to define my own
> interpolation matrix in PCMG.
>
> I don't have any DM objects, and I wanted to provide the matrix entries to
> the interpolation matrix manually.  Moreover, I want the coarse grid
> operators to be defined via the Galerkin process, so I only need to define
> the interpolation operator.  The fine grid problem/operator is defined as a
> parallel sparse matrix using MATMPIAIJ.  My interpolation operator is also
> parallel and sparse -- does that mean I should also use MATMPIAIJ for my
> interpolation operator?
>
> I did some digging but I couldn't find any examples where the
> interpolation/restriction operators in PETSc were defined explicitly by the
> user. 

src/ksp/pc/examples/tests/ex5.c

> I also found the documentation for the matrix type MATMAIJ (
> http://www.mcs.anl.gov/petsc/petsc-current/docs/
> manualpages/Mat/MATMAIJ.html#MATMAIJ), which indicates that it is a
> specialized matrix for interpolation/restriction operations.  However,
> I also noticed that the description for MATMAIJ indicates that it will
> interpolate each component the same way independently.  I do have a
> multicomponent problem, but I was hoping to interpolate each component
> differently -- does that mean I can't use the MATMAIJ matrix type?

Correct, MAIJ applies the Kronecker product of a scalar interpolation
with the identity so it acts the same on each component.  It's more
efficient if you want each component treated the same way.

> If it is recommended that I use the MATMAIJ matrix type, I would like some
> clarification regarding the MatCreateMAIJ function.  In particular, I'm not
> really sure how the input matrix "A" (first argument of MatCreateMAIJ) is
> supposed to be -- the description of MatCreateMAIJ says "the AIJ matrix
> describing the action on blocks," but I don't know what that means.  The
> use of MatCreateMAIJ in ex48.c is not really clear to me.
>
> Any guidance would be much appreciated.  Thanks!
>
> -- 
> Ben Yee
>
> NERS PhD Candidate, University of Michigan
> B.S. Mech. & Nuclear Eng., U.C. Berkeley
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170821/9729a762/attachment.sig>


More information about the petsc-users mailing list