Dear Derek,

On Thu, 20 Aug 2009, Derek Gaston wrote:

> On Aug 20, 2009, at 2:15 AM, Tim Kroeger wrote:
>
>> Can it reuse a precoditioner between successive solves without setting it 
>> up again?
>
> It can if you create a Preconditioner that acts that way.  It sounds like 
> what you might want to do is create your own Preconditioner class... maybe 
> inheriting from PetscPreconditioner and then override the init() method so 
> that it doesn't clear the preconditioner.  Then you might also want to create 
> your own clear() method that does clear the preconditioner... and call this 
> manually whenever you want to reset it.

Thank you very much; works great!

Anyway, just to be curious, I have two more questions about this:

1. Why does PetscPreconditioner::clear() not do anything?  I guess, it 
should at least call PCDestroy(), or is that called elsewhere?

2. I wonder what the suggested way is to cancel the effect of 
LinearSolver::attach_precondition(), in particular if my 
Preconditioner object goes out of scope.  Currently, I'm just calling

        LinearSolver::clear();
        LinearSolver::attach_preconditioner(NULL);
        LinearSolver::set_preconditioner_type(ILU_PRECOND);

to do that.  (That's sort of an academic question because no solves 
will be performed after that anyway, but it avoids dangling pointers.)

Best Regards,

Tim

-- 
Dr. Tim Kroeger
[email protected]            Phone +49-421-218-7710
[email protected]            Fax   +49-421-218-4236

Fraunhofer MEVIS, Institute for Medical Image Computing
Universitaetsallee 29, 28359 Bremen, Germany


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to