petsc4py 3.26.1__tar.gz → 3.26.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. {petsc4py-3.26.1/src/petsc4py.egg-info → petsc4py-3.26.2}/PKG-INFO +2 -2
  2. {petsc4py-3.26.1 → petsc4py-3.26.2}/conf/stubgen.py +2 -0
  3. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/DM.pyx +85 -7
  4. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscdm.pxi +41 -0
  5. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/typing.pxi +2 -0
  6. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc.pyi +5 -1
  7. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/__init__.py +1 -1
  8. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/typing.py +8 -0
  9. {petsc4py-3.26.1 → petsc4py-3.26.2/src/petsc4py.egg-info}/PKG-INFO +2 -2
  10. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_dmda.py +27 -0
  11. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_gc.py +21 -0
  12. {petsc4py-3.26.1 → petsc4py-3.26.2}/.cython-lint.toml +0 -0
  13. {petsc4py-3.26.1 → petsc4py-3.26.2}/.ruff.toml +0 -0
  14. {petsc4py-3.26.1 → petsc4py-3.26.2}/CHANGES.rst +0 -0
  15. {petsc4py-3.26.1 → petsc4py-3.26.2}/DESCRIPTION.rst +0 -0
  16. {petsc4py-3.26.1 → petsc4py-3.26.2}/LICENSE.rst +0 -0
  17. {petsc4py-3.26.1 → petsc4py-3.26.2}/MANIFEST.in +0 -0
  18. {petsc4py-3.26.1 → petsc4py-3.26.2}/README.rst +0 -0
  19. {petsc4py-3.26.1 → petsc4py-3.26.2}/conf/__init__.py +0 -0
  20. {petsc4py-3.26.1 → petsc4py-3.26.2}/conf/confpetsc.py +0 -0
  21. {petsc4py-3.26.1 → petsc4py-3.26.2}/conf/cyautodoc.py +0 -0
  22. {petsc4py-3.26.1 → petsc4py-3.26.2}/conf/cythonize.py +0 -0
  23. {petsc4py-3.26.1 → petsc4py-3.26.2}/conf/cythonize.sh +0 -0
  24. {petsc4py-3.26.1 → petsc4py-3.26.2}/conf/epydoc.cfg +0 -0
  25. {petsc4py-3.26.1 → petsc4py-3.26.2}/conf/epydocify.py +0 -0
  26. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/hpddm/hpddm.py +0 -0
  27. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/hpddm/saddle_point.py +0 -0
  28. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/htool/htool.py +0 -0
  29. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/binary-io/makefile +0 -0
  30. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/binary-io/matvecio.py +0 -0
  31. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/bratu2d/bratu2d.py +0 -0
  32. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/bratu2d/bratu2df90.f90 +0 -0
  33. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/bratu2d/bratu2dnpy.py +0 -0
  34. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/bratu2d/makefile +0 -0
  35. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/bratu3d/bratu3d.py +0 -0
  36. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/bratu3d/makefile +0 -0
  37. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/dmplex/anisotropic_adaptation.py +0 -0
  38. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/dmplex/distribute_field.py +0 -0
  39. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/dmplex/isotropic_adaptation.py +0 -0
  40. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/kspsolve/makefile +0 -0
  41. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/kspsolve/petsc-cg.py +0 -0
  42. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/kspsolve/petsc-ksp.py +0 -0
  43. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/kspsolve/petsc-mat.py +0 -0
  44. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/kspsolve/test_mat_cg.py +0 -0
  45. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/kspsolve/test_mat_ksp.py +0 -0
  46. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/makefile +0 -0
  47. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/ode/bouncing_ball.py +0 -0
  48. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/ode/ce.py +0 -0
  49. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/ode/fastslowsplit.py +0 -0
  50. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/ode/heat.py +0 -0
  51. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/ode/orego.py +0 -0
  52. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/ode/rober.py +0 -0
  53. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/ode/vanderpol.py +0 -0
  54. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/perftest/App.f90 +0 -0
  55. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/perftest/App.pyf +0 -0
  56. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/perftest/driver.c +0 -0
  57. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/perftest/driver.py +0 -0
  58. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/perftest/makefile +0 -0
  59. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/perftest/makefile.f2py +0 -0
  60. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/perftest/makefile.petsc +0 -0
  61. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/petsc-examples/ksp/ex2.py +0 -0
  62. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/petsc-examples/ksp/ex23.py +0 -0
  63. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/petsc-examples/ksp/makefile +0 -0
  64. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/petsc-examples/makefile +0 -0
  65. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/poisson2d/makefile +0 -0
  66. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/poisson2d/poisson2d.py +0 -0
  67. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/poisson3d/del2lib.f90 +0 -0
  68. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/poisson3d/del2mat.h +0 -0
  69. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/poisson3d/del2mat.py +0 -0
  70. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/poisson3d/makefile +0 -0
  71. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/poisson3d/makefile.petsc +0 -0
  72. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/poisson3d/poisson3d.c +0 -0
  73. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/poisson3d/poisson3d.py +0 -0
  74. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/taosolve/chwirut.py +0 -0
  75. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/taosolve/rosenbrock.py +0 -0
  76. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-cython/Bratu3D.pyx +0 -0
  77. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-cython/Bratu3Dimpl.c +0 -0
  78. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-cython/Bratu3Dimpl.h +0 -0
  79. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-cython/makefile +0 -0
  80. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-cython/run_demo.py +0 -0
  81. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-cython/setup.py +0 -0
  82. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-f2py/.f2py_f2cmap +0 -0
  83. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-f2py/Bratu2D.F90 +0 -0
  84. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-f2py/Bratu2D.pyf +0 -0
  85. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-f2py/Bratu2Dmodule.h +0 -0
  86. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-f2py/makefile +0 -0
  87. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-f2py/run_demo.py +0 -0
  88. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-f2py/setup.py +0 -0
  89. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-swig/Bratu3D.c +0 -0
  90. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-swig/Bratu3D.h +0 -0
  91. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-swig/Bratu3D.i +0 -0
  92. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-swig/makefile +0 -0
  93. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-swig/run_demo.py +0 -0
  94. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/legacy/wrap-swig/setup.py +0 -0
  95. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/poisson2d/poisson2d.py +0 -0
  96. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/ksp.py +0 -0
  97. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/ksppython_protocol.py +0 -0
  98. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/mat.py +0 -0
  99. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/matpython_protocol.py +0 -0
  100. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/pc.py +0 -0
  101. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/pcpython_protocol.py +0 -0
  102. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/petscviewerpython_protocol.py +0 -0
  103. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/snes.py +0 -0
  104. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/snespython_protocol.py +0 -0
  105. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/tao.py +0 -0
  106. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/taopython_protocol.py +0 -0
  107. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/ts.py +0 -0
  108. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/python_types/tspython_protocol.py +0 -0
  109. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/regressor/test_regressor.py +0 -0
  110. {petsc4py-3.26.1 → petsc4py-3.26.2}/demo/regressor/test_regressor_synthetic.py +0 -0
  111. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/index.rst +0 -0
  112. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/.gitignore +0 -0
  113. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/Makefile +0 -0
  114. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/_templates/autosummary/class.rst +0 -0
  115. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/_templates/autosummary/module.rst +0 -0
  116. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/_templates/layout.html +0 -0
  117. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/apidoc.py +0 -0
  118. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/citing.rst +0 -0
  119. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/conf.py +0 -0
  120. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/contributing.rst +0 -0
  121. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/documentation_standards.rst +0 -0
  122. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/index.rst +0 -0
  123. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/install.rst +0 -0
  124. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/links.txt +0 -0
  125. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/overview.rst +0 -0
  126. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/petsc_options.rst +0 -0
  127. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/petsc_python_types.rst +0 -0
  128. {petsc4py-3.26.1 → petsc4py-3.26.2}/docs/source/reference.rst +0 -0
  129. {petsc4py-3.26.1 → petsc4py-3.26.2}/pyproject.toml +0 -0
  130. {petsc4py-3.26.1 → petsc4py-3.26.2}/setup.cfg +0 -0
  131. {petsc4py-3.26.1 → petsc4py-3.26.2}/setup.py +0 -0
  132. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/cython.h +0 -0
  133. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/lib-petsc/compat/cuda.h +0 -0
  134. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/lib-petsc/compat/h2opus.h +0 -0
  135. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/lib-petsc/compat/hip.h +0 -0
  136. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/lib-petsc/compat/hpddm.h +0 -0
  137. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/lib-petsc/compat/mpi.h +0 -0
  138. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/lib-petsc/compat/plexexodusii.h +0 -0
  139. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/lib-petsc/compat/regressor.h +0 -0
  140. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/lib-petsc/compat/tao.h +0 -0
  141. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/lib-petsc/compat/viennacl.h +0 -0
  142. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/lib-petsc/compat.h +0 -0
  143. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/lib-petsc/custom.h +0 -0
  144. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/lib-petsc/initpkg.h +0 -0
  145. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/AO.pyx +0 -0
  146. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/CAPI.pyx +0 -0
  147. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Comm.pyx +0 -0
  148. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Const.pyx +0 -0
  149. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/DMComposite.pyx +0 -0
  150. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/DMDA.pyx +0 -0
  151. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/DMLabel.pyx +0 -0
  152. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/DMPlex.pyx +0 -0
  153. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/DMShell.pyx +0 -0
  154. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/DMStag.pyx +0 -0
  155. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/DMSwarm.pyx +0 -0
  156. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/DMUtils.pyx +0 -0
  157. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/DS.pyx +0 -0
  158. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/DT.pyx +0 -0
  159. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Device.pyx +0 -0
  160. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Error.pyx +0 -0
  161. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/FE.pyx +0 -0
  162. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/IS.pyx +0 -0
  163. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/KSP.pyx +0 -0
  164. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Log.pyx +0 -0
  165. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Mat.pyx +0 -0
  166. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/MatPartitioning.pyx +0 -0
  167. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Object.pyx +0 -0
  168. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Options.pyx +0 -0
  169. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/PC.pyx +0 -0
  170. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/PETSc.pyx +0 -0
  171. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Partitioner.pyx +0 -0
  172. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Random.pyx +0 -0
  173. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Regressor.pyx +0 -0
  174. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/SF.pyx +0 -0
  175. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/SNES.pyx +0 -0
  176. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Scatter.pyx +0 -0
  177. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Section.pyx +0 -0
  178. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Space.pyx +0 -0
  179. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Sys.pyx +0 -0
  180. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/TAO.pyx +0 -0
  181. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/TS.pyx +0 -0
  182. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Vec.pyx +0 -0
  183. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/Viewer.pyx +0 -0
  184. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/arraynpy.pxi +0 -0
  185. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/cyclicgc.pxi +0 -0
  186. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/dlpack.pxi +0 -0
  187. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/libpetsc4py.pyx +0 -0
  188. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscao.pxi +0 -0
  189. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscdef.pxi +0 -0
  190. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscdevice.pxi +0 -0
  191. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscdmcomposite.pxi +0 -0
  192. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscdmda.pxi +0 -0
  193. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscdmlabel.pxi +0 -0
  194. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscdmplex.pxi +0 -0
  195. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscdmshell.pxi +0 -0
  196. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscdmstag.pxi +0 -0
  197. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscdmswarm.pxi +0 -0
  198. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscdmutils.pxi +0 -0
  199. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscds.pxi +0 -0
  200. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscdt.pxi +0 -0
  201. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscfe.pxi +0 -0
  202. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscis.pxi +0 -0
  203. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscksp.pxi +0 -0
  204. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petsclayout.pxi +0 -0
  205. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petsclog.pxi +0 -0
  206. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscmat.pxi +0 -0
  207. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscmatpartitioning.pxi +0 -0
  208. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscmem.pxi +0 -0
  209. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscmpi.pxi +0 -0
  210. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscobj.pxi +0 -0
  211. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscopt.pxi +0 -0
  212. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscpartitioner.pxi +0 -0
  213. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscpc.pxi +0 -0
  214. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscpyappctx.pxi +0 -0
  215. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscrand.pxi +0 -0
  216. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscregressor.pxi +0 -0
  217. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscsct.pxi +0 -0
  218. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscsec.pxi +0 -0
  219. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscsf.pxi +0 -0
  220. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscsnes.pxi +0 -0
  221. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscspace.pxi +0 -0
  222. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscsys.pxi +0 -0
  223. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petsctao.pxi +0 -0
  224. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscts.pxi +0 -0
  225. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscvec.pxi +0 -0
  226. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc/petscvwr.pxi +0 -0
  227. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc.pxd +0 -0
  228. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc.py +0 -0
  229. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/PETSc.pyx +0 -0
  230. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/__init__.pxd +0 -0
  231. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/__init__.pyi +0 -0
  232. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/__main__.py +0 -0
  233. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/__main__.pyi +0 -0
  234. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/include/petsc4py/numpy.h +0 -0
  235. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/include/petsc4py/petsc4py.h +0 -0
  236. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/include/petsc4py/petsc4py.i +0 -0
  237. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/include/petsc4py/pybuffer.h +0 -0
  238. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/include/petsc4py/pyscalar.h +0 -0
  239. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/lib/__init__.py +0 -0
  240. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/lib/__init__.pyi +0 -0
  241. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/lib/_pytypes/__init__.py +0 -0
  242. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/lib/_pytypes/viewer/__init__.py +0 -0
  243. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/lib/_pytypes/viewer/petscpyvista.py +0 -0
  244. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/lib/petsc.cfg +0 -0
  245. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py/py.typed +0 -0
  246. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py.egg-info/SOURCES.txt +0 -0
  247. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py.egg-info/dependency_links.txt +0 -0
  248. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py.egg-info/not-zip-safe +0 -0
  249. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py.egg-info/requires.txt +0 -0
  250. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/petsc4py.egg-info/top_level.txt +0 -0
  251. {petsc4py-3.26.1 → petsc4py-3.26.2}/src/pyapicompat.h +0 -0
  252. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/runtests.py +0 -0
  253. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_comm.py +0 -0
  254. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_device.py +0 -0
  255. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_dmcomposite.py +0 -0
  256. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_dmplex.py +0 -0
  257. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_dmshell.py +0 -0
  258. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_dmstag.py +0 -0
  259. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_dmswarm.py +0 -0
  260. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_is.py +0 -0
  261. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_ksp.py +0 -0
  262. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_ksp_py.py +0 -0
  263. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_lgmap.py +0 -0
  264. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_log.py +0 -0
  265. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_mat_aij.py +0 -0
  266. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_mat_dense.py +0 -0
  267. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_mat_fact.py +0 -0
  268. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_mat_py.py +0 -0
  269. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_mat_schur.py +0 -0
  270. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_matpartitioning.py +0 -0
  271. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_nsp.py +0 -0
  272. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_object.py +0 -0
  273. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_optdb.py +0 -0
  274. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_pc.py +0 -0
  275. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_pc_py.py +0 -0
  276. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_section.py +0 -0
  277. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_sf.py +0 -0
  278. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_snes.py +0 -0
  279. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_snes_py.py +0 -0
  280. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_stdout.py +0 -0
  281. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_sys.py +0 -0
  282. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_tao.py +0 -0
  283. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_tao_py.py +0 -0
  284. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_tao_with_taoterm.py +0 -0
  285. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_taoterm.py +0 -0
  286. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_ts.py +0 -0
  287. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_ts_py.py +0 -0
  288. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_vec.py +0 -0
  289. {petsc4py-3.26.1 → petsc4py-3.26.2}/test/test_viewer_py.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: petsc4py
