radia 1.3.1__py3-none-any.whl → 1.3.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.
- python/rad_ngsolve.pyd +0 -0
- {radia-1.3.1.dist-info → radia-1.3.3.dist-info}/METADATA +16 -16
- {radia-1.3.1.dist-info → radia-1.3.3.dist-info}/RECORD +6 -7
- python/rad_ngsolve_cached_wrapper.py +0 -36
- {radia-1.3.1.dist-info → radia-1.3.3.dist-info}/WHEEL +0 -0
- {radia-1.3.1.dist-info → radia-1.3.3.dist-info}/licenses/LICENSE +0 -0
- {radia-1.3.1.dist-info → radia-1.3.3.dist-info}/top_level.txt +0 -0
python/rad_ngsolve.pyd
CHANGED
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: radia
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.3
|
|
4
4
|
Summary: Radia 3D Magnetostatics with NGSolve Integration and OpenMP Parallelization
|
|
5
5
|
Home-page: https://github.com/ksugahar/Radia_NGSolve
|
|
6
6
|
Author: Pascal Elleaume
|
|
@@ -88,12 +88,12 @@ pip install radia-ngsolve
|
|
|
88
88
|
# 1. Build radia.pyd (core module)
|
|
89
89
|
.\Build.ps1
|
|
90
90
|
|
|
91
|
-
# 2. Build
|
|
91
|
+
# 2. Build radia_ngsolve.pyd (optional, for NGSolve integration)
|
|
92
92
|
.\Build_NGSolve.ps1
|
|
93
93
|
|
|
94
94
|
# Outputs:
|
|
95
95
|
# - dist/radia.pyd
|
|
96
|
-
# - build/Release/
|
|
96
|
+
# - build/Release/radia_ngsolve.pyd
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
See [README_BUILD.md](README_BUILD.md) for detailed build instructions.
|
|
@@ -117,12 +117,12 @@ print(f"Field: {field} T")
|
|
|
117
117
|
|
|
118
118
|
### NGSolve Integration
|
|
119
119
|
|
|
120
|
-
The `
|
|
120
|
+
The `radia_ngsolve` module provides a C++ CoefficientFunction interface for using Radia magnetic fields in NGSolve FEM analysis.
|
|
121
121
|
|
|
122
122
|
**Function Specification:**
|
|
123
123
|
|
|
124
124
|
```python
|
|
125
|
-
|
|
125
|
+
radia_ngsolve.RadiaField(radia_obj, field_type='b')
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
**Parameters:**
|
|
@@ -149,7 +149,7 @@ import ngsolve
|
|
|
149
149
|
from ngsolve import Mesh, H1, GridFunction
|
|
150
150
|
|
|
151
151
|
import radia as rad
|
|
152
|
-
import
|
|
152
|
+
import radia_ngsolve
|
|
153
153
|
|
|
154
154
|
# Create Radia magnet
|
|
155
155
|
magnet = rad.ObjRecMag([0,0,0], [20,20,20], [0,0,1.2]) # mm units
|
|
@@ -157,10 +157,10 @@ rad.MatApl(magnet, rad.MatPM(1.2, 900000, [0,0,1])) # NdFeB permanent magnet
|
|
|
157
157
|
rad.Solve(magnet, 0.0001, 10000)
|
|
158
158
|
|
|
159
159
|
# Create NGSolve CoefficientFunction for different field types
|
|
160
|
-
B_field =
|
|
161
|
-
H_field =
|
|
162
|
-
A_field =
|
|
163
|
-
M_field =
|
|
160
|
+
B_field = radia_ngsolve.RadiaField(magnet, 'b') # Flux density [T]
|
|
161
|
+
H_field = radia_ngsolve.RadiaField(magnet, 'h') # Magnetic field [A/m]
|
|
162
|
+
A_field = radia_ngsolve.RadiaField(magnet, 'a') # Vector potential [T·m]
|
|
163
|
+
M_field = radia_ngsolve.RadiaField(magnet, 'm') # Magnetization [A/m]
|
|
164
164
|
|
|
165
165
|
# Use in FEM analysis (NGSolve mesh in meters)
|
|
166
166
|
gf = GridFunction(fes)
|
|
@@ -177,10 +177,10 @@ See [examples/Radia_to_NGSolve_CoefficientFunction/](examples/Radia_to_NGSolve_C
|
|
|
177
177
|
- [docs/DIRECTORY_STRUCTURE.md](docs/DIRECTORY_STRUCTURE.md) - Project structure
|
|
178
178
|
|
|
179
179
|
### NGSolve Integration
|
|
180
|
-
- [RAD_NGSOLVE_BUILD_SUCCESS.md](RAD_NGSOLVE_BUILD_SUCCESS.md) - Complete
|
|
180
|
+
- [RAD_NGSOLVE_BUILD_SUCCESS.md](RAD_NGSOLVE_BUILD_SUCCESS.md) - Complete radia_ngsolve documentation
|
|
181
181
|
- [examples/Radia_to_NGSolve_CoefficientFunction/README.md](examples/Radia_to_NGSolve_CoefficientFunction/README.md) - NGSolve examples overview
|
|
182
182
|
- [examples/Radia_to_NGSolve_CoefficientFunction/EXAMPLES_GUIDE.md](examples/Radia_to_NGSolve_CoefficientFunction/EXAMPLES_GUIDE.md) - Detailed usage guide
|
|
183
|
-
- [tests/
|
|
183
|
+
- [tests/test_radia_ngsolve.py](tests/test_radia_ngsolve.py) - Integration tests
|
|
184
184
|
|
|
185
185
|
### Visualization
|
|
186
186
|
- [docs/PYVISTA_VIEWER.md](examples/2024_02_03_振分電磁石/PYVISTA_VIEWER.md) - PyVista viewer guide
|
|
@@ -239,7 +239,7 @@ python tests/test_radia.py
|
|
|
239
239
|
python tests/test_advanced.py
|
|
240
240
|
|
|
241
241
|
# NGSolve integration test
|
|
242
|
-
python tests/
|
|
242
|
+
python tests/test_radia_ngsolve.py
|
|
243
243
|
|
|
244
244
|
# OpenMP performance test
|
|
245
245
|
python tests/test_parallel_performance.py
|
|
@@ -248,7 +248,7 @@ python tests/test_parallel_performance.py
|
|
|
248
248
|
pytest tests/
|
|
249
249
|
|
|
250
250
|
# Run specific test suite
|
|
251
|
-
pytest tests/
|
|
251
|
+
pytest tests/test_radia_ngsolve.py -v
|
|
252
252
|
```
|
|
253
253
|
|
|
254
254
|
See [tests/README.md](tests/README.md) for detailed testing documentation.
|
|
@@ -296,7 +296,7 @@ export_geometry_to_vtk(mag, 'geometry.vtk')
|
|
|
296
296
|
### Runtime Requirements
|
|
297
297
|
- Python 3.12
|
|
298
298
|
- NumPy
|
|
299
|
-
- NGSolve (optional, for FEM coupling via
|
|
299
|
+
- NGSolve (optional, for FEM coupling via radia_ngsolve)
|
|
300
300
|
- PyVista (optional, for 3D visualization)
|
|
301
301
|
|
|
302
302
|
## Changes from Original Radia
|
|
@@ -348,7 +348,7 @@ See:
|
|
|
348
348
|
|
|
349
349
|
**This Fork**:
|
|
350
350
|
- OpenMP parallelization
|
|
351
|
-
- NGSolve C++ integration (
|
|
351
|
+
- NGSolve C++ integration (radia_ngsolve)
|
|
352
352
|
- Python 3.12 optimization
|
|
353
353
|
- Build system modernization
|
|
354
354
|
- PyVista integration
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
python/__init__.py,sha256=oUOAjf_vY8DNy5HRU7oArAMic8urvHCR9yHSi4HFkkQ,47
|
|
2
2
|
python/nastran_reader.py,sha256=r4K2LJvHBtvBumbinbiQeyPA42iyvxNyAd6Y05lxeZs,10035
|
|
3
|
-
python/rad_ngsolve.pyd,sha256=
|
|
4
|
-
python/rad_ngsolve_cached_wrapper.py,sha256=x3iMXvYMcQxcGCXMrhEAP6sqy_QDr7kcpiHRSfLf_lY,1221
|
|
3
|
+
python/rad_ngsolve.pyd,sha256=s5ZvpTIrjYeV_B3vQv5HrtP4u_RaPhvxuZf5aKv3oC0,566272
|
|
5
4
|
python/rad_ngsolve_fast.py,sha256=GkC7ruKy3MESHsO0iRSWsrgLU4-DPPgctOi6pPpsWg4,5675
|
|
6
5
|
python/radia.pyd,sha256=n9nOJQAzLDaoifMEMvHT160o7RIONFRINa3kdSvbjFE,1811968
|
|
7
6
|
python/radia_coil_builder.py,sha256=nQkiAbfhueNvvxUARHdPD0C68ImidHmUQv_q4RsImeY,11253
|
|
@@ -9,8 +8,8 @@ python/radia_field_cached.py,sha256=_9w9ETludvkoCx5Qiy6hXvmR7aJ_fzJXof2aF7JqM2Y,
|
|
|
9
8
|
python/radia_ngsolve_field.py,sha256=suJr4wacfYFKOkyV-5AQuHWnW5rtUMb0gSSjq8VRSXc,10166
|
|
10
9
|
python/radia_pyvista_viewer.py,sha256=JS33Mx4azGI7hUX0bzefc6zJfhv6qfRjM3Kl1bE9Mjs,4275
|
|
11
10
|
python/radia_vtk_export.py,sha256=UbPvo7ftHYLREz6TSpWrpLw7JesFhMA58-22R63HHH4,3997
|
|
12
|
-
radia-1.3.
|
|
13
|
-
radia-1.3.
|
|
14
|
-
radia-1.3.
|
|
15
|
-
radia-1.3.
|
|
16
|
-
radia-1.3.
|
|
11
|
+
radia-1.3.3.dist-info/licenses/LICENSE,sha256=a8e7Y3GCWv0nE5mpUTUbnjCAKgZadruvJSkJrZWIaCA,4281
|
|
12
|
+
radia-1.3.3.dist-info/METADATA,sha256=kVPOR6CHhW7wcGzKdT4R3eUgvP_72xVTrDB-_TNITk0,13329
|
|
13
|
+
radia-1.3.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
14
|
+
radia-1.3.3.dist-info/top_level.txt,sha256=J-z0poNcsv31IHB413--iOY8LoHBKiTHeybHX3abokI,7
|
|
15
|
+
radia-1.3.3.dist-info/RECORD,,
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Optimized Python wrapper for PrepareCache()
|
|
3
|
-
|
|
4
|
-
This wrapper handles point list preparation in Python (which is faster than
|
|
5
|
-
doing it in C++ via pybind11), then calls the C++ PrepareCache().
|
|
6
|
-
|
|
7
|
-
Usage:
|
|
8
|
-
import rad_ngsolve_cached_wrapper as rn_cache
|
|
9
|
-
|
|
10
|
-
# Collect points from mesh
|
|
11
|
-
all_points = [[x1,y1,z1], [x2,y2,z2], ...]
|
|
12
|
-
|
|
13
|
-
# Prepare cache (optimized)
|
|
14
|
-
A_cf = rad_ngsolve.RadiaField(bg_field, 'a')
|
|
15
|
-
rn_cache.prepare_cache_optimized(A_cf, all_points)
|
|
16
|
-
|
|
17
|
-
# Use cached values
|
|
18
|
-
gf.Set(A_cf) # Fast!
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
def prepare_cache_optimized(coefficient_function, points_meters):
|
|
22
|
-
"""
|
|
23
|
-
Optimized PrepareCache() with Python-side list preparation
|
|
24
|
-
|
|
25
|
-
Args:
|
|
26
|
-
coefficient_function: rad_ngsolve.RadiaField object
|
|
27
|
-
points_meters: List of [x, y, z] in meters
|
|
28
|
-
|
|
29
|
-
This function is much faster than calling PrepareCache() directly because:
|
|
30
|
-
- Python list operations are fast in Python
|
|
31
|
-
- Avoids pybind11 overhead for list building
|
|
32
|
-
- Only crosses Python/C++ boundary once
|
|
33
|
-
"""
|
|
34
|
-
# Call the C++ PrepareCache with Python-prepared list
|
|
35
|
-
# The C++ side will extract points to C++ arrays efficiently
|
|
36
|
-
coefficient_function.PrepareCache(points_meters)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|