<div dir="ltr">On Thu, Oct 3, 2013 at 8:04 AM, mary sweat <span dir="ltr"><<a href="mailto:mary.sweat78@yahoo.it" target="_blank">mary.sweat78@yahoo.it</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div style="font-size:12pt;font-family:'times new roman','new york',times,serif">
<div><span style="white-space:pre-wrap">  </span>Hi all</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">I am very new to petsc and to c programming. I need to build a huge sparse matrix with a block structure.</div>
<div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">The problem is that my matrx may be huge (200000*200000) so i Need a way to define it through the kronecker product or memorizing just the overdiagonal, diagonal and subdiagonal block.</div>
<div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">Is it possible in petsc? any suggestions?</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:'times new roman','new york',times,serif">
thanks a million in advance</div></div></div></blockquote></div><br>This is the 2D Laplacian with a 5-point FD stencil. There are many PETSc examples which</div><div class="gmail_extra">form and solve this. For example, here is an example:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">  1,640,961 unknowns (on the fine level)</div><div class="gmail_extra"><br></div><div class="gmail_extra">  8,199,681 nonzeros</div><div class="gmail_extra">
<br></div><div class="gmail_extra">  ./ex5 -da_grid_x 21 -da_grid_y 21 -da_refine 6 -ksp_rtol 1.0e-9 -pc_type mg -pc_mg_levels 4 -snes_monitor -snes_view<br></div><div><br></div><div>This takes 375s on my underpowered Mac Air laptop.</div>
<div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div><div><br></div>-- <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
</div></div>