[petsc-users] question about contexts

Dominik Szczerba dominik at itis.ethz.ch
Sat Oct 1 12:36:23 CDT 2011


Yes, I was trying to, but always get the previously mentioned error
when using PCShellSetApply

error: argument of type ‘PetscErrorCode
(FluidSolver::)(_p_PC*, _p_Vec*, _p_Vec*)’ does not match
‘PetscErrorCode (*)(_p_PC*, _p_Vec*, _p_Vec*)’

Is it still possible somehow? Would be great!

Dominik

On Sat, Oct 1, 2011 at 7:30 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> On Sat, Oct 1, 2011 at 12:28, Dominik Szczerba <dominik at itis.ethz.ch> wrote:
>>
>> Yes, thanks, this works. I somehow did not realize I can pass 'this'
>> as the context.
>> However, it has a serious drawback, that all the members the
>> out-of-class function needs to access must be public. I guess I will
>> have to live with this for now, but if you have some ideas to somehow
>> make the function a "friend" of my class, I am all ears...
>
> As mentioned above, make the callback function a static member of the class.


More information about the petsc-users mailing list