[petsc-users] 2D vector in 3D dmda

Aurelien PONTE aurelien.ponte at ifremer.fr
Fri Sep 16 09:29:47 CDT 2016


Hi,

I've started using petsc4py in order to solve a 3D problem (inversion of 
elliptic operator).
I would like to store 2D metric terms describing the grid I am working 
on but don't know
how to do that given my domain is tiled in 3D directions:

self.da = PETSc.DMDA().create([self.grid.Nx, self.grid.Ny, self.grid.Nz],
                                       stencil_width=2)

I create my 3D vectors with, for example:

self.Q = self.da.createGlobalVec()

What am I supposed to do for a 2D vector?
Is it a bad idea?

thanks

aurelien



More information about the petsc-users mailing list