get the preconditioner matrix

Mark Adams adams at pppl.gov
Thu Apr 13 19:40:42 CDT 2006


Letian,

I think what you are asking for is the capacity to save the state of  
the PC after setup which I have not implemented.  As Barry said,  
saving the explicit operator would not be practical and I don't know  
of a linear solver that provides for saving the state in the way that  
I think you are asking (but it would be more natural and easy for a  
direct solver to save factors).  But you could keep using the same PC  
for different problems - at your own risk of course - in one run of  
your code.

Mark

On Apr 13, 2006, at 12:50 PM, Barry Smith wrote:

>
>   Again, this does not make sense. Prometheus as a dense matrix
> will 1) require much much to much memory and 2) take much to
> long to apply O(n^2) flops. The whole idea behind multilevel
> methods is to be roughly order O(n) to apply.
>
>   If Mark has provided a PCView() and PCLoad() for Prometheus
> then it could be saved and reused (but it would not be saved
> as a dense matrix), BUT I don't think Mark has done this (plus
> it would very likely require rerunning on the same number of
> processors).
>
>   You just need to calculate the preconditioner for each time
> you run the program.
>
>    Barry
>
> On Thu, 13 Apr 2006, Letian Wang wrote:
>
>> Barry:
>>
>> Thank you for your reply. What I want to do is to use PETSc for
>> optimization. I use Prometheus pre-conditioner to solve the  
>> initial problem.
>> Usually it spends much time on getting the pre-conditioner, then the
>> iterations are relatively going faster. I'm thinking to save the
>> pre-conditioner matrix for the initial problem (Now I know I can  
>> do that by
>> PCComputeExplicitOperator), then for other very similar problems,  
>> I can pass
>> the saved pre-conditioner and apply them directly to the new  
>> problem. Do you
>> think it will work?
>>
>> Is there any routine to apply the saved matrix as pre-conditioner?  
>> Or I have
>> to program an user-defined PC routine?
>>
>> Thanks.
>>
>> Letian
>>
>> -----Original Message-----
>> From: owner-petsc-users at mcs.anl.gov [mailto:owner-petsc- 
>> users at mcs.anl.gov]
>> On Behalf Of Barry Smith
>> Sent: Wednesday, April 12, 2006 7:56 PM
>> To: petsc-users at mcs.anl.gov
>> Subject: Re: get the preconditioner matrix
>>
>>
>>   Letian,
>>
>>   What do you mean be "pre-conditioner matrix"? It is very rare
>> that a preconditioner is explicitly represented as a matrix; it is  
>> almost
>> always just some code that applies the operator. In general an  
>> explicitly
>> represented preconditioner would actually be a dense matrix.
>>
>>   If you truly want this dense matrix you can call
>> PCComputeExplicitOperator()
>> and store the resulting matrix to a file.
>>
>>    Barry
>>
>>
>> On Wed, 12 Apr 2006, Letian Wang wrote:
>>
>>> Dear all,
>>>
>>>
>>>
>>> Is it possible to obtain the PETSc pre-conditioner matrix and  
>>> output it to
>> a
>>> file? How can I do that?  Thanks.
>>>
>>>
>>>
>>> Letian Wang
>>>
>>>
>>>
>>>
>>
>>
>>

**********************************************************************
Mark Adams Ph.D.                                   Columbia University
289 Engineering Terrace                                        MC 4701
New York NY 10027
adams at pppl.gov                                www.columbia.edu/~ma2325
voice: 212.854.4485                                  fax: 212.854.8257
**********************************************************************






More information about the petsc-users mailing list