<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm not sure I understand your statement about matrix shells being time consuming to implement. They are easy, see this example:<br><div><br></div><div><a href="http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex14f.F.html">http://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex14f.F.html</a></div><div><br></div><div><br></div><div>Randy M.</div><div><br></div><div><br><div><div>On Sep 19, 2013, at 12:01 PM, Reza Yaghmaie <<a href="mailto:reza.yaghmaie2@gmail.com">reza.yaghmaie2@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><br><div>Thanks Matthew for the reply.</div><div>It would be time consuming for me to implement an other way for creating a matrix and doing matmult and I am not concerned with how much time this will take.</div>
<div>So is there any way which you could possibly guide me through using matmpibaij?</div><div><br></div><div>Thanks alot,</div><div>-Reza </div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>
<br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 19, 2013 at 2:44 PM, Reza Yaghmaie <span dir="ltr"><<a href="mailto:reza.yaghmaie2@gmail.com" target="_blank">reza.yaghmaie2@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div>Dear Sir/Madam,</div><div><br></div><div>I am very new to PETSC and I have some issues running my code.</div>
<div>I want to create a global M*1 matrix (not a vector since I want to multiply this matrix with an other 1*M matrix and get a M*M matrix and I know that transpose function on vectors does not work so this is why I need to have a M*1 matrix)</div>
<div><br></div><div>I have used the below function and it works well for a M*M matrix</div><div><div><span style="white-space:pre-wrap"> </span>call MatCreateMPIBAIJ (PETSC_COMM_WORLD,6,6*numpn,6*numpn,</div><div> & PETSC_DETERMINE, PETSC_DETERMINE,</div>
<div> & PETSC_NULL_INTEGER, mr(np(246)),</div><div> & PETSC_NULL_INTEGER, mr(np(247)),</div><div> & matdummy2, ierr)</div></div><div><br></div><div><br></div><div>I am trying to change it accordingly for the M*1 matrix</div>
<div><br></div><div>So I use the following function</div><div><br></div><div><div><span style="white-space:pre-wrap"> </span>call MatCreateMPIBAIJ (PETSC_COMM_WORLD,alpha,m,n,</div><div> & PETSC_DETERMINE, PETSC_DETERMINE,</div>
<div> & PETSC_NULL_INTEGER, mr(np(246)),</div><div> & PETSC_NULL_INTEGER, mr(np(247)),</div><div> & mvecdummy1, ierr)</div></div><div><br></div><div>defining the following parameters respectively:</div>
<div>alpha=number of degrees of freedom per node=1</div><div>m=each processor number of rows=6*numpn</div><div>n=local number of columns=1</div><div>I think PETSC_DETERMINE represents the global number of rows and columns respectively.<br>
</div><div>I think PETSC_NULL_INTEGER represents the number of nonzero terms in rows in the diagonal matrix and off diagonal matrix respectively and mr(np(246), mr(np(247) show the nnz terms in columns of diagonal and off diagonal matrices.</div>
<div>mvecdummy1=the name of the matrix</div><div>ierr is just an error compliment in the subroutine.</div><div><br></div><div><br></div><div>The errors that I am getting are </div><div>d_nnz can not be less than 0</div><div>
o_nnz can not be less than -1</div><div><br></div><div>Please guide me through this issue.</div><div><br></div><div>Thanks alot,</div><div>-Reza</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div>
<div><br></div></div>
</blockquote></div><br></div>
</blockquote></div><br></div></body></html>