[petsc-users] problem with MatShellGetContext

Nicolas Pozin nicolas.pozin at inria.fr
Mon Aug 3 09:13:08 CDT 2015


Hello everyone, 

I am having trouble using MatShellGetContext. 

Here's the simple test I did : 


typedef struct{ 
PetscInt testValue; 
Mat matShell; 
KSP currentCtx; 
} AppCtx; 


AppCtx context1; 
KSPCreate(PETSC_COMM_WORLD,&context1.currentCtx); 
context1.testValue=18; 
MatCreateShell(PETSC_COMM_WORLD, nl, nl, nL, nL, context1.currentCtx, &context1.matShell); 

AppCtx context2; 
MatShellGetContext(context1.matShell, (void*)&context2); 



It happens that context2.testValue is different from 18. 

Any would have a clue on what I miss? 

thanks a lot, 
Nicolas 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150803/17b325ab/attachment.html>


More information about the petsc-users mailing list