On Mon, May 8, 2023 at 6:50 PM Danyang Su <danyang...@gmail.com> wrote:
> Dear PETSc-Users, > > > > Is there any changes in ISLocalToGlobalMappingGetIndices function after > PETSc 3.17? > > > > In the previous PETSc version (<= 3.17), the function > ‘ISLocalToGlobalMappingGetIndices(ltogm,ltog,idltog,ierr)’ works fine, even > though the value of idltog looks out of bound (-11472655627481), > https://www.mcs.anl.gov/petsc/petsc-3.14/src/ksp/ksp/tutorials/ex14f.F90.html. > The value of idltog is not clear. > > > > In the latest PETSc version, this function can be called, but due to the > extreme value of idltog, the code fails. I also tried to use > ‘ISLocalToGlobalMappingGetIndicesF90(ltogm,ltog,ierr)’ () but no success. > * You do want the latter: doc/changes/319.rst:- Deprecate ``ISLocalToGlobalMappingGetIndices()`` in favor of ``ISLocalToGlobalMappingGetIndicesF90()`` * You might look at a test: src/ksp/ksp/tutorials/ex14f.F90: PetscCall(ISLocalToGlobalMappingGetIndicesF90(ltogm,ltog,ierr)) * If you use 64 bit integers be careful. * You want to use a memory checker like Valgrind or Sanitize. Mark > > #if (PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR <= 4) > > call DMDAGetGlobalIndicesF90(dmda_flow%da,PETSC_NULL_INTEGER, & > > idx,ierr) > > CHKERRQ(ierr) > > #else > > call DMGetLocalToGlobalMapping(dmda_flow%da,ltogm,ierr) > > CHKERRQ(ierr) > > call ISLocalToGlobalMappingGetIndices(ltogm,ltog,idltog,ierr) > > CHKERRQ(ierr) > > #endif > > > > dof = dmda_flow%dof > > > > do ivol = 1, nngl > > > > #if (PETSC_VERSION_MAJOR == 3 && PETSC_VERSION_MINOR <= 4) > > node_idx_lg2pg(ivol) = (idx(ivol*dof)+1)/dof > > #else > > node_idx_lg2pg(ivol) = (ltog(ivol*dof + idltog)+1)/dof > > #endif > > end do > > > > Any suggestions on that. > > > > Thanks, > > > > Danyang >