Hello, I am developing a poisson solver based on the example code 
petsc-3.4.0/src/ksp/ksp/examples/tutorials/ex45.c.

I have a question on utilizing functions
 KSPSetComputeRHS (KSP ksp,PetscErrorCode (*func)(KSP,Vec,void*),void *ctx) and 
ComputeRHS(KSP,Vec,void*) which is the (*func)(KSP,Vec,void*) in the interface. 
 

Since I have source term generated on the right hand side of Poisson equation 
and they are computed outside KSPSetComputeRHS() and ComputeRHS(), an array of 
source term variables must be passed into ComuteRHS() function. From the manual 
online, it seems the interface of ComputeRHS is only for passing variables from 
inside of ComputeRHS to KSPSetComputeRHS. There is not a dummy for passing into 
ComputeRHS. Can anybody give me suggestions on it? Thanks in advance.


                                          

Reply via email to