[petsc-users] Position based coupling matrix

Mohammad Imtiaz M.Imtiaz at victorchang.edu.au
Tue Mar 17 06:15:13 CDT 2015


Hi,

I am trying to solve a 2 dimensional finite difference reaction diffusion problem where diffusional coupling is position based, i.e. fibres, discontinuities etc occur due to material properties (e.g. Heart tissue).

I have managed to import a matlab matrix representing coupling in four directions as below:


    PetscViewerBinaryOpen(PETSC_COMM_WORLD,”R",FILE_MODE_READ,&fd);

    VecCreate(PETSC_COMM_WORLD,&R);

    VecLoad(R,fd);

…..Repeated to get L, U, D, coupling.

How can I now make R,L,U,D available to my finite difference part of the code? So that I can do


v is field.


vxx = u[j][i].R*(u[j][i-1].v - u[j][i].v)  + u[j][i].L*(u[j][i+1].v – u[j][i].v);


And similarly for up & down coupling.





Thanks
Mohammad Imtiaz




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


More information about the petsc-users mailing list