[petsc-users] How to set the value in Ax=b.

Barry Smith bsmith at mcs.anl.gov
Mon Apr 28 21:19:36 CDT 2014


On Apr 28, 2014, at 7:39 PM, Abhyankar, Shrirang G. <abhyshr at mcs.anl.gov> wrote:

> Zero out the sixth row, set A[5][5]= 1.0 and b[5]=3.14.

  You can use, for example, MatZeroRows() to zero that row if you have already assembled the matrix.

   Barry

> 
> On Apr 28, 2014, at 7:00 PM, "丁老师" <ztdepyahoo at 163.com> wrote:
> 
>> Dear group:
>>     I have assembled the coefficients of A and b. My computation alogrithm need to specify a component of x to be a constant value. for example x[5]=3.14;
>> then how to resolve this problem.
>> Regards
>> 
>> 



More information about the petsc-users mailing list