scikit-fem-native 0.3.1__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 (212) hide show
  1. scikit_fem_native-0.3.1/.github/workflows/ci.yml +61 -0
  2. scikit_fem_native-0.3.1/.github/workflows/full-validation.yml +87 -0
  3. scikit_fem_native-0.3.1/.github/workflows/workflow.yml +90 -0
  4. scikit_fem_native-0.3.1/.gitignore +10 -0
  5. scikit_fem_native-0.3.1/.readthedocs.yaml +22 -0
  6. scikit_fem_native-0.3.1/CHANGELOG.md +51 -0
  7. scikit_fem_native-0.3.1/CMakeLists.txt +29 -0
  8. scikit_fem_native-0.3.1/DEVELOPMENT.md +80 -0
  9. scikit_fem_native-0.3.1/LICENSE +165 -0
  10. scikit_fem_native-0.3.1/NOTICE +6 -0
  11. scikit_fem_native-0.3.1/PKG-INFO +407 -0
  12. scikit_fem_native-0.3.1/README.md +361 -0
  13. scikit_fem_native-0.3.1/benchmarks/RESULTS_2026-07-31.md +108 -0
  14. scikit_fem_native-0.3.1/benchmarks/SUPERMESH_BACKEND_COMPARISON.md +29 -0
  15. scikit_fem_native-0.3.1/benchmarks/compare-with-skfem/README.md +111 -0
  16. scikit_fem_native-0.3.1/benchmarks/compare-with-skfem/official_performance.py +167 -0
  17. scikit_fem_native-0.3.1/benchmarks/compare-with-skfem/poisson_assembly.py +413 -0
  18. scikit_fem_native-0.3.1/benchmarks/compare-with-skfem/results/poisson-linux-x86_64.csv +8 -0
  19. scikit_fem_native-0.3.1/benchmarks/compare-with-skfem/results/poisson-linux-x86_64.md +29 -0
  20. scikit_fem_native-0.3.1/benchmarks/compare-with-skfem/results/poisson-linux-x86_64.png +0 -0
  21. scikit_fem_native-0.3.1/benchmarks/cross_assembly.py +92 -0
  22. scikit_fem_native-0.3.1/benchmarks/cutfem/README.md +53 -0
  23. scikit_fem_native-0.3.1/benchmarks/cutfem/cut-assembly.csv +10 -0
  24. scikit_fem_native-0.3.1/benchmarks/cutfem/cut-assembly.png +0 -0
  25. scikit_fem_native-0.3.1/benchmarks/cutfem/cut_assembly.py +199 -0
  26. scikit_fem_native-0.3.1/benchmarks/cutfem/implicit-cross.csv +9 -0
  27. scikit_fem_native-0.3.1/benchmarks/cutfem/implicit-cross.png +0 -0
  28. scikit_fem_native-0.3.1/benchmarks/cutfem/implicit_cross.py +141 -0
  29. scikit_fem_native-0.3.1/benchmarks/hcurl_tet_n1_assembly.py +133 -0
  30. scikit_fem_native-0.3.1/benchmarks/hcurl_tri_n1_assembly.py +120 -0
  31. scikit_fem_native-0.3.1/benchmarks/memory_preflight_calibration.py +277 -0
  32. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/README.md +138 -0
  33. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/j2-history-tet4.csv +5 -0
  34. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/j2-history-tet4.png +0 -0
  35. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/j2-tet4.csv +7 -0
  36. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/j2-tet4.png +0 -0
  37. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-hex27-order-sweep.csv +4 -0
  38. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-hex27-order-sweep.png +0 -0
  39. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-hex8-int2-distorted.csv +6 -0
  40. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-hex8-int2-distorted.png +0 -0
  41. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-hex8-native-parallel.csv +5 -0
  42. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-hex8-native-parallel.png +0 -0
  43. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-hex8-order-sweep.csv +4 -0
  44. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-hex8-order-sweep.png +0 -0
  45. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-tet10-order-sweep.csv +4 -0
  46. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-tet10-order-sweep.png +0 -0
  47. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-tet4-order-sweep.csv +4 -0
  48. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-tet4-order-sweep.png +0 -0
  49. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-wedge6-order-sweep.csv +4 -0
  50. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean-wedge6-order-sweep.png +0 -0
  51. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean.csv +7 -0
  52. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/neo-hookean.png +0 -0
  53. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/standard-linear-solid-tet4.csv +5 -0
  54. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/results/standard-linear-solid-tet4.png +0 -0
  55. scikit_fem_native-0.3.1/benchmarks/nonlinear-assembly/run_mesh_order_sweep.sh +18 -0
  56. scikit_fem_native-0.3.1/benchmarks/results/hcurl-tet-n1-assembly.csv +7 -0
  57. scikit_fem_native-0.3.1/benchmarks/results/hcurl-tri-n1-assembly.csv +5 -0
  58. scikit_fem_native-0.3.1/benchmarks/results/memory-preflight-100k.csv +9 -0
  59. scikit_fem_native-0.3.1/benchmarks/results/memory-preflight-10k.csv +9 -0
  60. scikit_fem_native-0.3.1/benchmarks/skfem_neo_hookean.py +54 -0
  61. scikit_fem_native-0.3.1/benchmarks/supermesh_backend_comparison.py +297 -0
  62. scikit_fem_native-0.3.1/benchmarks/supermesh_builder.py +78 -0
  63. scikit_fem_native-0.3.1/benchmarks/supermesh_parallel.py +104 -0
  64. scikit_fem_native-0.3.1/cpp/include/native_fem/cross_contraction.hpp +100 -0
  65. scikit_fem_native-0.3.1/cpp/include/native_fem/linear_elastic_tet4.hpp +76 -0
  66. scikit_fem_native-0.3.1/cpp/include/native_fem/material_assembler.hpp +244 -0
  67. scikit_fem_native-0.3.1/cpp/include/native_fem/parallel.hpp +50 -0
  68. scikit_fem_native-0.3.1/cpp/include/native_fem/python_bindings.hpp +18 -0
  69. scikit_fem_native-0.3.1/cpp/src/assembly/basis_geometry.cpp +215 -0
  70. scikit_fem_native-0.3.1/cpp/src/assembly/bilinear_form_assembler.cpp +157 -0
  71. scikit_fem_native-0.3.1/cpp/src/assembly/cross_bilinear_assembler.cpp +375 -0
  72. scikit_fem_native-0.3.1/cpp/src/assembly/cut_cross_assembler.cpp +181 -0
  73. scikit_fem_native-0.3.1/cpp/src/assembly/cut_form_assembler.cpp +257 -0
  74. scikit_fem_native-0.3.1/cpp/src/assembly/edge_topology.cpp +249 -0
  75. scikit_fem_native-0.3.1/cpp/src/assembly/functional_assembler.cpp +45 -0
  76. scikit_fem_native-0.3.1/cpp/src/assembly/linear_form_assembler.cpp +154 -0
  77. scikit_fem_native-0.3.1/cpp/src/assembly/supermesh_builder.cpp +537 -0
  78. scikit_fem_native-0.3.1/cpp/src/bindings.cpp +16 -0
  79. scikit_fem_native-0.3.1/cpp/src/runtime.cpp +25 -0
  80. scikit_fem_native-0.3.1/docs/_static/custom.css +16 -0
  81. scikit_fem_native-0.3.1/docs/assembly.rst +29 -0
  82. scikit_fem_native-0.3.1/docs/conf.py +44 -0
  83. scikit_fem_native-0.3.1/docs/development.rst +5 -0
  84. scikit_fem_native-0.3.1/docs/gallery.rst +23 -0
  85. scikit_fem_native-0.3.1/docs/getting-started.rst +40 -0
  86. scikit_fem_native-0.3.1/docs/index.rst +65 -0
  87. scikit_fem_native-0.3.1/docs/requirements.txt +5 -0
  88. scikit_fem_native-0.3.1/docs/scikit-fem-compatibility.rst +63 -0
  89. scikit_fem_native-0.3.1/docs/scikit-fem-performance.rst +36 -0
  90. scikit_fem_native-0.3.1/examples/hcurl_tet_n1_maxwell.py +29 -0
  91. scikit_fem_native-0.3.1/examples/hcurl_tri_n1_maxwell.py +40 -0
  92. scikit_fem_native-0.3.1/examples/scikit-fem-gallery/README.md +27 -0
  93. scikit_fem_native-0.3.1/examples/scikit-fem-gallery/comparison.py +87 -0
  94. scikit_fem_native-0.3.1/examples/scikit-fem-gallery/ex01_poisson.py +68 -0
  95. scikit_fem_native-0.3.1/examples/scikit-fem-gallery/ex09_poisson_3d.py +68 -0
  96. scikit_fem_native-0.3.1/examples/scikit-fem-gallery/ex19_heat_equation.py +115 -0
  97. scikit_fem_native-0.3.1/examples/scikit-fem-gallery/run_all.py +16 -0
  98. scikit_fem_native-0.3.1/index.rst +7 -0
  99. scikit_fem_native-0.3.1/notes/20260812-form-pipeline-maintenance.md +75 -0
  100. scikit_fem_native-0.3.1/notes/20260812-hcurl-edge-topology-design.md +89 -0
  101. scikit_fem_native-0.3.1/notes/20260812-priorities-and-compatible-elements.md +222 -0
  102. scikit_fem_native-0.3.1/notes/20260812-stabilization-checkpoint.md +82 -0
  103. scikit_fem_native-0.3.1/notes/20260813-hcurl-public-api-review.md +75 -0
  104. scikit_fem_native-0.3.1/notes/20260813-hcurl-tri-n1-performance.md +87 -0
  105. scikit_fem_native-0.3.1/notes/20260813-nedelec-reference-tetrahedron.md +197 -0
  106. scikit_fem_native-0.3.1/notes/20260813-nedelec-reference-triangle.md +248 -0
  107. scikit_fem_native-0.3.1/notes/assembly-gap-audit-20260803.md +252 -0
  108. scikit_fem_native-0.3.1/notes/dev-notes.md +179 -0
  109. scikit_fem_native-0.3.1/notes/dev-status-20260803.md +400 -0
  110. scikit_fem_native-0.3.1/notes/gh-usage.md +231 -0
  111. scikit_fem_native-0.3.1/notes/native_fem_design_spec_v0.1.md +1082 -0
  112. scikit_fem_native-0.3.1/notes/thoughts.md +459 -0
  113. scikit_fem_native-0.3.1/notes/todo-20260801.md +229 -0
  114. scikit_fem_native-0.3.1/pyproject.toml +80 -0
  115. scikit_fem_native-0.3.1/python/skfemntv/__init__.py +227 -0
  116. scikit_fem_native-0.3.1/python/skfemntv/_coefficients.py +96 -0
  117. scikit_fem_native-0.3.1/python/skfemntv/_composite_fields.py +206 -0
  118. scikit_fem_native-0.3.1/python/skfemntv/_errors.py +8 -0
  119. scikit_fem_native-0.3.1/python/skfemntv/_form_compiler.py +33 -0
  120. scikit_fem_native-0.3.1/python/skfemntv/_form_parameters.py +124 -0
  121. scikit_fem_native-0.3.1/python/skfemntv/_form_terms.py +206 -0
  122. scikit_fem_native-0.3.1/python/skfemntv/_h1_fields.py +100 -0
  123. scikit_fem_native-0.3.1/python/skfemntv/_hcurl_mapping.py +107 -0
  124. scikit_fem_native-0.3.1/python/skfemntv/_interface_terms.py +141 -0
  125. scikit_fem_native-0.3.1/python/skfemntv/_nedelec_reference.py +143 -0
  126. scikit_fem_native-0.3.1/python/skfemntv/basis.py +3013 -0
  127. scikit_fem_native-0.3.1/python/skfemntv/bilinear_form.py +455 -0
  128. scikit_fem_native-0.3.1/python/skfemntv/capabilities.py +116 -0
  129. scikit_fem_native-0.3.1/python/skfemntv/cut_basis.py +228 -0
  130. scikit_fem_native-0.3.1/python/skfemntv/edge_dof_map.py +58 -0
  131. scikit_fem_native-0.3.1/python/skfemntv/edge_topology.py +88 -0
  132. scikit_fem_native-0.3.1/python/skfemntv/forms.py +1091 -0
  133. scikit_fem_native-0.3.1/python/skfemntv/hcurl_assembler.py +274 -0
  134. scikit_fem_native-0.3.1/python/skfemntv/hcurl_basis.py +450 -0
  135. scikit_fem_native-0.3.1/python/skfemntv/helpers.py +54 -0
  136. scikit_fem_native-0.3.1/python/skfemntv/implicit_interface.py +130 -0
  137. scikit_fem_native-0.3.1/python/skfemntv/interface.py +66 -0
  138. scikit_fem_native-0.3.1/python/skfemntv/levelset.py +747 -0
  139. scikit_fem_native-0.3.1/python/skfemntv/linear_form.py +132 -0
  140. scikit_fem_native-0.3.1/python/skfemntv/preflight.py +352 -0
  141. scikit_fem_native-0.3.1/python/skfemntv/regions.py +243 -0
  142. scikit_fem_native-0.3.1/python/skfemntv/runtime.py +64 -0
  143. scikit_fem_native-0.3.1/python/skfemntv/supermesh.py +1224 -0
  144. scikit_fem_native-0.3.1/scripts/build.sh +56 -0
  145. scikit_fem_native-0.3.1/scripts/release.sh +97 -0
  146. scikit_fem_native-0.3.1/scripts/upgrade_version.py +85 -0
  147. scikit_fem_native-0.3.1/tests/test_anisotropic_forms.py +124 -0
  148. scikit_fem_native-0.3.1/tests/test_benchmark.py +124 -0
  149. scikit_fem_native-0.3.1/tests/test_boundary_selection.py +205 -0
  150. scikit_fem_native-0.3.1/tests/test_build_wheels.py +22 -0
  151. scikit_fem_native-0.3.1/tests/test_capabilities.py +41 -0
  152. scikit_fem_native-0.3.1/tests/test_coefficient_components.py +139 -0
  153. scikit_fem_native-0.3.1/tests/test_compatible_forms.py +298 -0
  154. scikit_fem_native-0.3.1/tests/test_composite_forms.py +373 -0
  155. scikit_fem_native-0.3.1/tests/test_cross_basis_assembly.py +221 -0
  156. scikit_fem_native-0.3.1/tests/test_cross_tabulation.py +66 -0
  157. scikit_fem_native-0.3.1/tests/test_cut_basis.py +184 -0
  158. scikit_fem_native-0.3.1/tests/test_cut_quadrature.py +127 -0
  159. scikit_fem_native-0.3.1/tests/test_discontinuous_elements.py +175 -0
  160. scikit_fem_native-0.3.1/tests/test_edge_dof_map.py +76 -0
  161. scikit_fem_native-0.3.1/tests/test_edge_topology.py +79 -0
  162. scikit_fem_native-0.3.1/tests/test_element_restriction.py +176 -0
  163. scikit_fem_native-0.3.1/tests/test_facet_bilinear_form.py +102 -0
  164. scikit_fem_native-0.3.1/tests/test_form_architecture.py +69 -0
  165. scikit_fem_native-0.3.1/tests/test_functional.py +232 -0
  166. scikit_fem_native-0.3.1/tests/test_gallery_examples.py +15 -0
  167. scikit_fem_native-0.3.1/tests/test_geometry_validation.py +164 -0
  168. scikit_fem_native-0.3.1/tests/test_hcurl_assembler.py +110 -0
  169. scikit_fem_native-0.3.1/tests/test_hcurl_basis.py +105 -0
  170. scikit_fem_native-0.3.1/tests/test_hcurl_boundary_solve.py +99 -0
  171. scikit_fem_native-0.3.1/tests/test_hcurl_interpolation.py +113 -0
  172. scikit_fem_native-0.3.1/tests/test_hcurl_linear_convergence.py +96 -0
  173. scikit_fem_native-0.3.1/tests/test_hcurl_mapping.py +132 -0
  174. scikit_fem_native-0.3.1/tests/test_hcurl_public_api.py +43 -0
  175. scikit_fem_native-0.3.1/tests/test_hcurl_robustness.py +127 -0
  176. scikit_fem_native-0.3.1/tests/test_hcurl_tet_assembler.py +93 -0
  177. scikit_fem_native-0.3.1/tests/test_hcurl_tet_basis.py +84 -0
  178. scikit_fem_native-0.3.1/tests/test_hcurl_tet_boundary_solve.py +105 -0
  179. scikit_fem_native-0.3.1/tests/test_hcurl_tet_interpolation.py +66 -0
  180. scikit_fem_native-0.3.1/tests/test_hcurl_tet_robustness.py +77 -0
  181. scikit_fem_native-0.3.1/tests/test_implicit_interface.py +307 -0
  182. scikit_fem_native-0.3.1/tests/test_independent_facet_basis.py +80 -0
  183. scikit_fem_native-0.3.1/tests/test_interface_forms.py +332 -0
  184. scikit_fem_native-0.3.1/tests/test_interface_helpers.py +23 -0
  185. scikit_fem_native-0.3.1/tests/test_interior_facet_basis.py +192 -0
  186. scikit_fem_native-0.3.1/tests/test_interior_facet_basis_3d.py +174 -0
  187. scikit_fem_native-0.3.1/tests/test_interpolate.py +227 -0
  188. scikit_fem_native-0.3.1/tests/test_levelset.py +149 -0
  189. scikit_fem_native-0.3.1/tests/test_levelset_invariants.py +163 -0
  190. scikit_fem_native-0.3.1/tests/test_memory_calibration_benchmark.py +40 -0
  191. scikit_fem_native-0.3.1/tests/test_memory_preflight.py +193 -0
  192. scikit_fem_native-0.3.1/tests/test_mesh_topology.py +134 -0
  193. scikit_fem_native-0.3.1/tests/test_nedelec_reference.py +44 -0
  194. scikit_fem_native-0.3.1/tests/test_nedelec_reference_tet.py +40 -0
  195. scikit_fem_native-0.3.1/tests/test_nitsche_validation.py +159 -0
  196. scikit_fem_native-0.3.1/tests/test_public_api_contract.py +64 -0
  197. scikit_fem_native-0.3.1/tests/test_quad_elements.py +250 -0
  198. scikit_fem_native-0.3.1/tests/test_quadratic_levelset.py +236 -0
  199. scikit_fem_native-0.3.1/tests/test_quadrature.py +199 -0
  200. scikit_fem_native-0.3.1/tests/test_quadrilateral_interface_generic.py +32 -0
  201. scikit_fem_native-0.3.1/tests/test_regions.py +230 -0
  202. scikit_fem_native-0.3.1/tests/test_release_version.py +34 -0
  203. scikit_fem_native-0.3.1/tests/test_stokes_end_to_end.py +159 -0
  204. scikit_fem_native-0.3.1/tests/test_supermesh.py +448 -0
  205. scikit_fem_native-0.3.1/tests/test_supermesh_parallel.py +70 -0
  206. scikit_fem_native-0.3.1/tests/test_tri_elements.py +315 -0
  207. scikit_fem_native-0.3.1/tests/test_upgrade_version.py +56 -0
  208. scikit_fem_native-0.3.1/tests/test_workflows.py +34 -0
  209. scikit_fem_native-0.3.1/tools/build_wheels.py +79 -0
  210. scikit_fem_native-0.3.1/tools/check_release_version.py +39 -0
  211. scikit_fem_native-0.3.1/tools/local_ci.py +60 -0
  212. scikit_fem_native-0.3.1/tools/package_check.py +78 -0
