← Back to team overview

dolfin team mailing list archive

Re: [PETSC #13286] Make pcimpl.h a public API

 

Johan Jansson <johanjan@xxxxxxxxxxxxxxxx> writes:

> Hi!
>
> We've implemented a PetSc preconditioner in DOLFIN, but it seems the
> preconditioner implementation API (pcimpl.h) isn't a public API
> (i.e. user code cannot see it). We've solved this by copying pcimpl.h
> into DOLFIN, but this is not a good solution. Could you consider
> making the preconditioner implementation API public?
>
> The reason the preconditioner is implemented in DOLFIN and not in
> PetSc is because the preconditioner depends on DOLFIN. The idea is to
> solve a nonlinear system in a time-stepping method for ODEs by
> Newton's method with a Krylov solver preconditioned with a fixed-point
> solver. The fixed-point solver is part of DOLFIN. There are likely
> other such applications of externally implemented preconditioners.

  Not sure why you want this. The organization of PC mirrors that of every
other package in PETSc. The public headers in /include define the interface
that users need to use the libraries and nothing else. The implementation
headers define the underlying structure of these objects. This is a very
common component programming structure. The PETSc build system will allow this
include using <src/ksp/pc/pcimpl.h>. To me this makes sense since you are doing
something which depends on PETSc internals rather than just the interface, but
I am willing to listen to the other side.

  Thanks,

        Matt
-- 
"Failure has a thousand explanations. Success doesn't need one" -- Sir Alec Guiness



References