PODImodels 0.0.3__py3-none-any.whl

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.
@@ -0,0 +1,211 @@
1
+ Metadata-Version: 2.4
2
+ Name: PODImodels
3
+ Version: 0.0.3
4
+ Summary: A py package to create ROM utilizing PODI method
5
+ Author-email: Shenhui_Ruan <shenhui.ruan@kit.edu>
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: numpy
10
+ Requires-Dist: scikit-learn
11
+ Requires-Dist: scipy
12
+ Requires-Dist: pyvista
13
+ Requires-Dist: torch
14
+ Dynamic: license-file
15
+
16
+ # PODImodels
17
+
18
+ [![PyPI version](https://badge.fury.io/py/PODImodels.svg)](https://badge.fury.io/py/PODImodels)
19
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
20
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
21
+
22
+ **PODImodels** (Proper Orthogonal Decomposition-based Interpolation Models) is a Python package for creating Reduced-Order Models (ROM) using POD combined with various machine learning techniques. It provides a unified framework for reduced-order modeling of high-dimensional field data, particularly useful for computational fluid dynamics and other physics-based simulations.
23
+
24
+ ## Features
25
+
26
+ - **Multiple Interpolation Methods**: Support for Linear Regression, Ridge Regression, Gaussian Process Regression (GPR), Radial Basis Functions (RBF), and Artificial Neural Networks (ANN)
27
+ - **Flexible Modeling Approaches**: Choose between direct field prediction or POD coefficient interpolation
28
+ - **Easy-to-Use API**: Scikit-learn-inspired interface with `fit()` and `predict()` methods
29
+ - **Built-in Scaling**: Optional data normalization for improved model performance
30
+ - **Extensible Architecture**: Abstract base class for implementing custom interpolation models
31
+
32
+ ## Installation
33
+
34
+ Install PODImodels using pip:
35
+
36
+ ```bash
37
+ pip install PODImodels
38
+ ```
39
+
40
+ For development installation:
41
+
42
+ ```bash
43
+ git clone https://github.com/Ruansh233/PODImodels.git
44
+ cd PODImodels
45
+ pip install -e .
46
+ ```
47
+
48
+ ## Requirements
49
+
50
+ - Python >= 3.8
51
+ - numpy
52
+ - scikit-learn
53
+ - scipy
54
+ - pyvista
55
+ - torch
56
+
57
+ All dependencies will be automatically installed with the package.
58
+
59
+ ## Quick Start
60
+
61
+ ```python
62
+ import numpy as np
63
+ from PODImodels import PODGPR, fieldsRBF
64
+
65
+ # Prepare your data
66
+ # parameters: (n_samples, n_parameters)
67
+ # field_snapshots: (n_samples, n_field_points)
68
+ parameters = np.random.rand(100, 3)
69
+ field_snapshots = np.random.rand(100, 10000)
70
+
71
+ # Example 1: POD with Gaussian Process Regression
72
+ model = PODGPR(rank=15, with_scaler_x=True, with_scaler_y=True)
73
+ model.fit(parameters, field_snapshots)
74
+ predictions = model.predict(new_parameters)
75
+
76
+ # Example 2: Direct field prediction with Radial Basis Functions
77
+ model = fieldsRBF(kernel='thin_plate_spline', degree=2)
78
+ model.fit(parameters, field_snapshots)
79
+ field_prediction = model.predict(test_parameters)
80
+ ```
81
+
82
+ ## Available Models
83
+
84
+ PODImodels provides two categories of models:
85
+
86
+ 1. **Direct Field Models** (`fields*`): Learn direct mapping from parameters to field values
87
+ 2. **POD Coefficient Models** (`POD*`): Learn mapping from parameters to POD coefficients (more efficient for large fields)
88
+
89
+ ### Linear Regression Models
90
+ - `fieldsLinear`: Direct field prediction using linear regression
91
+ - `PODLinear`: POD coefficient prediction using linear regression
92
+ - `fieldsRidge`: Direct field prediction using Ridge regression
93
+ - `PODRidge`: POD coefficient prediction using Ridge regression
94
+
95
+ ### Gaussian Process Regression Models
96
+ - `fieldsGPR`: Direct field prediction using Gaussian Process Regression
97
+ - `PODGPR`: POD coefficient prediction using Gaussian Process Regression
98
+ - `fieldsRidgeGPR`: Field prediction with Ridge regularization and GPR
99
+ - `PODRidgeGPR`: POD coefficient prediction with Ridge regularization and GPR
100
+
101
+ ### Radial Basis Function Models
102
+ - `fieldsRBF`: Direct field prediction using Radial Basis Function interpolation
103
+ - `PODRBF`: POD coefficient prediction using Radial Basis Function interpolation
104
+ - `fieldsRidgeRBF`: Field prediction with Ridge regularization and RBF
105
+ - `PODRidgeRBF`: POD coefficient prediction with Ridge regularization and RBF
106
+
107
+ ### Neural Network Models
108
+ - `PODANN`: POD coefficient prediction using Artificial Neural Networks
109
+
110
+ ## Usage Examples
111
+
112
+ ### Example 1: POD-GPR for CFD Field Reconstruction
113
+
114
+ ```python
115
+ from PODImodels import PODGPR
116
+ import numpy as np
117
+
118
+ # Load your simulation data
119
+ # X: Design parameters (e.g., Reynolds number, geometry params)
120
+ # Y: Field snapshots (e.g., velocity, pressure fields)
121
+ X_train = np.load('parameters.npy') # shape: (n_samples, n_params)
122
+ Y_train = np.load('fields.npy') # shape: (n_samples, n_points)
123
+
124
+ # Initialize model with 20 POD modes
125
+ model = PODGPR(rank=20, with_scaler_x=True, with_scaler_y=True)
126
+
127
+ # Train the model
128
+ model.fit(X_train, Y_train)
129
+
130
+ # Predict new fields
131
+ X_test = np.array([[100, 0.5, 1.2]]) # New parameter set
132
+ Y_pred = model.predict(X_test)
133
+ ```
134
+
135
+ ### Example 2: Direct Field Interpolation with RBF
136
+
137
+ ```python
138
+ from PODImodels import fieldsRBF
139
+
140
+ # Initialize RBF model
141
+ model = fieldsRBF(
142
+ kernel='thin_plate_spline',
143
+ degree=2,
144
+ with_scaler_x=True
145
+ )
146
+
147
+ # Train and predict
148
+ model.fit(X_train, Y_train)
149
+ Y_pred = model.predict(X_test)
150
+ ```
151
+
152
+ ### Example 3: Using Neural Networks
153
+
154
+ ```python
155
+ from PODImodels import PODANN
156
+
157
+ # Initialize ANN model
158
+ model = PODANN(
159
+ rank=15,
160
+ hidden_layers=[64, 32],
161
+ activation='relu',
162
+ epochs=100
163
+ )
164
+
165
+ model.fit(X_train, Y_train)
166
+ Y_pred = model.predict(X_test)
167
+ ```
168
+
169
+ ## Model Selection Guide
170
+
171
+ - **Linear/Ridge**: Fast, interpretable, works well for linear relationships
172
+ - **GPR**: Best for smooth, continuous fields with uncertainty quantification
173
+ - **RBF**: Excellent for scattered data interpolation
174
+ - **ANN**: Powerful for complex nonlinear relationships, requires more data
175
+
176
+ Choose **POD*** models when dealing with large field dimensions (>1000 points) for better computational efficiency.
177
+
178
+ ## Documentation
179
+
180
+ For detailed documentation and API reference, visit the [GitHub repository](https://github.com/Ruansh233/PODImodels).
181
+
182
+ ## Contributing
183
+
184
+ Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
185
+
186
+ ## Citation
187
+
188
+ If you use PODImodels in your research, please cite:
189
+
190
+ ```bibtex
191
+ @software{PODImodels2024,
192
+ author = {Ruan, Shenhui},
193
+ title = {PODImodels: POD-based Interpolation Models for Reduced-Order Modeling},
194
+ year = {2024},
195
+ url = {https://github.com/Ruansh233/PODImodels}
196
+ }
197
+ ```
198
+
199
+ ## License
200
+
201
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
202
+
203
+ ## Author
204
+
205
+ **Shenhui Ruan**
206
+ Email: shenhui.ruan@kit.edu
207
+ GitHub: [@Ruansh233](https://github.com/Ruansh233)
208
+
209
+ ## Acknowledgments
210
+
211
+ This package was developed for reduced-order modeling in computational physics applications, with a focus on CFD simulations.
@@ -0,0 +1,9 @@
1
+ PODImodels/PODImodels.py,sha256=EPl12pkpV6KPN2BFj-oIgCA8D8VGEbysKlugG3FGZHk,37728
2
+ PODImodels/PODdata.py,sha256=2N0yZM6P_BpxvUaDYMPZGGuOmXia0dI3C1TrJJj6D18,19293
3
+ PODImodels/__init__.py,sha256=JuwBq06BHcl4KBm9ifoNEKzFgSllET50pgqaQRjLURc,2182
4
+ PODImodels/podImodelabstract.py,sha256=PfP-JjyKoEAXFL-AxC0zjJzUKOudh-LrHeG-Iqj5iEk,30896
5
+ podimodels-0.0.3.dist-info/licenses/LICENSE,sha256=maqixz01QZKwAgUjSbn6diLezFvqA5X3wmzr2ADn8AQ,1071
6
+ podimodels-0.0.3.dist-info/METADATA,sha256=x0NPFmbXqIEjPQgKQsl_FGBlDRYoDj4iKq5PZN4fw2c,6708
7
+ podimodels-0.0.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
8
+ podimodels-0.0.3.dist-info/top_level.txt,sha256=JiLLSU7WbowDs0wA3Voldy0E0Rn_TTugXTwMpx6kUZ0,11
9
+ podimodels-0.0.3.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 RUAN, SHENHUI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ PODImodels