gbmsc-pde 0.1.0__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 (47) hide show
  1. gbmsc_pde-0.1.0/CHANGELOG.md +18 -0
  2. gbmsc_pde-0.1.0/CITATION.cff +11 -0
  3. gbmsc_pde-0.1.0/LICENSE +160 -0
  4. gbmsc_pde-0.1.0/MANIFEST.in +15 -0
  5. gbmsc_pde-0.1.0/NOTICE +4 -0
  6. gbmsc_pde-0.1.0/PKG-INFO +215 -0
  7. gbmsc_pde-0.1.0/README.md +174 -0
  8. gbmsc_pde-0.1.0/docs/gbmsc_pde/api.md +22 -0
  9. gbmsc_pde-0.1.0/docs/gbmsc_pde/boundary_conditions.md +106 -0
  10. gbmsc_pde-0.1.0/docs/gbmsc_pde/citation.md +43 -0
  11. gbmsc_pde-0.1.0/docs/gbmsc_pde/examples.md +62 -0
  12. gbmsc_pde-0.1.0/docs/gbmsc_pde/gbs_approximation.md +147 -0
  13. gbmsc_pde-0.1.0/docs/gbmsc_pde/index.md +62 -0
  14. gbmsc_pde-0.1.0/docs/gbmsc_pde/operators.md +41 -0
  15. gbmsc_pde-0.1.0/docs/gbmsc_pde/pde.md +125 -0
  16. gbmsc_pde-0.1.0/docs/gbmsc_pde/rectangular_method.md +274 -0
  17. gbmsc_pde-0.1.0/docs/gbmsc_pde/solver.md +91 -0
  18. gbmsc_pde-0.1.0/docs/gbmsc_pde/source_grid.md +121 -0
  19. gbmsc_pde-0.1.0/examples/gbmsc_pde/Poisson_Dirichlet_conditions.ipynb +141 -0
  20. gbmsc_pde-0.1.0/examples/gbmsc_pde/Poisson_mixed_conditions_Neu-Dir.ipynb +220 -0
  21. gbmsc_pde-0.1.0/examples/gbmsc_pde/poisson_dirichlet.py +35 -0
  22. gbmsc_pde-0.1.0/examples/gbmsc_pde/poisson_mixed_conditions.py +40 -0
  23. gbmsc_pde-0.1.0/pyproject.toml +83 -0
  24. gbmsc_pde-0.1.0/setup.cfg +4 -0
  25. gbmsc_pde-0.1.0/src/gbmsc_pde/__init__.py +18 -0
  26. gbmsc_pde-0.1.0/src/gbmsc_pde/approximation/__init__.py +3 -0
  27. gbmsc_pde-0.1.0/src/gbmsc_pde/approximation/shepard.py +1144 -0
  28. gbmsc_pde-0.1.0/src/gbmsc_pde/boundary/__init__.py +9 -0
  29. gbmsc_pde-0.1.0/src/gbmsc_pde/boundary/applier.py +82 -0
  30. gbmsc_pde-0.1.0/src/gbmsc_pde/boundary/conditions.py +231 -0
  31. gbmsc_pde-0.1.0/src/gbmsc_pde/operators/__init__.py +5 -0
  32. gbmsc_pde-0.1.0/src/gbmsc_pde/operators/differential.py +132 -0
  33. gbmsc_pde-0.1.0/src/gbmsc_pde/pde/__init__.py +12 -0
  34. gbmsc_pde-0.1.0/src/gbmsc_pde/pde/assembly.py +69 -0
  35. gbmsc_pde-0.1.0/src/gbmsc_pde/pde/problem.py +59 -0
  36. gbmsc_pde-0.1.0/src/gbmsc_pde/pde/terms.py +96 -0
  37. gbmsc_pde-0.1.0/src/gbmsc_pde/py.typed +1 -0
  38. gbmsc_pde-0.1.0/src/gbmsc_pde/solvers/__init__.py +3 -0
  39. gbmsc_pde-0.1.0/src/gbmsc_pde/solvers/linear.py +181 -0
  40. gbmsc_pde-0.1.0/src/gbmsc_pde/source_grid/__init__.py +3 -0
  41. gbmsc_pde-0.1.0/src/gbmsc_pde/source_grid/grid.py +368 -0
  42. gbmsc_pde-0.1.0/src/gbmsc_pde.egg-info/PKG-INFO +215 -0
  43. gbmsc_pde-0.1.0/src/gbmsc_pde.egg-info/SOURCES.txt +45 -0
  44. gbmsc_pde-0.1.0/src/gbmsc_pde.egg-info/dependency_links.txt +1 -0
  45. gbmsc_pde-0.1.0/src/gbmsc_pde.egg-info/requires.txt +20 -0
  46. gbmsc_pde-0.1.0/src/gbmsc_pde.egg-info/top_level.txt +1 -0
  47. gbmsc_pde-0.1.0/tests/gbmsc_pde/test_gbmsc_pde.py +292 -0
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ This project follows semantic versioning.
6
+
7
+ ## [0.1.0] - 2026-06-06
8
+
9
+ ### Added
10
+
11
+ - Initial public release of `gbmsc-pde`.
12
+ - Structured 2D source-grid utilities.
13
+ - Grid-Based Multinode Shepard Collocation method.
14
+ - Sparse differential operators.
15
+ - Linear PDE assembly with diffusion, convection, reaction, and source terms.
16
+ - Boundary-condition support for Dirichlet, Neumann, and Robin conditions.
17
+ - Linear solver interface for direct, CG, and GMRES solvers.
18
+ - Package metadata, tests, example, docs, and GitHub Actions CI.
@@ -0,0 +1,11 @@
1
+ cff-version: 1.2.0
2
+ title: "gbmsc-pde"
3
+ message: "If you use gbmsc-pde in academic work, please cite it using this metadata."
4
+ type: software
5
+ authors:
6
+ - family-names: "El Harrak"
7
+ given-names: "Anouar"
8
+ version: "0.1.0"
9
+ date-released: "2026-06-06"
10
+ license: "Apache-2.0"
11
+ repository-code: "https://github.com/e-anouar/gbmsc-pde"
@@ -0,0 +1,160 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ https://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the
13
+ copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other
16
+ entities that control, are controlled by, or are under common control with
17
+ that entity. For the purposes of this definition, "control" means (i) the
18
+ power, direct or indirect, to cause the direction or management of such entity,
19
+ whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or
20
+ more of the outstanding shares, or (iii) beneficial ownership of such entity.
21
+
22
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
23
+ permissions granted by this License.
24
+
25
+ "Source" form shall mean the preferred form for making modifications,
26
+ including but not limited to software source code, documentation source, and
27
+ configuration files.
28
+
29
+ "Object" form shall mean any form resulting from mechanical transformation or
30
+ translation of a Source form, including but not limited to compiled object
31
+ code, generated documentation, and conversions to other media types.
32
+
33
+ "Work" shall mean the work of authorship, whether in Source or Object form,
34
+ made available under the License, as indicated by a copyright notice that is
35
+ included in or attached to the work.
36
+
37
+ "Derivative Works" shall mean any work, whether in Source or Object form, that
38
+ is based on (or derived from) the Work and for which the editorial revisions,
39
+ annotations, elaborations, or other modifications represent, as a whole, an
40
+ original work of authorship. For the purposes of this License, Derivative Works
41
+ shall not include works that remain separable from, or merely link (or bind by
42
+ name) to the interfaces of, the Work and Derivative Works thereof.
43
+
44
+ "Contribution" shall mean any work of authorship, including the original
45
+ version of the Work and any modifications or additions to that Work or
46
+ Derivative Works thereof, that is intentionally submitted to Licensor for
47
+ inclusion in the Work by the copyright owner or by an individual or Legal
48
+ Entity authorized to submit on behalf of the copyright owner. For the purposes
49
+ of this definition, "submitted" means any form of electronic, verbal, or
50
+ written communication sent to the Licensor or its representatives, including
51
+ but not limited to communication on electronic mailing lists, source code
52
+ control systems, and issue tracking systems that are managed by, or on behalf
53
+ of, the Licensor for the purpose of discussing and improving the Work, but
54
+ excluding communication that is conspicuously marked or otherwise designated in
55
+ writing by the copyright owner as "Not a Contribution."
56
+
57
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf
58
+ of whom a Contribution has been received by Licensor and subsequently
59
+ incorporated within the Work.
60
+
61
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
62
+ License, each Contributor hereby grants to You a perpetual, worldwide,
63
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
64
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
65
+ sublicense, and distribute the Work and such Derivative Works in Source or
66
+ Object form.
67
+
68
+ 3. Grant of Patent License. Subject to the terms and conditions of this
69
+ License, each Contributor hereby grants to You a perpetual, worldwide,
70
+ non-exclusive, no-charge, royalty-free, irrevocable patent license to make,
71
+ have made, use, offer to sell, sell, import, and otherwise transfer the Work,
72
+ where such license applies only to those patent claims licensable by such
73
+ Contributor that are necessarily infringed by their Contribution(s) alone or by
74
+ combination of their Contribution(s) with the Work to which such Contribution(s)
75
+ was submitted. If You institute patent litigation against any entity alleging
76
+ that the Work or a Contribution incorporated within the Work constitutes direct
77
+ or contributory patent infringement, then any patent licenses granted to You
78
+ under this License for that Work shall terminate as of the date such litigation
79
+ is filed.
80
+
81
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
82
+ Derivative Works thereof in any medium, with or without modifications, and in
83
+ Source or Object form, provided that You meet the following conditions:
84
+
85
+ (a) You must give any other recipients of the Work or Derivative Works a copy
86
+ of this License; and
87
+
88
+ (b) You must cause any modified files to carry prominent notices stating that
89
+ You changed the files; and
90
+
91
+ (c) You must retain, in the Source form of any Derivative Works that You
92
+ distribute, all copyright, patent, trademark, and attribution notices from the
93
+ Source form of the Work, excluding those notices that do not pertain to any part
94
+ of the Derivative Works; and
95
+
96
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then
97
+ any Derivative Works that You distribute must include a readable copy of the
98
+ attribution notices contained within such NOTICE file, excluding those notices
99
+ that do not pertain to any part of the Derivative Works, in at least one of the
100
+ following places: within a NOTICE text file distributed as part of the
101
+ Derivative Works; within the Source form or documentation, if provided along
102
+ with the Derivative Works; or within a display generated by the Derivative
103
+ Works, if and wherever such third-party notices normally appear. The contents
104
+ of the NOTICE file are for informational purposes only and do not modify the
105
+ License. You may add Your own attribution notices within Derivative Works that
106
+ You distribute, alongside or as an addendum to the NOTICE text from the Work,
107
+ provided that such additional attribution notices cannot be construed as
108
+ modifying the License.
109
+
110
+ You may add Your own copyright statement to Your modifications and may provide
111
+ additional or different license terms and conditions for use, reproduction, or
112
+ distribution of Your modifications, or for any such Derivative Works as a
113
+ whole, provided Your use, reproduction, and distribution of the Work otherwise
114
+ complies with the conditions stated in this License.
115
+
116
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
117
+ Contribution intentionally submitted for inclusion in the Work by You to the
118
+ Licensor shall be under the terms and conditions of this License, without any
119
+ additional terms or conditions. Notwithstanding the above, nothing herein shall
120
+ supersede or modify the terms of any separate license agreement you may have
121
+ executed with Licensor regarding such Contributions.
122
+
123
+ 6. Trademarks. This License does not grant permission to use the trade names,
124
+ trademarks, service marks, or product names of the Licensor, except as required
125
+ for reasonable and customary use in describing the origin of the Work and
126
+ reproducing the content of the NOTICE file.
127
+
128
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
129
+ writing, Licensor provides the Work (and each Contributor provides its
130
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
131
+ KIND, either express or implied, including, without limitation, any warranties
132
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
133
+ PARTICULAR PURPOSE. You are solely responsible for determining the
134
+ appropriateness of using or redistributing the Work and assume any risks
135
+ associated with Your exercise of permissions under this License.
136
+
137
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
138
+ tort (including negligence), contract, or otherwise, unless required by
139
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
140
+ writing, shall any Contributor be liable to You for damages, including any
141
+ direct, indirect, special, incidental, or consequential damages of any character
142
+ arising as a result of this License or out of the use or inability to use the
143
+ Work (including but not limited to damages for loss of goodwill, work stoppage,
144
+ computer failure or malfunction, or any and all other commercial damages or
145
+ losses), even if such Contributor has been advised of the possibility of such
146
+ damages.
147
+
148
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or
149
+ Derivative Works thereof, You may choose to offer, and charge a fee for,
150
+ acceptance of support, warranty, indemnity, or other liability obligations
151
+ and/or rights consistent with this License. However, in accepting such
152
+ obligations, You may act only on Your own behalf and on Your sole
153
+ responsibility, not on behalf of any other Contributor, and only if You agree
154
+ to indemnify, defend, and hold each Contributor harmless for any liability
155
+ incurred by, or claims asserted against, such Contributor by reason of your
156
+ accepting any such warranty or additional liability.
157
+
158
+ END OF TERMS AND CONDITIONS
159
+
160
+ Copyright 2026 gbmsc-pde contributors
@@ -0,0 +1,15 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ include CITATION.cff
5
+ include pyproject.toml
6
+ include MANIFEST.in
7
+ include NOTICE
8
+
9
+ recursive-include docs/gbmsc_pde *.md
10
+ recursive-include examples/gbmsc_pde *.py *.ipynb
11
+ recursive-include tests/gbmsc_pde *.py
12
+
13
+ prune .github
14
+ prune .pytest_cache
15
+ global-exclude __pycache__ *.py[cod]
gbmsc_pde-0.1.0/NOTICE ADDED
@@ -0,0 +1,4 @@
1
+ gbmsc-pde
2
+ Copyright 2026 gbmsc-pde contributors
3
+
4
+ This product includes software developed for the gbmsc-pde project.
@@ -0,0 +1,215 @@
1
+ Metadata-Version: 2.4
2
+ Name: gbmsc-pde
3
+ Version: 0.1.0
4
+ Summary: PDE solvers using the Grid-Based Multinode Shepard Collocation method.
5
+ Author: Anouar El Harrak
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/e-anouar/gbmsc-pde
8
+ Project-URL: Repository, https://github.com/e-anouar/gbmsc-pde
9
+ Project-URL: Issues, https://github.com/e-anouar/gbmsc-pde/issues
10
+ Project-URL: Changelog, https://github.com/e-anouar/gbmsc-pde/blob/main/CHANGELOG.md
11
+ Project-URL: Documentation, https://e-anouar.github.io/gbmsc-pde/
12
+ Keywords: GBMSC,pde,numerical-methods,approximation,interpolation,Shepard,scientific-computing
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: numpy>=1.23
25
+ Requires-Dist: scipy>=1.9
26
+ Provides-Extra: dev
27
+ Requires-Dist: build>=1.2; extra == "dev"
28
+ Requires-Dist: pytest>=8; extra == "dev"
29
+ Requires-Dist: ruff>=0.8; extra == "dev"
30
+ Requires-Dist: twine>=5.0; extra == "dev"
31
+ Provides-Extra: docs
32
+ Requires-Dist: mkdocs>=1.6; extra == "docs"
33
+ Requires-Dist: mkdocs-material>=9.5; extra == "docs"
34
+ Requires-Dist: mkdocstrings[python]>=0.25; extra == "docs"
35
+ Provides-Extra: plot
36
+ Requires-Dist: matplotlib>=3.7; extra == "plot"
37
+ Provides-Extra: examples
38
+ Requires-Dist: matplotlib>=3.7; extra == "examples"
39
+ Requires-Dist: jupyter>=1.0; extra == "examples"
40
+ Dynamic: license-file
41
+
42
+ # gbmsc-pde
43
+
44
+ `gbmsc-pde` is a Python package for solving linear PDEs on two-dimensional
45
+ rectangular domains with the **Grid-Based Multinode Shepard Collocation Method
46
+ (GBMSC)**.
47
+
48
+ Version: `0.1.0`
49
+
50
+ ## Method
51
+
52
+ GBMSC uses a structured source grid, samples local multinode tensor-product
53
+ subgrids, builds local Lagrange interpolants on those subgrids, and blends the
54
+ local interpolants with Shepard weights. PDE equations are enforced by
55
+ collocation at source nodes, with sparse differential operators assembled from
56
+ the blended approximation.
57
+
58
+ ## Features
59
+
60
+ - Structured 2D source-grid generation.
61
+ - Local multinode Lagrange interpolation on sliding subgrids.
62
+ - Shepard blending of local approximants.
63
+ - Sparse first- and second-derivative operators.
64
+ - Linear PDE assembly with diffusion, convection, reaction, and source terms.
65
+ - Dirichlet, Neumann, and Robin boundary-condition helpers.
66
+ - Direct, CG, and GMRES sparse linear solvers.
67
+ - Exact-nodal interpolation mode for source-node reconstruction.
68
+
69
+ ## Installation
70
+
71
+ Install from a local checkout:
72
+
73
+ ```bash
74
+ pip install .
75
+ ```
76
+
77
+ For development:
78
+
79
+ ```bash
80
+ pip install -e ".[dev]"
81
+ ```
82
+
83
+ For documentation tooling:
84
+
85
+ ```bash
86
+ pip install -e ".[docs]"
87
+ ```
88
+
89
+ For plotting support:
90
+
91
+ ```bash
92
+ pip install ".[plot]"
93
+ ```
94
+
95
+ ## Quick Start
96
+
97
+ ```python
98
+ import numpy as np
99
+
100
+ from gbmsc_pde import (
101
+ BoundaryConditions,
102
+ GBMSCApproximation,
103
+ LinearPDE,
104
+ LinearSolver,
105
+ SourceGrid,
106
+ )
107
+
108
+ grid = SourceGrid(grid_shape=(21, 21), subgrid_shape=(5, 5))
109
+ approximation = GBMSCApproximation(grid, step=(4, 4), support_mode="nodal_limit")
110
+
111
+ pde = LinearPDE(approximation)
112
+ pde.add_diffusion_term(-1.0)
113
+ pde.add_source_term(lambda x, y: np.ones_like(x))
114
+
115
+ bcs = BoundaryConditions(grid)
116
+ bcs.add_dirichlet(grid.boundary_indices()["all"], 0.0)
117
+
118
+ u = LinearSolver(pde, bcs).solve()
119
+ solution_grid = u.reshape(grid.grid_shape)
120
+
121
+ grid.plot(solution_grid, view="2d")
122
+ ```
123
+
124
+ The step must align with the local subgrid size:
125
+
126
+ ```text
127
+ N_x = step_x * k_x + n_x
128
+ N_y = step_y * k_y + n_y
129
+ ```
130
+
131
+ for integer `k_x` and `k_y`.
132
+
133
+ ## Public API
134
+
135
+ Preferred names:
136
+
137
+ ```python
138
+ from gbmsc_pde import (
139
+ SourceGrid,
140
+ GBMSCApproximation,
141
+ BoundaryConditions,
142
+ LinearPDE,
143
+ LinearSolver,
144
+ )
145
+ ```
146
+
147
+ New code should use these names consistently: `SourceGrid`,
148
+ `GBMSCApproximation`, `BoundaryConditions`, `LinearPDE`, and `LinearSolver`.
149
+
150
+ ## Project Layout
151
+
152
+ ```text
153
+ src/
154
+ gbmsc_pde/
155
+ approximation/ GBMSC approximation and interpolation routines
156
+ boundary/ Boundary-condition containers and appliers
157
+ source_grid/ Structured source-grid utilities
158
+ operators/ Sparse differential-operator builders
159
+ pde/ Linear PDE terms and assembly
160
+ solvers/ Linear solvers
161
+ ```
162
+
163
+ ## Development
164
+
165
+ Run tests:
166
+
167
+ ```bash
168
+ pytest
169
+ ```
170
+
171
+ Run lightweight lint checks:
172
+
173
+ ```bash
174
+ ruff check src tests examples/gbmsc_pde/*.py
175
+ ```
176
+
177
+ Build source and wheel distributions:
178
+
179
+ ```bash
180
+ python -m build
181
+ ```
182
+
183
+ Check package metadata before uploading:
184
+
185
+ ```bash
186
+ twine check dist/*
187
+ ```
188
+
189
+ Build the documentation site:
190
+
191
+ ```bash
192
+ mkdocs build
193
+ ```
194
+
195
+ See `CONTRIBUTING.md` for the full release checklist.
196
+
197
+ ## Contribution Policy
198
+
199
+ This project is currently not accepting external contributions. Issues and
200
+ pull requests may be used by the maintainer for project tracking, but there is
201
+ no expectation that external contributions will be reviewed or merged.
202
+
203
+ ## Versioning
204
+
205
+ This project uses semantic versioning. The first public release is `0.1.0`.
206
+
207
+ ## Citation
208
+
209
+ If this package supports academic work, please cite it using the metadata in
210
+ `CITATION.cff`. If you also use the underlying numerical method, cite the
211
+ method preprint as described in the documentation citation page.
212
+
213
+ ## License
214
+
215
+ Distributed under the Apache License 2.0. See `LICENSE`.
@@ -0,0 +1,174 @@
1
+ # gbmsc-pde
2
+
3
+ `gbmsc-pde` is a Python package for solving linear PDEs on two-dimensional
4
+ rectangular domains with the **Grid-Based Multinode Shepard Collocation Method
5
+ (GBMSC)**.
6
+
7
+ Version: `0.1.0`
8
+
9
+ ## Method
10
+
11
+ GBMSC uses a structured source grid, samples local multinode tensor-product
12
+ subgrids, builds local Lagrange interpolants on those subgrids, and blends the
13
+ local interpolants with Shepard weights. PDE equations are enforced by
14
+ collocation at source nodes, with sparse differential operators assembled from
15
+ the blended approximation.
16
+
17
+ ## Features
18
+
19
+ - Structured 2D source-grid generation.
20
+ - Local multinode Lagrange interpolation on sliding subgrids.
21
+ - Shepard blending of local approximants.
22
+ - Sparse first- and second-derivative operators.
23
+ - Linear PDE assembly with diffusion, convection, reaction, and source terms.
24
+ - Dirichlet, Neumann, and Robin boundary-condition helpers.
25
+ - Direct, CG, and GMRES sparse linear solvers.
26
+ - Exact-nodal interpolation mode for source-node reconstruction.
27
+
28
+ ## Installation
29
+
30
+ Install from a local checkout:
31
+
32
+ ```bash
33
+ pip install .
34
+ ```
35
+
36
+ For development:
37
+
38
+ ```bash
39
+ pip install -e ".[dev]"
40
+ ```
41
+
42
+ For documentation tooling:
43
+
44
+ ```bash
45
+ pip install -e ".[docs]"
46
+ ```
47
+
48
+ For plotting support:
49
+
50
+ ```bash
51
+ pip install ".[plot]"
52
+ ```
53
+
54
+ ## Quick Start
55
+
56
+ ```python
57
+ import numpy as np
58
+
59
+ from gbmsc_pde import (
60
+ BoundaryConditions,
61
+ GBMSCApproximation,
62
+ LinearPDE,
63
+ LinearSolver,
64
+ SourceGrid,
65
+ )
66
+
67
+ grid = SourceGrid(grid_shape=(21, 21), subgrid_shape=(5, 5))
68
+ approximation = GBMSCApproximation(grid, step=(4, 4), support_mode="nodal_limit")
69
+
70
+ pde = LinearPDE(approximation)
71
+ pde.add_diffusion_term(-1.0)
72
+ pde.add_source_term(lambda x, y: np.ones_like(x))
73
+
74
+ bcs = BoundaryConditions(grid)
75
+ bcs.add_dirichlet(grid.boundary_indices()["all"], 0.0)
76
+
77
+ u = LinearSolver(pde, bcs).solve()
78
+ solution_grid = u.reshape(grid.grid_shape)
79
+
80
+ grid.plot(solution_grid, view="2d")
81
+ ```
82
+
83
+ The step must align with the local subgrid size:
84
+
85
+ ```text
86
+ N_x = step_x * k_x + n_x
87
+ N_y = step_y * k_y + n_y
88
+ ```
89
+
90
+ for integer `k_x` and `k_y`.
91
+
92
+ ## Public API
93
+
94
+ Preferred names:
95
+
96
+ ```python
97
+ from gbmsc_pde import (
98
+ SourceGrid,
99
+ GBMSCApproximation,
100
+ BoundaryConditions,
101
+ LinearPDE,
102
+ LinearSolver,
103
+ )
104
+ ```
105
+
106
+ New code should use these names consistently: `SourceGrid`,
107
+ `GBMSCApproximation`, `BoundaryConditions`, `LinearPDE`, and `LinearSolver`.
108
+
109
+ ## Project Layout
110
+
111
+ ```text
112
+ src/
113
+ gbmsc_pde/
114
+ approximation/ GBMSC approximation and interpolation routines
115
+ boundary/ Boundary-condition containers and appliers
116
+ source_grid/ Structured source-grid utilities
117
+ operators/ Sparse differential-operator builders
118
+ pde/ Linear PDE terms and assembly
119
+ solvers/ Linear solvers
120
+ ```
121
+
122
+ ## Development
123
+
124
+ Run tests:
125
+
126
+ ```bash
127
+ pytest
128
+ ```
129
+
130
+ Run lightweight lint checks:
131
+
132
+ ```bash
133
+ ruff check src tests examples/gbmsc_pde/*.py
134
+ ```
135
+
136
+ Build source and wheel distributions:
137
+
138
+ ```bash
139
+ python -m build
140
+ ```
141
+
142
+ Check package metadata before uploading:
143
+
144
+ ```bash
145
+ twine check dist/*
146
+ ```
147
+
148
+ Build the documentation site:
149
+
150
+ ```bash
151
+ mkdocs build
152
+ ```
153
+
154
+ See `CONTRIBUTING.md` for the full release checklist.
155
+
156
+ ## Contribution Policy
157
+
158
+ This project is currently not accepting external contributions. Issues and
159
+ pull requests may be used by the maintainer for project tracking, but there is
160
+ no expectation that external contributions will be reviewed or merged.
161
+
162
+ ## Versioning
163
+
164
+ This project uses semantic versioning. The first public release is `0.1.0`.
165
+
166
+ ## Citation
167
+
168
+ If this package supports academic work, please cite it using the metadata in
169
+ `CITATION.cff`. If you also use the underlying numerical method, cite the
170
+ method preprint as described in the documentation citation page.
171
+
172
+ ## License
173
+
174
+ Distributed under the Apache License 2.0. See `LICENSE`.
@@ -0,0 +1,22 @@
1
+ # API Reference
2
+
3
+ This page is generated from the Python docstrings. For task-oriented usage,
4
+ start with the component pages and examples.
5
+
6
+ ::: gbmsc_pde
7
+
8
+ ::: gbmsc_pde.source_grid.grid.SourceGrid
9
+
10
+ ::: gbmsc_pde.approximation.shepard.GBMSCApproximation
11
+
12
+ ::: gbmsc_pde.approximation.shepard.lagrange_1d
13
+
14
+ ::: gbmsc_pde.operators.differential.build_differential_operators
15
+
16
+ ::: gbmsc_pde.pde.problem.LinearPDE
17
+
18
+ ::: gbmsc_pde.boundary.conditions.BoundaryConditions
19
+
20
+ ::: gbmsc_pde.boundary.applier.BoundaryConditionApplier
21
+
22
+ ::: gbmsc_pde.solvers.linear.LinearSolver