<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span>Barry, <br></span></div><div><span><br></span></div><div><span> We will look into it and let you now in <br></span></div><div><span>case other questions arise. <br></span></div><div><br><span></span></div><div><span> Have a nice weekend, Domenico. <br></span></div><div><br></div> <div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Barry Smith <bsmith@mcs.anl.gov><br> <b><span style="font-weight: bold;">To:</span></b> domenico lahaye <domenico_lahaye@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> PETSc users list <petsc-users@mcs.anl.gov>; Abdul Hanan Sheikh
<hanangul12@yahoo.co.uk> <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, July 6, 2012 5:46 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [petsc-users] Adapting MatMult and PCMG functions in matrix-free method.<br> </font> </div> <br>
<br> <br>On Jul 6, 2012, at 12:00 AM, domenico lahaye wrote:<br><br>> Thank you for the additional feedback. <br>> <br>> What you suggest was my first guess. I did not <br>> see a way however to define the restriction operator <br>> as a product of two operators, in casu the operators <br>> A and M. This then lead to my question of defining <br>> the approximate solve with M inside the MatMult <br>> routine. <br>> <br> MATSHELL is the way to construct custom MatMults. If that is your question.<br><br> Barry<br><br>> Does this make sense? <br>> <br>> Domenico. <br>> <br>> ----- Original Message -----<br>> From: Barry Smith <<a ymailto="mailto:bsmith@mcs.anl.gov" href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>><br>> To: PETSc users list <<a ymailto="mailto:petsc-users@mcs.anl.gov"
href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br>> Cc: domenico lahaye <<a ymailto="mailto:domenico_lahaye@yahoo.com" href="mailto:domenico_lahaye@yahoo.com">domenico_lahaye@yahoo.com</a>>; Abdul Hanan Sheikh <<a ymailto="mailto:hanangul12@yahoo.co.uk" href="mailto:hanangul12@yahoo.co.uk">hanangul12@yahoo.co.uk</a>><br>> Sent: Friday, July 6, 2012 2:54 AM<br>> Subject: Re: [petsc-users] Adapting MatMult and PCMG functions in matrix-free method.<br>> <br>> <br>> On Jul 5, 2012, at 4:41 PM, Jed Brown wrote:<br>> <br>> > On Thu, Jul 5, 2012 at 10:38 AM, domenico lahaye <<a ymailto="mailto:domenico_lahaye@yahoo.com" href="mailto:domenico_lahaye@yahoo.com">domenico_lahaye@yahoo.com</a>> wrote:<br>> > Hi Jed, <br>> > <br>> > Thank you for your reply. The Algorithm II is described in the paper <br>> > <br>> > @ARTICLE{yoginabben1,<br>> > author
= {Erlangga, Y.A. and R. Nabben},<br>> > title = {On a multilevel {K}rylov Method for the {H}elmholtz Equation preconditioned<br>> > by Shifted {L}aplacian},<br>> > journal = {Electronic Transaction on Num. Analysis (ETNA)},<br>> > year = {2008},<br>> > volume = {31},<br>> > pages = {403--424},<br>> > }<br>> > <br>> > As I interpret this method, you have custom interpolation operators and a Krylov smoother that is itself a multigrid cycle with the shifted operator. In PETSc parlance, you have two matrices, the operator A and the preconditioning matrix M. Here M would be the shifted matrix and smoothing would involve MG cycles with coarsened approximations of M. I would start with the PCMG interface, use a Krylov method as the smoother, and perhaps use PCComposite or PCShell as the preconditioner for the Krylov smoother. Eventually the preconditioner
for your Krylov smoother will call the "other" MG cycle (a standard method applied to M).<br>> <br>> Note this shouldn't require "hacking" or manually modifying the PCMG code that currently exists. It would just involve clever use of a different PCMG inside the PC of the original PCMG. <br>> <br>> Barry<br>> <br>> > <br>> > Note that this method involves an enormous number of synchronization points as well as high operator complexity, so you may find the cost to be quite high even though the iteration count is not bad.<br>> > <br>> > <br>> > Kind wishes, Domenico.<br>> > <br>> > From: Jed Brown <<a ymailto="mailto:jedbrown@mcs.anl.gov" href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>><br>> > To: domenico lahaye <<a ymailto="mailto:domenico_lahaye@yahoo.com" href="mailto:domenico_lahaye@yahoo.com">domenico_lahaye@yahoo.com</a>>; PETSc users
list <<a ymailto="mailto:petsc-users@mcs.anl.gov" href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> <br>> > Cc: Abdul Hanan Sheikh <<a ymailto="mailto:hanangul12@yahoo.co.uk" href="mailto:hanangul12@yahoo.co.uk">hanangul12@yahoo.co.uk</a>> <br>> > Sent: Thursday, July 5, 2012 7:47 PM<br>> > <br>> > Subject: Re: [petsc-users] Adapting MatMult and PCMG functions in matrix-free method.<br>> > <br>> > Can you reference a paper or some notes on the algorithm?<br>> > <br>> > On Thu, Jul 5, 2012 at 8:40 AM, domenico lahaye <<a ymailto="mailto:domenico_lahaye@yahoo.com" href="mailto:domenico_lahaye@yahoo.com">domenico_lahaye@yahoo.com</a>> wrote:<br>> > Dear PETSc developers, <br>> > <br>> > Thank you for your support to Abdul. <br>> > <br>> > We are in the process of developing a multilevel <br>> > Krylov solver for the
Helmholtz equation. Abdul <br>> > has implemented Algorithm I for this purpose. <br>> > We next would like to implement Algorithm II. <br>> > Algorithm || amounts to replacing every occurrence <br>> > of the system matrix $A$ in Algorithm I by <br>> > $M^{-1} A$. This replacement should occur on all <br>> > levels. We thought of two ways to realize this <br>> > replacement. <br>> > <br>> > 1) We thought of adopting a matrix-free approach, <br>> > and to plug in the operation with $M^{-1}$ there. <br>> > This would require a ksp context inside MatMult. <br>> > We wonder whether this a approach is feasible to <br>> > take. <br>> > <br>> > 2) The other approach would by to implement a <br>> > customized pcmg preconditioner that we can adapt <br>> > to our needs. This could be a more elegant approach, <br>> > at the cost of doing
more work. Is the assumption <br>> > that the second approach is more elegant correct <br>> > and would you be able to give advice on how to tackle <br>> > this approach? <br>> > <br>> > Kind wishes, Domenico. <br>> > <br>> > <br>> > <br>> > <br>> > ----- Forwarded Message -----<br>> > From: Matthew Knepley <<a ymailto="mailto:knepley@gmail.com" href="mailto:knepley@gmail.com">knepley@gmail.com</a>><br>> > To: Abdul Hanan Sheikh <<a ymailto="mailto:hanangul12@yahoo.co.uk" href="mailto:hanangul12@yahoo.co.uk">hanangul12@yahoo.co.uk</a>>; PETSc users list <<a ymailto="mailto:petsc-users@mcs.anl.gov" href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> <br>> > Sent: Thursday, 5 July 2012, 15:45<br>> > Subject: Re: [petsc-users] Adapting MatMult and PCMG functions in matrix-free method.<br>> > <br>> > On Thu, Jul 5, 2012 at
7:34 AM, Abdul Hanan Sheikh <<a ymailto="mailto:hanangul12@yahoo.co.uk" href="mailto:hanangul12@yahoo.co.uk">hanangul12@yahoo.co.uk</a>> wrote:<br>> > Dear developers and users,<br>> > Summer greetings.<br>> > We have few question listen below: <br>> > <br>> > 1. <br>> > The first question is about adapting " MatMult " function in matrix-free method.<br>> > We intend to incorporate a KSP context inside "MatMult" . The immediate question is how to<br>> > provide more than one matrices as input. <br>> > <br>> > You provide extra data through the context for the MATSHELL<br>> > <br>> > Is this idea of incorporating a KSP context inside "MatMult" function workable ? Does it make any confrontation <br>> > with philosophy of development of Petsc. ? <br>> > <br>> > I am not sure you want this. Do you think PCKSP can do what you want? There is not enough
information here to help us answer.<br>> > <br>> > 2. <br>> > An other advance level feedback is needed. <br>> > Re-implementing PCMG function { mg.c } will lead any violation of philosophy of Petsc-development ??<br>> > <br>> > Again, there is not enough information. Can you do what you want by just replacing the monitors?<br>> > <br>> > Thanks,<br>> > <br>> > Matt<br>> > <br>> > 3. <br>> > Which one of the above both is more elegant and feasible to work on ? <br>> > <br>> > <br>> > Thanking in anticipation, <br>> > Abdul <br>> > <br>> > <br>> > <br>> > <br>> > <br>> > -- <br>> > What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>> > -- Norbert
Wiener<br>> > <br>> > <br>> > <br>> > <br>> > <br>> > <br>> > <br>> > <br>> <br><br><br><br> </div> </div> </div></body></html>