[petsc-users] petsc-users Digest, Vol 77, Issue 108

Fande Kong fdkong.jd at gmail.com
Sat May 30 12:17:30 CDT 2015


Message: 2
> Date: Sat, 30 May 2015 18:05:31 +0800
> From: Rongliang Chen <rongliang.chan at gmail.com>
> To: PETSc Users mail list <petsc-users at mcs.anl.gov>
> Subject: [petsc-users] NASM FormFunctionLocal
> Message-ID:
>         <
> CAOoA1QUTVYwBxr6c2NkztK+OZqrkGQsj9hP8_6E4XyPKWxebAg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi there,
>
> I am trying to use NASM to solve a nonlinear problem. In my
> FormFunctionLocal, I need to call DMDAVecGetArray(da, myvec, z). For the
> "-da_overlap 0" case, the code works fine.
>
> For the "-da_overlap 1" case, when I use the vector "myvec" created by
> DMCreateLocalVector, it works fine. But if I use the vector "myvec" created
> by DMCreateGlobalVector, I got the error messages:
> -----------------------
> [6]Arguments are incompatible
> [6]PETSC ERROR: Vector local size 597870 is not compatible with DMDA local
> sizes 619528 664392
> ----------------------
>
> And when I switch to "-da_overlap 2", both of the global and local version
> of "mrvec" got error messages:
> ----------------------------------
> [10]PETSC ERROR: Arguments are incompatible
> [10]PETSC ERROR: Vector local size 589680 is not compatible with DMDA local
> sizes 633144 678680
>
> [3]PETSC ERROR: Arguments are incompatible
> [3]PETSC ERROR: Vector local size 619528 is not compatible with DMDA local
> sizes 650256 696540
> -----------------------------------
>
> Can any one tell me how to use DMDAVecGetArray in FormFunctionLocal for
> NASM? Thanks.
>
> Best regards,
> Rongliang
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150530/95f3c7b3/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 3
> Date: Sat, 30 May 2015 09:55:42 -0500
> From: Matthew Knepley <knepley at gmail.com>
> To: Rongliang Chen <rongliang.chan at gmail.com>
> Cc: PETSc Users mail list <petsc-users at mcs.anl.gov>
> Subject: Re: [petsc-users] NASM FormFunctionLocal
> Message-ID:
>         <
> CAMYG4GmceYNTQnxFNTifPJ+5O39x3Rq1sMuY7mgDvt4WvJjiWA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> On Sat, May 30, 2015 at 5:05 AM, Rongliang Chen <rongliang.chan at gmail.com>
> wrote:
>
> > Hi there,
> >
> > I am trying to use NASM to solve a nonlinear problem. In my
> > FormFunctionLocal, I need to call DMDAVecGetArray(da, myvec, z). For the
> > "-da_overlap 0" case, the code works fine.
> >
> > For the "-da_overlap 1" case, when I use the vector "myvec" created by
> > DMCreateLocalVector, it works fine. But if I use the vector "myvec"
> created
> > by DMCreateGlobalVector, I got the error messages:
> > -----------------------
> > [6]Arguments are incompatible
> > [6]PETSC ERROR: Vector local size 597870 is not compatible with DMDA
> local
> > sizes 619528 664392
> > ----------------------
> >
> > And when I switch to "-da_overlap 2", both of the global and local
> version
> > of "mrvec" got error messages:
> > ----------------------------------
> > [10]PETSC ERROR: Arguments are incompatible
> > [10]PETSC ERROR: Vector local size 589680 is not compatible with DMDA
> > local sizes 633144 678680
> >
> > [3]PETSC ERROR: Arguments are incompatible
> > [3]PETSC ERROR: Vector local size 619528 is not compatible with DMDA
> local
> > sizes 650256 696540
> > -----------------------------------
> >
> > Can any one tell me how to use DMDAVecGetArray in FormFunctionLocal for
> > NASM? Thanks.
> >
>
> 1) You have to show the full error messages
>
> 2) You should simplify the problem for debugging. Run on 1 or 2 processes
>
> 3) The vector that comes into FormFunctionLocal() is a local vector
>
>   Thanks,
>
>     Matt
>
>
> > Best regards,
> > Rongliang
> >
> >
>


To use  the FormFunctionLocal, your input has to be local vector. If you
want to use the global vector as your input, you can add one function to
scatter global vector to local vector.


Thanks,

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


More information about the petsc-users mailing list