[petsc-users] help on how to use petsc in a smart way

Matthew Knepley knepley at gmail.com
Sat Jun 25 21:01:47 CDT 2011


On Sat, Jun 25, 2011 at 8:57 PM, NAN ZHAO <zhaonanavril at gmail.com> wrote:

> I think I may rephrase my problem like that, I have a huge matrix with n by
> n, at row m, I put a 1 in the location (m,m), other element in the row is
> zero. Then I construct a vector with size n, put zero in the m location. All
> other location I just put random number. I should get a answer vector with 0
> in the mth element, But I some times got unreasonable number in this
> location. I am wondering if there is some option in petsc to avoid this
> case.
>

Use -pc_type lu -ksp_type preonly. You will get zero or it will tell you
that the system is singular.

   Matt


> Thanks
>
>
> On Sat, Jun 25, 2011 at 2:58 PM, Matthew Knepley <knepley at gmail.com>wrote:
>
>> On Sat, Jun 25, 2011 at 2:49 PM, NAN ZHAO <zhaonanavril at gmail.com> wrote:
>>
>>> Dear all,
>>>
>>> I have a question about how to use the ksp in a smart way to solve a
>>> linear system. I had a simple test to generate a random matrix and vector,
>>> but I put only one nonzero value in a row (let's say 1), and in the respect
>>> location of the  RHS vector I put a zero. The size of the matrix is kind of
>>> big, I saw petsc some time give unreasonable value at that loaction (it
>>> should be zero or some really small number). I want to know if there is a
>>> way to avoid it?
>>>
>>
>> The problem sounds degenerate. A full rank A with 1 nonzero/row and b = 0
>> would not have a solution other than 0. What will this tell you?
>>
>>    Matt
>>
>>
>>> Thanks
>>>
>> --
>> What most experimenters take for granted before they begin their
>> experiments is infinitely more interesting than any results to which their
>> experiments lead.
>> -- Norbert Wiener
>>
>
>


-- 
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110625/85f13a01/attachment.htm>


More information about the petsc-users mailing list