[petsc-users] cannot convert ‘int*’ to ‘PetscInt*
Dave May
dave.mayhem23 at gmail.com
Sun Oct 16 02:13:18 CDT 2016
On Sunday, 16 October 2016, 丁老师 <ztdepyahoo at 163.com> wrote:
> Dear professor:
> I met the following error for Petsc 3.7.3.
> I delcare LocalSize as int, but it doesn't work anymore. it works for
> 3.6.3.
>
This error has nothing to do with the version of petsc. Whether it "worked"
is dependent on the size of PetscInt which is configure/architecture
dependent
>
>
> error: cannot convert ‘int*’ to ‘PetscInt* {aka long int*}’ for
> argument ‘2’ to ‘PetscErrorCode VecGetLocalSize(Vec, PetscInt*)’
> VecGetLocalSize (Petsc_b, &LocalSize);
>
> Regards
>
So just fix your code and declare LocalSize as a PetscInt.
If you insist on representing it as an int (which in general is unsafe as
PetscInt might be a 32-bit or 64-bit int), define a new variable and cast
LocalInt to int
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20161016/8f63c543/attachment.html>
More information about the petsc-users
mailing list