[petsc-users] A quick question on DMDACreate3d

Zhenglun (Alan) Wei z240w014 at ku.edu
Wed Dec 26 12:05:29 CST 2012


Dear folks,
      I have a quick question on the DMDACreate3d.
      In the manual, it says that the input format of this function is:

PetscErrorCode  DMDACreate3d(MPI_Comm comm,DMDABoundaryType bx,DMDABoundaryType by,DMDABoundaryType bz,DMDAStencilType stencil_type,PetscInt M,
                PetscInt N,PetscInt P,PetscInt m,PetscInt n,PetscInt p,PetscInt dof,PetscInt s,const PetscInt lx[],const PetscInt ly[],const PetscInt lz[],DM *da)


      Now, I'm trying to manually define the "arrays containing the 
number of nodes in each cell along the x, y, and z coordinates". 
Therefore, my focus turns to 'lx[]', 'ly[]' and 'lz[]'. I suppose that 
they're not simply just three integers; they may be three integer type 
arrays, as I guess. However, I checked all examples listed for this 
function. None of them teaches me how to implement this three parameters 
except 'PETSC_NULL'. Could you please provide me an extra example to 
demonstrate how to use DMDACreate3d or DMDACreate2d with non-null 
'lx[]', 'ly[]' and 'lz[]'.
      Or, a demonstration in 1D would be a good example. Say, I have a 
1D uniform mesh; the number of grid in x-direction is 300. I want to use 
4 processes to evenly divide this mesh. What should I input for 'lx[]' 
for each process?

thank you so much and Happy New Year!! :)
Alan

   


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


More information about the petsc-users mailing list