[petsc-users] Question on ISLocalToGlobalMappingGetIndices Fortran Interface
    Danyang Su 
    danyang.su at gmail.com
       
    Mon May  8 17:50:09 CDT 2023
    
    
  
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. 
 
#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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230508/eeff948e/attachment.html>
    
    
More information about the petsc-users
mailing list