<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Hello everyone,</div><div><br></div><div>I am having trouble using MatShellGetContext.<strong><br></strong></div><div><br></div><div>Here's the simple test I did :</div><div><br></div><div><br></div><div>typedef struct{</div><div> PetscInt testValue;</div><div> Mat matShell;</div><div> KSP currentCtx;</div><div>} AppCtx;</div><div><br></div><div><br></div><div>AppCtx context1;</div><div>KSPCreate(PETSC_COMM_WORLD,&context1.currentCtx);</div><div>context1.testValue=18;</div><div>MatCreateShell(PETSC_COMM_WORLD, nl, nl, nL, nL, context1.currentCtx, &context1.matShell);</div><div><br></div><div>AppCtx context2;</div><div>MatShellGetContext(context1.matShell, (void*)&context2);</div><div><br></div><div><br></div><div><br></div><div>It happens that context2.testValue is different from 18.</div><div><br></div><div>Any would have a clue on what I miss?</div><div><br></div><div>thanks a lot,</div><div>Nicolas</div><div><br></div></div></body></html>