<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 class="" style="white-space:pre">        </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 class="" style="white-space:pre"> </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>