[petsc-users] DMDACreate3d for 2 different sizes

Matthew Knepley knepley at gmail.com
Sat Apr 27 10:49:52 CDT 2019


On Sat, Apr 27, 2019 at 11:41 AM TAY wee-beng via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> Hi,
>
> I need to use DMDACreate3d to create objects da and da_psr which have 2
> different sizes:
>
> call
> DMDACreate3d(MPI_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,size_x,size_y,&
>
>
> size_z,one,PETSC_DECIDE,PETSC_DECIDE,one,stencil_width,lx,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,da_p,ierr)
>
>
> call
> DMDACreate3d(MPI_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,size_x_psr,size_y_psr,&
>
>
> size_z_psr,one,PETSC_DECIDE,PETSC_DECIDE,one,stencil_width,lx,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,da_p_psr,ierr)
>
You left in 'ix' for the second call, but it cannot be right.

  Matt

> size_x/y/z_psr is actually half of size_x/y/z
>
> However, running the 2nd line gave error:
>
> [0]PETSC ERROR: Arguments are incompatible
> [0]PETSC ERROR: Ownership ranges sum to 76 but global dimension is 38
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
> for trou
> ble shooting.
>
> size_x is 76 but size_x_prs is 38.
>
> So do I need to create 2 comm (MPI communicator) if I need to create
> da_p_psr? are using different values of size_x_psr,size_y_psr, size_z_psr
> not enough?
> --
>
> Thank you very much.
>
> Yours sincerely,
>
> ================================================
> TAY Wee-Beng 郑伟明 (Zheng Weiming)
> Personal research webpage: *http://tayweebeng.wixsite.com/website
> <http://tayweebeng.wixsite.com/website>*
> Youtube research showcase: *https://goo.gl/PtvdwQ <https://goo.gl/PtvdwQ>*
> linkedin: *https://www.linkedin.com/in/tay-weebeng
> <https://www.linkedin.com/in/tay-weebeng>*
> ================================================
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190427/9a76fb01/attachment.html>


More information about the petsc-users mailing list