[petsc-users] NASM FormFunctionLocal

Barry Smith bsmith at mcs.anl.gov
Sat May 30 12:09:06 CDT 2015


> On 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

I think you are changing something else at the same time you changed the overlap.  The number ^^^^  619528 is the local size of the global vector and it should remain the same when you change the overlap but below you have TWO other numbers 633144 and 650256  Do you have more than one DMDA? 
Run changing absolutely nothing except the overlap.
> ----------------------
> 
> 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
> 



More information about the petsc-users mailing list