On 10/4/06, <b class="gmail_sendername">Xiaoxu Wang</b> <<a href="mailto:xiwang@dragon.rutgers.edu">xiwang@dragon.rutgers.edu</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi, Thank you for your help already. Can anybody tell me how to set the<br>size of local matrix? Can I set it arbitrarily?</blockquote><div><br>Yes, you can. If you also set the global size it must be consistent.<br><br> Matt
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Xiaoxu<br><br>Xiaoxu Wang wrote:<br><br>><br>> The error is at line 1023 of "
plog.c".<br>> ---------------<br>> An unhandled exception of type 'System.NullReferenceException'<br>> occurred in Unknown Module.<br>><br>> Additional information: Object reference not set to an instance of an
<br>> object.<br>> ----------------<br>><br>> The matrix I am trying to initialize is the stiffness matrix K of<br>> finite element methods. Later the dynamical system is solved as (I +<br>> Dt*K) U(t+1) = U(t) +
Dt.F(t) by calling KSPSolve. Any idea how to set<br>> the number of local rows? I am running the code on PC now, but want<br>> to keep MatCreateMPIAIJ in it.<br>> Xiaoxu<br>> ----- Original Message ----- From: "Barry Smith" <
<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>><br>> To: <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br>> Sent: Tuesday, October 03, 2006 8:32 AM<br>> Subject: Re: MatCreateMPIAIJ
<br>><br>><br>>><br>>><br>>> On Mon, 2 Oct 2006, Xiaoxu Wang wrote:<br>>><br>>>> Hi,<br>>>><br>>>> I am a beginner on PETSC. This is my question about<br>>>> MatCreateMPIAIJ. I
<br>>>> have a sparse matrix and only know the total number of nonzeros each<br>>>> row. The<br>>>> number of local rows and the number of local columns has been set to<br>>>> PETSC_DECIDE. Therefore I don't know the size of each portion and it
<br>>>> is hard<br>>>> to tell d_nnz and o_nnz. I use the total number of nunzeros as d_nnz<br>>>> and get<br>>>> an allocation error.<br>>><br>>><br>>><br>>> It would be helpful to know the exact error message:
<br>>><br>>>> How to deal with this problem? Should I explicitly<br>>>> specify the number of local rows and the number of local columns and<br>>>> calculate<br>>>> d_nnz and o_nnz? Or let PETSC decide the number of local rows and
<br>>>> the number<br>>>> of local columns, and then use another function to get these<br>>>> values? Any<br>>>> other better solution?<br>>><br>>><br>>><br>>> You should specifically set the number of local rows and columns
<br>>> and then<br>>> compute the values of d_nnz and o_nnz. How you determine d_nnz and<br>>> o_nnz is<br>>> problem dependent and depends on what type of discretization you are<br>>> using:
<br>>> finite differences, elements etc.<br>>><br>>><br>>> Barry<br>>><br>>>><br>>>> Thanks a lot,<br>>>> Xiaoxu<br>>>><br>>>><br>>><br>>>
<br>><br><br></blockquote></div><br><br clear="all"><br>-- <br>"Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness