Date: 2026-03-01T05:24:55+00:00

Actual source code: petscmatmod.F90

      1: module petscmatdef
      2:   use, intrinsic :: ISO_C_binding
      3:   use petscvecdef
      4: #include "petsc/finclude/petscmat.h"
      5: #include "petsc/finclude/petscmatcoarsen.h"
      6: #include "petsc/finclude/petscpartitioner.h"
      7: #include "petsc/finclude/petscmathypre.h"
      8: #include "petsc/finclude/petscmathtool.h"
      9: #include "petsc/finclude/petscmatelemental.h"
     10: #include <../ftn/mat/petscmat.h>
     11: #include <../ftn/mat/petscmatcoarsen.h>
     12: #include <../ftn/mat/petscpartitioner.h>

     14: end module

     16: !     ----------------------------------------------

     18: module petscmat
     19:   use petscmatdef
     20:   use petscvec

     22: #include <../src/mat/ftn-mod/petscmat.h90>
     23: #include <../ftn/mat/petscmat.h90>
     24: #include <../ftn/mat/petscmatcoarsen.h90>
     25: #include <../ftn/mat/petscpartitioner.h90>

     27: !     deprecated functions

     29:   interface MatDenseGetArrayF90
     30:     module procedure MatDenseGetArrayF901d, MatDenseGetArrayF902d
     31:   end interface

     33:   interface MatDenseRestoreArrayF90
     34:     module procedure MatDenseRestoreArrayF901d, MatDenseRestoreArrayF902d
     35:   end interface

     37:   interface MatDenseGetArrayReadF90
     38:     module procedure MatDenseGetArrayReadF901d, MatDenseGetArrayReadF902d
     39:   end interface

     41:   interface MatDenseRestoreArrayReadF90
     42:     module procedure MatDenseRestoreArrayWriteF901d, MatDenseRestoreArrayWriteF902d
     43:   end interface

     45:   interface MatDenseGetArrayWriteF90
     46:     module procedure MatDenseGetArrayWriteF901d, MatDenseGetArrayWriteF902d
     47:   end interface

     49:   interface MatDenseRestoreArrayWriteF90
     50:     module procedure MatDenseRestoreArrayWriteF901d, MatDenseRestoreArrayWriteF902d
     51:   end interface

     53: contains

     55: #include <../ftn/mat/petscmat.hf90>
     56: #include <../ftn/mat/petscmatcoarsen.hf90>
     57: #include <../ftn/mat/petscpartitioner.hf90>

     59: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
     60: !DEC$ ATTRIBUTES DLLEXPORT:: MatDenseGetArrayF901d
     61: #endif
     62:   Subroutine MatDenseGetArrayF901d(v, array, ierr)
     63:     PetscScalar, pointer :: array(:)
     64:     PetscErrorCode ierr
     65:     Mat v
     66:     call MatDenseGetArray(v, array, ierr)
     67:   End Subroutine

     69: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
     70: !DEC$ ATTRIBUTES DLLEXPORT:: MatDenseRestoreArrayF901d
     71: #endif
     72:   Subroutine MatDenseRestoreArrayF901d(v, array, ierr)
     73:     PetscScalar, pointer :: array(:)
     74:     PetscErrorCode ierr
     75:     Mat v
     76:     call MatDenseRestoreArray(v, array, ierr)
     77:   End Subroutine

     79: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
     80: !DEC$ ATTRIBUTES DLLEXPORT:: MatDenseGetArrayReadF901d
     81: #endif
     82:   Subroutine MatDenseGetArrayReadF901d(v, array, ierr)
     83:     PetscScalar, pointer :: array(:)
     84:     PetscErrorCode ierr
     85:     Mat v
     86:     call MatDenseGetArrayRead(v, array, ierr)
     87:   End Subroutine

     89: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
     90: !DEC$ ATTRIBUTES DLLEXPORT:: MatDenseRestoreArrayReadF901d
     91: #endif
     92:   Subroutine MatDenseRestoreArrayReadF901d(v, array, ierr)
     93:     PetscScalar, pointer :: array(:)
     94:     PetscErrorCode ierr
     95:     Mat v
     96:     call MatDenseRestoreArrayRead(v, array, ierr)
     97:   End Subroutine

     99: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
    100: !DEC$ ATTRIBUTES DLLEXPORT:: MatDenseGetArrayWriteF901d
    101: #endif
    102:   Subroutine MatDenseGetArrayWriteF901d(v, array, ierr)
    103:     PetscScalar, pointer :: array(:)
    104:     PetscErrorCode ierr
    105:     Mat v
    106:     call MatDenseGetArrayWrite(v, array, ierr)
    107:   End Subroutine

    109: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
    110: !DEC$ ATTRIBUTES DLLEXPORT:: MatDenseRestoreArrayWriteF901d
    111: #endif
    112:   Subroutine MatDenseRestoreArrayWriteF901d(v, array, ierr)
    113:     PetscScalar, pointer :: array(:)
    114:     PetscErrorCode ierr
    115:     Mat v
    116:     call MatDenseRestoreArrayWrite(v, array, ierr)
    117:   End Subroutine

    119: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
    120: !DEC$ ATTRIBUTES DLLEXPORT:: MatDenseGetArrayF902d
    121: #endif
    122:   Subroutine MatDenseGetArrayF902d(v, array, ierr)
    123:     PetscScalar, pointer :: array(:, :)
    124:     PetscErrorCode ierr
    125:     Mat v
    126:     call MatDenseGetArray(v, array, ierr)
    127:   End Subroutine

    129: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
    130: !DEC$ ATTRIBUTES DLLEXPORT:: MatDenseRestoreArrayF902d
    131: #endif
    132:   Subroutine MatDenseRestoreArrayF902d(v, array, ierr)
    133:     PetscScalar, pointer :: array(:, :)
    134:     PetscErrorCode ierr
    135:     Mat v
    136:     call MatDenseRestoreArray(v, array, ierr)
    137:   End Subroutine

    139: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
    140: !DEC$ ATTRIBUTES DLLEXPORT:: MatDenseGetArrayReadF902d
    141: #endif
    142:   Subroutine MatDenseGetArrayReadF902d(v, array, ierr)
    143:     PetscScalar, pointer :: array(:, :)
    144:     PetscErrorCode ierr
    145:     Mat v
    146:     call MatDenseGetArrayRead(v, array, ierr)
    147:   End Subroutine

    149: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
    150: !DEC$ ATTRIBUTES DLLEXPORT:: MatDenseRestoreArrayReadF90
    151: #endif
    152:   Subroutine MatDenseRestoreArrayReadF902d(v, array, ierr)
    153:     PetscScalar, pointer :: array(:, :)
    154:     PetscErrorCode ierr
    155:     Mat v
    156:     call MatDenseRestoreArrayRead(v, array, ierr)
    157:   End Subroutine

    159: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
    160: !DEC$ ATTRIBUTES DLLEXPORT:: MatDenseGetArrayWriteF90
    161: #endif
    162:   Subroutine MatDenseGetArrayWriteF902d(v, array, ierr)
    163:     PetscScalar, pointer :: array(:, :)
    164:     PetscErrorCode ierr
    165:     Mat v
    166:     call MatDenseGetArrayWrite(v, array, ierr)
    167:   End Subroutine

    169: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
    170: !DEC$ ATTRIBUTES DLLEXPORT:: MatDenseRestoreArrayWriteF90
    171: #endif
    172:   Subroutine MatDenseRestoreArrayWriteF902d(v, array, ierr)
    173:     PetscScalar, pointer :: array(:, :)
    174:     PetscErrorCode ierr
    175:     Mat v
    176:     call MatDenseRestoreArrayWrite(v, array, ierr)
    177:   End Subroutine

    179: end module