@@ -0,0 +1,61 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths-ignore:
7
+ - "**/*.md"
8
+ - "benchmarks/**/results/**"
9
+ pull_request:
10
+ paths-ignore:
11
+ - "**/*.md"
12
+ - "benchmarks/**/results/**"
13
+ workflow_dispatch:
14
+
15
+ concurrency:
16
+ group: ci-${{ github.workflow }}-${{ github.ref }}
17
+ cancel-in-progress: true
18
+
19
+ permissions:
20
+ contents: read
21
+
22
+ jobs:
23
+ test:
24
+ name: Python ${{ matrix.python }} on ${{ matrix.os }}
25
+ strategy:
26
+ fail-fast: false
27
+ matrix:
28
+ include:
29
+ - os: ubuntu-24.04
30
+ python: "3.10"
31
+ - os: ubuntu-24.04
32
+ python: "3.14"
33
+ - os: macos-15
34
+ python: "3.14"
35
+ - os: windows-2025
36
+ python: "3.14"
37
+ runs-on: ${{ matrix.os }}
38
+ steps:
39
+ - uses: actions/checkout@v6
40
+ - uses: actions/setup-python@v6
41
+ with:
42
+ python-version: ${{ matrix.python }}
43
+ cache: pip
44
+ - name: Install package and test dependencies
45
+ run: python -m pip install --upgrade pip ".[test]"
46
+ - name: Run tests
47
+ run: python -m pytest
48
+
49
+ package:
50
+ name: Validate sdist and wheel
51
+ runs-on: ubuntu-24.04
52
+ steps:
53
+ - uses: actions/checkout@v6
54
+ - uses: actions/setup-python@v6
55
+ with:
56
+ python-version: "3.14"
57
+ cache: pip
58
+ - name: Build distributions
59
+ run: |
60
+ python -m pip install --upgrade build twine
61
+ python tools/package_check.py --smoke-only
@@ -0,0 +1,87 @@
1
+ name: Full validation
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ concurrency:
7
+ group: full-validation-${{ github.ref }}
8
+ cancel-in-progress: true
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ test:
15
+ name: Python ${{ matrix.python }} on ${{ matrix.label }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ include:
20
+ - os: ubuntu-24.04
21
+ label: Linux x86_64
22
+ python: "3.10"
23
+ - os: ubuntu-24.04
24
+ label: Linux x86_64
25
+ python: "3.11"
26
+ - os: ubuntu-24.04
27
+ label: Linux x86_64
28
+ python: "3.12"
29
+ - os: ubuntu-24.04
30
+ label: Linux x86_64
31
+ python: "3.13"
32
+ - os: ubuntu-24.04
33
+ label: Linux x86_64
34
+ python: "3.14"
35
+ - os: macos-15
36
+ label: macOS arm64
37
+ python: "3.14"
38
+ - os: macos-15-intel
39
+ label: macOS x86_64
40
+ python: "3.14"
41
+ - os: windows-2025
42
+ label: Windows AMD64
43
+ python: "3.14"
44
+ runs-on: ${{ matrix.os }}
45
+ steps:
46
+ - uses: actions/checkout@v6
47
+ - uses: actions/setup-python@v6
48
+ with:
49
+ python-version: ${{ matrix.python }}
50
+ cache: pip
51
+ - name: Install package and test dependencies
52
+ run: python -m pip install --upgrade pip ".[test]"
53
+ - name: Run tests
54
+ run: python -m pytest
55
+
56
+ wheel-smoke:
57
+ name: Wheel smoke on ${{ matrix.label }}
58
+ strategy:
59
+ fail-fast: false
60
+ matrix:
61
+ include:
62
+ - os: ubuntu-24.04
63
+ label: Linux x86_64
64
+ platform: linux
65
+ arch: x86_64
66
+ - os: macos-15
67
+ label: macOS arm64
68
+ platform: macos
69
+ arch: arm64
70
+ - os: macos-15-intel
71
+ label: macOS x86_64
72
+ platform: macos
73
+ arch: x86_64
74
+ - os: windows-2025
75
+ label: Windows AMD64
76
+ platform: windows
77
+ arch: AMD64
78
+ runs-on: ${{ matrix.os }}
79
+ steps:
80
+ - uses: actions/checkout@v6
81
+ - uses: actions/setup-python@v6
82
+ with:
83
+ python-version: "3.14"
84
+ - name: Build and test one wheel
85
+ run: |
86
+ python -m pip install "cibuildwheel>=4,<5"
87
+ python tools/build_wheels.py --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} --python 3.14
@@ -0,0 +1,90 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ sdist:
12
+ name: Build source distribution
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v6
16
+ - uses: actions/setup-python@v6
17
+ with:
18
+ python-version: "3.14"
19
+ - name: Check release version
20
+ run: >-
21
+ python tools/check_release_version.py
22
+ "${{ github.event.release.tag_name }}"
23
+ - name: Require a project license
24
+ run: python -c "from pathlib import Path; assert Path('LICENSE').is_file(), 'Add LICENSE before publishing'"
25
+ - name: Build source distribution
26
+ run: |
27
+ python -m pip install --upgrade build
28
+ python -m build --sdist
29
+ - uses: actions/upload-artifact@v7
30
+ with:
31
+ name: sdist
32
+ path: dist/*.tar.gz
33
+ if-no-files-found: error
34
+ retention-days: 1
35
+
36
+ wheels:
37
+ name: Build wheels on ${{ matrix.os }}
38
+ runs-on: ${{ matrix.os }}
39
+ strategy:
40
+ fail-fast: false
41
+ matrix:
42
+ include:
43
+ - os: ubuntu-24.04
44
+ platform: linux
45
+ arch: x86_64
46
+ artifact: linux-x86_64
47
+ - os: macos-15
48
+ platform: macos
49
+ arch: arm64
50
+ artifact: macos-arm64
51
+ - os: macos-15-intel
52
+ platform: macos
53
+ arch: x86_64
54
+ artifact: macos-x86_64
55
+ - os: windows-2025
56
+ platform: windows
57
+ arch: AMD64
58
+ artifact: windows-amd64
59
+ steps:
60
+ - uses: actions/checkout@v6
61
+ - uses: actions/setup-python@v6
62
+ with:
63
+ python-version: "3.14"
64
+ - name: Build and test wheels
65
+ run: |
66
+ python -m pip install "cibuildwheel>=4,<5"
67
+ python tools/build_wheels.py --platform ${{ matrix.platform }} --arch ${{ matrix.arch }}
68
+ - uses: actions/upload-artifact@v7
69
+ with:
70
+ name: wheels-${{ matrix.artifact }}
71
+ path: wheelhouse/*.whl
72
+ if-no-files-found: error
73
+ retention-days: 1
74
+
75
+ publish:
76
+ name: Publish to PyPI
77
+ needs: [sdist, wheels]
78
+ runs-on: ubuntu-latest
79
+ environment:
80
+ name: pypi
81
+ url: https://pypi.org/project/scikit-fem-native/
82
+ permissions:
83
+ id-token: write
84
+ steps:
85
+ - uses: actions/download-artifact@v8
86
+ with:
87
+ path: dist
88
+ merge-multiple: true
89
+ - name: Publish package distributions
90
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,10 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.so
4
+ .pytest_cache/
5
+ .coverage
6
+ build/
7
+ dist/
8
+ wheelhouse/
9
+ *.egg-info/
10
+ .venv/
@@ -0,0 +1,22 @@
1
+ # Read the Docs configuration file
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+
4
+ # Required
5
+ version: 2
6
+
7
+ # Set the OS, Python version, and other tools you might need
8
+ build:
9
+ os: ubuntu-24.04
10
+ tools:
11
+ python: "3.13"
12
+
13
+ # Build documentation in the "docs/" directory with Sphinx
14
+ sphinx:
15
+ configuration: docs/conf.py
16
+
17
+ # Optionally, but recommended,
18
+ # declare the Python requirements required to build your documentation
19
+ # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
20
+ python:
21
+ install:
22
+ - requirements: docs/requirements.txt
@@ -0,0 +1,51 @@
1
+ # Changelog
2
+
3
+ ## 0.3.1 — 2026-08-21
4
+
5
+ - Align package distribution rename to `scikit-fem-native` with canonical
6
+ documentation and repository metadata references.
7
+ - Fix remaining project metadata and docs links to avoid inconsistent
8
+ `skfem-native` / `scikit-fem-native` navigation during user onboarding.
9
+
10
+ ## 0.3.0 — 2026-08-13
11
+
12
+ ### Added
13
+
14
+ - Experimental lowest-order Nedelec H(curl) vertical slices for affine
15
+ triangles and tetrahedra, including oriented edge DOFs, covariant Piola
16
+ mapping, interpolation, quadrature evaluation, boundary constraints, vector
17
+ loads, and reusable mass/curl-curl/Maxwell assembly.
18
+ - A threaded native TetN1 integration kernel and native edge-topology/CSR setup
19
+ kernels, with explicit application-owned thread control.
20
+ - Conservative memory preflight for the dedicated H(curl) assemblers and
21
+ recorded TetN1 performance and memory calibration benchmarks.
22
+ - Typed-form support for multiple coefficients, coefficient components, and
23
+ scalar anisotropic gradient contractions.
24
+ - Machine-readable capability declarations and explicit errors for unsupported
25
+ mathematical operations.
26
+ - Documentation and compatibility examples for scikit-fem-style workflows.
27
+
28
+ ### Changed
29
+
30
+ - Vectorized TriN1 basis mapping and moved size-dependent edge numbering and
31
+ CSR setup loops to native code.
32
+ - Stabilized public tensor layouts: component-first public coefficient/basis
33
+ views and entity-first private native storage are documented explicitly.
34
+ - Expanded geometry, orientation, convergence, distorted-mesh, memory-budget,
35
+ and cross-platform validation.
36
+
37
+ ### Fixed
38
+
39
+ - Made memory calibration portable to Windows by using the Win32 process
40
+ working-set API when the Unix-only `resource` module is unavailable.
41
+
42
+ ### Scope
43
+
44
+ H(curl) support remains experimental and is limited to dedicated affine TriN1
45
+ and TetN1 APIs. General `Basis`/`asm` integration, curved H(curl) mappings,
46
+ higher-order Nedelec elements, and solver policy are not included.
47
+
48
+ ## 0.2.1
49
+
50
+ - Previous PyPI release. This changelog begins with the consolidated 0.3.0
51
+ release notes; older history remains available in the Git repository.
@@ -0,0 +1,29 @@
1
+ cmake_minimum_required(VERSION 3.18)
2
+ project(skfem_native LANGUAGES CXX)
3
+
4
+ find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
5
+ find_package(pybind11 CONFIG REQUIRED)
6
+
7
+ pybind11_add_module(
8
+ _skfn
9
+ cpp/src/bindings.cpp
10
+ cpp/src/runtime.cpp
11
+ cpp/src/assembly/linear_form_assembler.cpp
12
+ cpp/src/assembly/functional_assembler.cpp
13
+ cpp/src/assembly/supermesh_builder.cpp
14
+ cpp/src/assembly/bilinear_form_assembler.cpp
15
+ cpp/src/assembly/cross_bilinear_assembler.cpp
16
+ cpp/src/assembly/cut_form_assembler.cpp
17
+ cpp/src/assembly/cut_cross_assembler.cpp
18
+ cpp/src/assembly/basis_geometry.cpp
19
+ cpp/src/assembly/edge_topology.cpp
20
+ )
21
+ target_compile_features(_skfn PRIVATE cxx_std_17)
22
+ target_include_directories(_skfn PRIVATE cpp/include)
23
+ if(MSVC)
24
+ target_compile_options(_skfn PRIVATE /O2 /W4)
25
+ else()
26
+ target_compile_options(_skfn PRIVATE -O3 -Wall -Wextra -Wpedantic)
27
+ endif()
28
+
29
+ install(TARGETS _skfn DESTINATION skfemntv)
@@ -0,0 +1,80 @@
1
+ # Development philosophy
2
+
3
+ ## Purpose
4
+
5
+ scikit-fem makes finite-element formulations easy to express, inspect, and
6
+ test in Python. `skfem-native` improves the numerical assembly part of that
7
+ workflow without moving application mathematics into a compiled framework.
8
+
9
+ This distinction matters increasingly in AI-assisted development. Nonlinear
10
+ constitutive laws, coupled weak forms, and application-specific contact
11
+ algorithms can be written and revised rapidly when they remain ordinary Python
12
+ components. The compiled layer should accelerate stable, reusable numerical
13
+ operations rather than become the owner of every material or formulation.
14
+
15
+ The project therefore aims to preserve two properties:
16
+
17
+ - application code remains readable Python close to the mathematics
18
+ - performance-critical, reusable assembly machinery runs in native code
19
+
20
+ ## Ownership boundary
21
+
22
+ `skfemntv` owns:
23
+
24
+ - meshes, elements, bases, tabulation, and quadrature
25
+ - generic functional, linear, bilinear, and cross-bilinear assembly
26
+ - assembly from caller-supplied tensor coefficients
27
+ - sparse scatter and threaded native kernels
28
+ - cut-cell and implicit-interface quadrature
29
+ - interface supermeshes and contact-facet search
30
+ - geometry and integration diagnostics
31
+
32
+ The calling application owns:
33
+
34
+ - weak forms and coefficient fields
35
+ - constitutive updates and state histories
36
+ - contact and interface formulations
37
+ - multiplier spaces, stabilization, and algebraic reduction
38
+ - nonlinear stepping, linear solvers, and convergence policy
39
+
40
+ For example, an application can define one nonlinear material update and pass
41
+ the resulting coefficient and tangent tensors through either `skfem.asm` or
42
+ `skfemntv.asm`. Likewise, `skfemntv` may construct shared interface geometry,
43
+ but the application decides whether that geometry is used for Mortar, dual,
44
+ Nitsche, or another contact formulation.
45
+
46
+ ## Design principles
47
+
48
+ 1. Keep the public assembly call shape close to scikit-fem.
49
+ 2. Keep formulation-specific policy out of the backend.
50
+ 3. Prefer generic coefficient and tensor assembly over material-specific APIs.
51
+ 4. Make backend selection explicit and test numerical equivalence.
52
+ 5. Keep diagnostics available at Python boundaries.
53
+ 6. Remove misleading abstractions rather than preserving accidental APIs.
54
+
55
+ ## Public degree-of-freedom ordering
56
+
57
+ Supported backends must expose the same global degree-of-freedom ordering as
58
+ scikit-fem. The canonical order groups DOFs by topological entity: vertices,
59
+ then shared edges or facets, then element interiors. Local native kernels may
60
+ use explicit high-order connectivity, but that representation must not leak as
61
+ a different public vector or matrix ordering.
62
+
63
+ Entity-based numbering is preferred over assigning new nodes while traversing
64
+ elements because it is independent of first encounter, keeps boundary and
65
+ interior blocks identifiable, supports direct backend interchange, and follows
66
+ the decomposition used by scikit-fem's `Dofs` implementation.
67
+
68
+ Gallery compatibility tests must compare public matrices and vectors directly.
69
+ A coordinate permutation is useful for diagnosing an ordering defect, but is
70
+ not an acceptable permanent compatibility layer for a supported element.
71
+
72
+ ## Compatibility
73
+
74
+ `skfemntv` is a selectable backend, not a promise of complete scikit-fem API
75
+ coverage. Shared call shapes should produce equivalent numerical results, but
76
+ applications should not rely on implicit backend substitution.
77
+
78
+ Version 0.2 intentionally removed formulation-specific 0.1 APIs such as native
79
+ material models, Mortar reduction policy, KKT types, and specialized Nitsche
80
+ assembly. Those responsibilities belong to the application layer.
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
@@ -0,0 +1,6 @@
1
+ skfem-native
2
+
3
+ Copyright (C) 2026 Kohei Watanabe
4
+
5
+ Licensed under LGPL-3.0-or-later.
6
+ See the LICENSE file for details.