<div dir="ltr"><div dir="ltr">On Thu, Mar 31, 2022 at 10:11 AM Medane TCHAKOROM <<a href="mailto:medane.tchakorom@univ-fcomte.fr">medane.tchakorom@univ-fcomte.fr</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Hello,</p>
<p>I got one issue with MatMult method that I do not understand.</p>
<p>Whenever I multiply Matrix A by vector b (as shown below), the
printed result</p>
<p>show a value with an exponent that is far away form the expected
result. So I did the same</p>
<p>Matrix-vector product in python and get the expected answer
(shown below).</p>
<p>Can someone please explain what is going on, cause I need the
exact results in order to compute the norm.</p></div></blockquote><div>I did the multiply by hand. Your Python results are wrong for rows 5 and 6, but the PETSc results are correct.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
<p>Thanks<br>
</p>
<p><br>
</p>
<p><b>Matrix A</b><br>
</p>
<p>Mat Object: 1 MPI processes<br>
type: seqaij<br>
row 0: (0, 4.) (1, -1.) (4, -1.) <br>
row 1: (0, -1.) (1, 4.) (2, -1.) (5, -1.) <br>
row 2: (1, -1.) (2, 4.) (3, -1.) (6, -1.) <br>
row 3: (2, -1.) (3, 4.) (7, -1.) <br>
row 4: (0, -1.) (4, 4.) (5, -1.) (8, -1.) <br>
row 5: (1, -1.) (4, -1.) (5, 4.) (6, -1.) (9, -1.) <br>
row 6: (2, -1.) (5, -1.) (6, 4.) (7, -1.) (10, -1.) <br>
row 7: (3, -1.) (6, -1.) (7, 4.) (11, -1.) <br>
</p>
<p><br>
</p>
<p><b>Vector b</b></p>
<p><br>
Vec Object: 1 MPI processes<br>
type: seq<br>
0.998617<br>
0.997763<br>
0.997763<br>
0.998617<br>
0.996705<br>
0.994672<br>
0.994672<br>
0.996705<br>
0.993529<br>
0.989549<br>
0.989549<br>
0.993529<br>
0.997285<br>
0.995611<br>
0.995611<br>
0.997285<br>
</p>
<p><br>
</p>
<p><b>PETSc Results with : MatMult (A,x,
some_vector_to_store_the_result)</b></p>
<p>Vec Object: 1 MPI processes<br>
type: seq<br>
2.<br>
1.<br>
1.<br>
2.<br>
1.<br>
0.<br>
<b>1.11022e-16</b><br>
1.</p>
<p><br>
</p>
<p><br>
</p>
<p><b>Python result:</b></p>
<p><span style="color:rgb(213,213,213);font-family:monospace;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;background-color:rgb(56,56,56);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">[ 2. 0.999999 0.999999 2. 0.990577 -0.015165 -0.015165 0.990577]</span></p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>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><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>