On Sun, Mar 7, 2010 at 12:20 PM, David sheehan <span dir="ltr"><<a href="mailto:david.sheehanjr@gmail.com">david.sheehanjr@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>>I mean Ax =b doesn't have A in explicit form, but in expression A=B+C1+C2+...+Cn, </div>
<div>>where B is main part of A in an explicit form, C1, C2,... and Cn are small portions </div>
<div>>comparing with B and they don't have an explicit form. Thus I want  to  make a </div>
<div>>preconditioner from B, then apply the preconditioner to Ax=b. Please tell me how I </div>
<div>>can do by PETSC sentences for PETSC solver, thanks.</div>
<div><br></div>
<div>>   call KSPSetOperators(ksp,A,B,......)</div>
<div> </div>
<div>However, A doesn't have an explicit matrix form, how to call</div>
<div>call KSPSetOperators(ksp,A,B,......)</div>
<div></div></blockquote><div><br></div><div>Use MATSHELL for A.</div><div><br></div><div>   Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>
?  thanks.</div>
<div> </div>
<div>Based on what I thought, once I got preconditioner of B, I am wondering if I can </div>
<div>define a special matrix-vector multiplication for A=B+C1+C2+...+Cn from a PETSC</div>
<div>sentence, such that it can do following</div>
<div>1) x1=B*x</div>
<div>2) x2=x1+ C1*x, where C1*x is a sequence of matrix-vector multiplications</div>
<div>3) x3= x2+C2*x,......</div>
<div>.....</div>
<div>4) xn+1=xn+Cn*x,where Cn*x is a squence of matrix-vector multiplications</div>
<div> </div>
<div>Then select a KSP iterative method such as GMRES to use the above matrix-vector</div>
<div>multiplication and preconditioner that I made from B.</div>
<div> </div>
<div>Could you please tell me if it is possible? if so (I hope), how can I do it ? thanks.</div>
<div> </div>
<div>David<br><br></div>
<div class="gmail_quote">On Sun, Mar 7, 2010 at 11:12 AM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">
<div style="word-wrap:break-word"><br>
<div>
<div>
<div>On Mar 7, 2010, at 10:57 AM, David sheehan wrote:</div><br>
<blockquote type="cite">
<div>>First, configure with Hypre . </div>
<div>You mean, configure for the installation of PETSC with hypre? thanks.</div></blockquote></div>   yes, add --download-hypre</div>
<div>
<div><br>
<blockquote type="cite">
<div> </div>
<div>>Then -pc_type hypre -pc_hypre_type boomeramg</div>
<div>You mean, without adding any information into code include, just compile and link</div>
<div>the code, to get an excuteable file, e.g. "a.out", then</div>
<div>a.out -pc_type hypre -pc_hypre_type boomeramg</div>
<div>is it right? thanks.</div></blockquote>
<div><br></div></div>   Yes,</div>
<div>
<div><br>
<blockquote type="cite">
<div><br>
<div>>I cannot understand exactly what you mean. However, if you want to create a PC</div>
<div>> based upon a >matrix which is not the system matrix A, you can specify it in</div>
<div>> KSPSetOperators().</div>
<div> </div>
<div>I mean Ax =b doesn't have A in explicit form, but in expression A=B+C1+C2+...+Cn, </div>
<div>where B is main part of A in an explicity form, C1, C2,... and Cn are small portions </div>
<div>comparing with B and they don't have an explicit form. Thus I want  to  make a </div>
<div>preconditioner from B, then apply the preconditioner to Ax=b. Please tell me how I </div>
<div>can do by PETSC sentences for PETSC solver, thanks.</div></div></blockquote>
<div><br></div></div>   call KSPSetOperators(ksp,A,B,......)</div>
<div><br></div><font color="#888888">
<div>   Barry</div></font>
<div>
<div><br></div>
<div><br>
<blockquote type="cite">
<div>
<div> </div>
<div> </div>
<div>David</div>
<div> </div><br></div>
<div class="gmail_quote">On Sun, Mar 7, 2010 at 12:32 AM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">
<div>On Sat, Mar 6, 2010 at 11:49 PM, David sheehan <span dir="ltr"><<a href="mailto:david.sheehanjr@gmail.com" target="_blank">david.sheehanjr@gmail.com</a>></span> wrote:<br></div>
<div class="gmail_quote">
<div>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">
<div>Hi, <br>I need your helps about PETSC as follows:<br>1) how can I call boomerAMG of HYPRE through PETSC as a solver and a preconditioner?<br></div></blockquote>
<div><br></div></div>
<div>First, configure with Hypre . Then -pc_type hypre -pc_hypre_type boomeramg</div>
<div>
<div> </div>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">
<div>2) how can I make a precondioner  from B matrix,  but apply the preconditioner to Ax=b in PETSC? <br>Thanks in advance.</div></blockquote>
<div><br></div></div>
<div>I cannot understand exactly what you mean. However, if you want to create a PC based upon a matrix</div>
<div>which is not the system matrix A, you can specify it in KSPSetOperators().</div>
<div><br></div>
<div>  Matt</div>
<div> </div>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote"><font color="#888888">
<div>David</div></font></blockquote></div>-- <br><font color="#888888">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></font></blockquote></div><br></blockquote></div><br></div></div></blockquote></div><br>
</blockquote></div><br><br clear="all"><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>