Yes, you would have to access it through reuse_preconditioner. I will
make the changes, test it out and let everyone know once the new API
has been committed. Let me know if you have any concerns.
On Fri, Apr 22, 2011 at 4:00 PM, David Knezevic <dknez@...> wrote:
> That sounds fine to me, it won't affect the current behavior for multiple
> rhs's. Do you plan to make same_preconditioner protected rather than public
> On 04/22/2011 04:41 PM, Vikram Garg wrote:
>> Alright, will this work ?
>> 1) Declare two new virtual functions in linear_solver.h: virtual bool
>> reuse_preconditioner() and LinearSolver::adjoint_solve(). If the user
>> wants to reuse preconditioners either for a different rhs or solving a
>> transpose matrix he/she calls reuse_preconditioner to set
>> same_preconditioner to true. If same_preconditioner is true and the
>> user calls adjoint_solve, PETSc uses KSPSolveTranspose, otherwise the
>> regular ImplicitSystem::adjoint_solve is called.
>> 2) Define the new functions in linear_solver.h/.C
>> 3) 3) Rework petsc_linear_solver.C to accomodate the use of
>> 4) Add to examples, and verify performance improvement in adjoint_solve
>> On Fri, Apr 15, 2011 at 3:35 PM, Roy Stogner<roystgnr@...>
>>> On Fri, 15 Apr 2011, Vikram Garg wrote:
>>>> So we would just have to know whether the function calling PETSc is
>>>> trying to solve the transpose or a different rhs. Do we want to pass
>>>> a vector of bools ? One for the reuse_preconditioner flag, and one
>>>> to check whether we are doing the transpose or a different rhs ?
>>> Definitely not a vector of bools; we can have accessors for more than
>>> one flag.
>>> I wouldn't implement the second distinction as a flag, but as a
>>> separate function call: LinearSolver::adjoint_solve().
Institute for Computational and Engineering Sciences
The University of Texas at Austin