Ok, So I have figured this out a bit better now, facepalm moment as I finally realised that this is exactly what the DMDA exists to do... I need to create a vector using the DMCreate*Vector functions and can then insert values using the assembly functions.
Then, if I understand correctly, in order to have the state I need to multiply with my operator I should make use of the DMDAGlobalToNaturalBegin() and End() functions to ensure the correct ordering. Do I then need to ensure I have reverted it to global ordering before I try to apply finite difference methods again? Thanks P On 12/09/18 14:27, Phil Tooley wrote: > I will preface this by saying I am new to PETSc and am still trying to > get my head around all of the layout mapping that is done. That means I > may well have fundamentally misunderstood something, but hopefully > someone will be able to to put me right. > > In my application I have some 3D pixel data which I want to manipulate > using finite difference methods and then transform by viewing as a 1-D > vector and multiplying by a large sparse matrix operator. > > I would assume that the correct way to do this is by creating a DMDA to > hold the image data and ghosting appropriately to apply my finite > difference operations. Then I had hoped that I could use some form of > application ordering to allow viewing the data as a vector that can be > multiplied with my operator matrix. This is where I have come unstuck, > I may just be missing something obivous but I can't figure out how to do > this. Can anyone point me in the correct direction please? > > Many Thanks > -- Phil Tooley Research Software Engineering University of Sheffield