3
- Version: 3.26.1
3
+ Version: 3.26.2
4
4
  Summary: PETSc for Python
5
5
  Home-page: https://gitlab.com/petsc/petsc
6
- Download-URL: https://pypi.io/packages/source/p/petsc4py/petsc4py-3.26.1.tar.gz
6
+ Download-URL: https://pypi.io/packages/source/p/petsc4py/petsc4py-3.26.2.tar.gz
7
7
  Author: Lisandro Dalcin
8
8
  Author-email: dalcinl@gmail.com
9
9
  Maintainer: PETSc Team
@@ -457,6 +457,8 @@ from petsc4py.typing import (
457
457
  CSRSpec,
458
458
  DMCoarsenHookFunction,
459
459
  DMRestrictHookFunction,
460
+ DMRefineHookFunction,
461
+ DMInterpolateHookFunction,
460
462
  DimsSpec,
461
463
  KSPConvergenceTestFunction,
462
464
  KSPMonitorFunction,
@@ -1697,6 +1697,25 @@ cdef class DM(Object):
1697
1697
  dm.dm = newdm
1698
1698
  return dm
1699
1699
 
1700
+ def interpolateHooks(self, Mat interp, DM fine) -> None:
1701
+ """Run the interpolation hooks registered on a finer `DM`.
1702
+
1703
+ Collective.
1704
+
1705
+ Parameters
1706
+ ----------
1707
+ interp
1708
+ The matrix interpolating from this `DM` to ``fine``.
1709
+ fine
1710
+ The finer `DM`.
1711
+
1712
+ See Also
1713
+ --------
1714
+ addRefineHook, petsc.DMInterpolate
1715
+
1716
+ """
1717
+ CHKERR(DMInterpolate(self.dm, interp.mat, fine.dm))
1718
+
1700
1719
  def coarsen(self, comm: Comm | None = None) -> DM:
1701
1720
  """Return a coarsened `DM` object.
1702
1721
 
@@ -2538,24 +2557,24 @@ cdef class DM(Object):
2538
2557
 
2539
2558
  def addCoarsenHook(
2540
2559
  self,
2541
- coarsenhook: DMCoarsenHookFunction,
2542
- restricthook: DMRestrictHookFunction,
2560
+ coarsenhook: DMCoarsenHookFunction | None,
2561
+ restricthook: DMRestrictHookFunction | None,
2543
2562
  args: tuple[Any, ...] | None = None,
2544
2563
  kargs: dict[str, Any] | None = None) -> None:
2545
- """Add a callback to be executed when restricting to a coarser grid.
2564
+ """Add callbacks to set up and update user-defined data on coarser ``DM`` objects.
2546
2565
 
2547
2566
  Logically collective.
2548
2567
 
2549
2568
  Parameters
2550
2569
  ----------
2551
2570
  coarsenhook
2552
- The coarsen hook function.
2571
+ The coarsen hook function. Set to `None` to omit this hook.
2553
2572
  restricthook
2554
- The restrict hook function.
2573
+ The restrict hook function. Set to `None` to omit this hook.
2555
2574
  args
2556
- Positional arguments for the hooks.
2575
+ Positional arguments for the hook.
2557
2576
  kargs
2558
- Keyword arguments for the hooks.
2577
+ Keyword arguments for the hook.
2559
2578
 
2560
2579
  See Also
2561
2580
  --------
@@ -2587,6 +2606,65 @@ cdef class DM(Object):
2587
2606
  restricthooks.append(restrictcontext)
2588
2607
  self.set_attr('__restricthooks__', restricthooks)
2589
2608
 
2609
+ def addRefineHook(
2610
+ self,
2611
+ refinehook: DMRefineHookFunction | None,
2612
+ interphook: DMInterpolateHookFunction | None,
2613
+ args: tuple[Any, ...] | None = None,
2614
+ kargs: dict[str, Any] | None = None) -> None:
2615
+ """Add callbacks to set up and update user-defined data on finer ``DM`` objects.
2616
+
2617
+ Logically collective.
2618
+
2619
+ Parameters
2620
+ ----------
2621
+ refinehook
2622
+ The refine hook function, called by `refine` with the
2623
+ coarse and the fine `DM`. Set to `None` to omit this hook.
2624
+ interphook
2625
+ The interpolate hook function, called by `interpolateHooks` with
2626
+ the coarse `DM`, the interpolation matrix and the fine `DM`. Set to
2627
+ `None` to omit this hook.
2628
+ args
2629
+ Positional arguments for the hook.
2630
+ kargs
2631
+ Keyword arguments for the hook.
2632
+
2633
+ Notes
2634
+ -----
2635
+ `refine` calls the refine hooks of the coarse `DM`, while
2636
+ `interpolateHooks` calls the interpolate hooks of the fine `DM`.
2637
+
2638
+ See Also
2639
+ --------
2640
+ interpolateHooks, refine, petsc.DMRefineHookAdd
2641
+
2642
+ """
2643
+ if args is None: args = ()
2644
+ if kargs is None: kargs = {}
2645
+
2646
+ if refinehook is not None:
2647
+ refinecontext = (refinehook, args, kargs)
2648
+
2649
+ refinehooks = self.get_attr('__refinehooks__')
2650
+ if refinehooks is None:
2651
+ refinehooks = [refinecontext]
2652
+ CHKERR(DMRefineHookAdd(self.dm, DM_PyRefineHook, NULL, <void*>NULL))
2653
+ else:
2654
+ refinehooks.append(refinecontext)
2655
+ self.set_attr('__refinehooks__', refinehooks)
2656
+
2657
+ if interphook is not None:
2658
+ interpcontext = (interphook, args, kargs)
2659
+
2660
+ interphooks = self.get_attr('__interpolatehooks__')
2661
+ if interphooks is None:
2662
+ interphooks = [interpcontext]
2663
+ CHKERR(DMRefineHookAdd(self.dm, NULL, DM_PyInterpolateHook, <void*>NULL))
2664
+ else:
2665
+ interphooks.append(interpcontext)
2666
+ self.set_attr('__interpolatehooks__', interphooks)
2667
+
2590
2668
  # --- application context ---
2591
2669
 
2592
2670
  property appctx:
@@ -60,6 +60,13 @@ cdef extern from * nogil:
60
60
  PetscMat,
61
61
  PetscDM,
62
62
  void*) except PETSC_ERR_PYTHON
63
+ ctypedef PetscErrorCode (*PetscDMRefineHook)(PetscDM,
64
+ PetscDM,
65
+ void*) except PETSC_ERR_PYTHON
66
+ ctypedef PetscErrorCode (*PetscDMInterpolateHook)(PetscDM,
67
+ PetscMat,
68
+ PetscDM,
69
+ void*) except PETSC_ERR_PYTHON
63
70
 
64
71
  PetscErrorCode DMCreate(MPI_Comm, PetscDM*)
65
72
  PetscErrorCode DMClone(PetscDM, PetscDM*)
@@ -142,6 +149,7 @@ cdef extern from * nogil:
142
149
  PetscErrorCode DMConvert(PetscDM, PetscDMType, PetscDM*)
143
150
  PetscErrorCode DMRefine(PetscDM, MPI_Comm, PetscDM*)
144
151
  PetscErrorCode DMCoarsen(PetscDM, MPI_Comm, PetscDM*)
152
+ PetscErrorCode DMInterpolate(PetscDM, PetscMat, PetscDM)
145
153
  PetscErrorCode DMRefineHierarchy(PetscDM, PetscInt, PetscDM[])
146
154
  PetscErrorCode DMCoarsenHierarchy(PetscDM, PetscInt, PetscDM[])
147
155
  PetscErrorCode DMGetRefineLevel(PetscDM, PetscInt*)
@@ -210,6 +218,7 @@ cdef extern from * nogil:
210
218
  PetscErrorCode DMSNESSetJacobian(PetscDM, PetscSNESJacobianFunction, void*)
211
219
 
212
220
  PetscErrorCode DMCoarsenHookAdd(PetscDM, PetscDMCoarsenHook, PetscDMRestrictHook, void*)
221
+ PetscErrorCode DMRefineHookAdd(PetscDM, PetscDMRefineHook, PetscDMInterpolateHook, void*)
213
222
 
214
223
  # --------------------------------------------------------------------
215
224
 
@@ -316,4 +325,36 @@ cdef PetscErrorCode DM_PyRestrictHook(
316
325
  (hookop, args, kargs) = hook
317
326
  hookop(Fine, Mrestrict, Rscale, Inject, Coarse, *args, **kargs)
318
327
  return PETSC_SUCCESS
328
+
329
+ cdef PetscErrorCode DM_PyRefineHook(
330
+ PetscDM coarse,
331
+ PetscDM fine,
332
+ void *ctx,
333
+ ) except PETSC_ERR_PYTHON with gil:
334
+
335
+ cdef DM Coarse = ref_DM(coarse)
336
+ cdef DM Fine = ref_DM(fine)
337
+ cdef object hooks = Coarse.get_attr('__refinehooks__')
338
+ assert hooks is not None and type(hooks) is list
339
+ for hook in hooks:
340
+ (hookop, args, kargs) = hook
341
+ hookop(Coarse, Fine, *args, **kargs)
342
+ return PETSC_SUCCESS
343
+
344
+ cdef PetscErrorCode DM_PyInterpolateHook(
345
+ PetscDM coarse,
346
+ PetscMat minterp,
347
+ PetscDM fine,
348
+ void *ctx,
349
+ ) except PETSC_ERR_PYTHON with gil:
350
+
351
+ cdef DM Coarse = ref_DM(coarse)
352
+ cdef Mat Minterp = ref_Mat(minterp)
353
+ cdef DM Fine = ref_DM(fine)
354
+ cdef object hooks = Fine.get_attr('__interpolatehooks__')
355
+ assert hooks is not None and type(hooks) is list
356
+ for hook in hooks:
357
+ (hookop, args, kargs) = hook
358
+ hookop(Coarse, Minterp, Fine, *args, **kargs)
359
+ return PETSC_SUCCESS
319
360
  # -----------------------------------------------------------------------------
@@ -53,6 +53,8 @@ cdef MatHtoolKernelFunction
53
53
 
54
54
  cdef DMCoarsenHookFunction
55
55
  cdef DMRestrictHookFunction
56
+ cdef DMRefineHookFunction
57
+ cdef DMInterpolateHookFunction
56
58
 
57
59
  # --- KSP ---
58
60
 
@@ -69,6 +69,8 @@ from petsc4py.typing import (
69
69
  CSRSpec,
70
70
  DMCoarsenHookFunction,
71
71
  DMRestrictHookFunction,
72
+ DMRefineHookFunction,
73
+ DMInterpolateHookFunction,
72
74
  DimsSpec,
73
75
  KSPConvergenceTestFunction,
74
76
  KSPMonitorFunction,
@@ -2849,6 +2851,7 @@ class DM(Object):
2849
2851
  def createRestriction(self, dm: DM) -> Mat: ...
2850
2852
  def convert(self, dm_type: DM.Type | str) -> DM: ...
2851
2853
  def refine(self, comm: Comm | None = None) -> DM: ...
2854
+ def interpolateHooks(self, interp: Mat, fine: DM) -> None: ...
2852
2855
  def coarsen(self, comm: Comm | None = None) -> DM: ...
2853
2856
  def refineHierarchy(self, nlevels: int) -> list: ...
2854
2857
  def coarsenHierarchy(self, nlevels: int) -> list: ...
@@ -2887,7 +2890,8 @@ class DM(Object):
2887
2890
  def createFieldDecomposition(self) -> tuple[list, list, list]: ...
2888
2891
  def setSNESFunction(self, function: SNESFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: ...
2889
2892
  def setSNESJacobian(self, jacobian: SNESJacobianFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: ...
2890
- def addCoarsenHook(self, coarsenhook: DMCoarsenHookFunction, restricthook: DMRestrictHookFunction, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: ...
2893
+ def addCoarsenHook(self, coarsenhook: DMCoarsenHookFunction | None, restricthook: DMRestrictHookFunction | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: ...
2894
+ def addRefineHook(self, refinehook: DMRefineHookFunction | None, interphook: DMInterpolateHookFunction | None, args: tuple[Any, ...] | None = None, kargs: dict[str, Any] | None = None) -> None: ...
2891
2895
  appctx: object
2892
2896
  ds: DS
2893
2897
 
@@ -16,7 +16,7 @@ communications.
16
16
  """
17
17
 
18
18
  __author__ = 'Lisandro Dalcin'
19
- __version__ = '3.26.1'
19
+ __version__ = '3.26.2'
20
20
  __credits__ = 'PETSc Team <petsc-maint@mcs.anl.gov>'
21
21
 
22
22
 
@@ -55,6 +55,8 @@ __all__ = [
55
55
  'MatHtoolKernelFunction',
56
56
  'DMCoarsenHookFunction',
57
57
  'DMRestrictHookFunction',
58
+ 'DMRefineHookFunction',
59
+ 'DMInterpolateHookFunction',
58
60
  'KSPRHSFunction',
59
61
  'KSPCreateOperatorsFunction',
60
62
  'KSPComputeOperatorsFunction',
@@ -337,6 +339,12 @@ DMCoarsenHookFunction = Callable[[DM, DM], None]
337
339
  DMRestrictHookFunction = Callable[[DM, Mat, Vec, Mat, DM], None]
338
340
  """`PETSc.DM` restriction hook callback."""
339
341
 
342
+ DMRefineHookFunction = Callable[[DM, DM], None]
343
+ """`PETSc.DM` refinement hook callback."""
344
+
345
+ DMInterpolateHookFunction = Callable[[DM, Mat, DM], None]
346
+ """`PETSc.DM` interpolation hook callback."""
347
+
340
348
  # --- KSP ---
341
349
 
342
350
  KSPRHSFunction = Callable[[KSP, Vec], None]
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: petsc4py
3
- Version: 3.26.1
3
+ Version: 3.26.2
4
4
  Summary: PETSc for Python
5
5
  Home-page: https://gitlab.com/petsc/petsc
6
- Download-URL: https://pypi.io/packages/source/p/petsc4py/petsc4py-3.26.1.tar.gz
6
+ Download-URL: https://pypi.io/packages/source/p/petsc4py/petsc4py-3.26.2.tar.gz
7
7
  Author: Lisandro Dalcin
8
8
  Author-email: dalcinl@gmail.com
9
9
  Maintainer: PETSc Team
@@ -269,6 +269,33 @@ class BaseTestDA:
269
269
  for item in levels:
270
270
  self.assertTrue(isinstance(item, PETSc.DM))
271
271
 
272
+ def testRefineHook(self):
273
+ calls = []
274
+
275
+ def refinehook(coarse, fine, a, c=0):
276
+ calls.append((coarse, fine, a, c))
277
+
278
+ self.da.addRefineHook(refinehook, None, args=('a',), kargs={'c': 1})
279
+ fine = self.da.refine()
280
+ self.assertEqual(calls, [(self.da, fine, 'a', 1)])
281
+ calls.clear()
282
+ fine.destroy()
283
+
284
+ def testInterpolateHook(self):
285
+ calls = []
286
+
287
+ def interphook(coarse, interp, fine, a, c=0):
288
+ calls.append((coarse, interp, fine, a, c))
289
+
290
+ fine = self.da.refine()
291
+ fine.addRefineHook(None, interphook, args=('a',), kargs={'c': 1})
292
+ interp, _ = self.da.createInterpolation(fine)
293
+ self.da.interpolateHooks(interp, fine)
294
+ self.assertEqual(calls, [(self.da, interp, fine, 'a', 1)])
295
+ calls.clear()
296
+ interp.destroy()
297
+ fine.destroy()
298
+
272
299
  def testCreateInterpolation(self):
273
300
  da = self.da
274
301
  if da.dim == 1:
@@ -119,6 +119,27 @@ class TestGCTSSubType(TestGCTS):
119
119
  self.obj.setAppCtx(self.obj)
120
120
 
121
121
 
122
+ class Context:
123
+ def __init__(self, obj):
124
+ self.obj = obj
125
+
126
+
127
+ class TestGarbageCleanupCycle(unittest.TestCase):
128
+ def testNestedContexts(self):
129
+ contexts = []
130
+ obj = PETSc.Vec().create(comm=PETSc.COMM_WORLD)
131
+ for _ in range(3):
132
+ context = Context(obj)
133
+ contexts.append(weakref.ref(context))
134
+ obj = PETSc.Mat().createPython(
135
+ (1, 1), context=context, comm=PETSc.COMM_WORLD
136
+ )
137
+ del context
138
+ del obj
139
+ PETSc.garbage_cleanup(PETSc.COMM_WORLD)
140
+ self.assertTrue(all(context() is None for context in contexts))
141
+
142
+
122
143
  # --------------------------------------------------------------------
123
144
 
124
145
  if __name__ == '__main__':
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes