radia 1.3.13__py3-none-any.whl → 1.3.15__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.
radia/__init__.py CHANGED
@@ -1,8 +1,23 @@
1
- # Radia Python package
1
+ # Radia Python package
2
2
  # This module re-exports all symbols from the C++ extension module (radia.pyd)
3
3
  # so that 'import radia' works correctly when installed via pip
4
4
 
5
- __version__ = "1.3.13"
5
+ __version__ = "1.3.15"
6
+
7
+ # Add package directory to DLL search path (Windows)
8
+ # This is needed for finding libopenblas.dll
9
+ import os
10
+ import sys
11
+
12
+ _package_dir = os.path.dirname(os.path.abspath(__file__))
13
+
14
+ # Add DLL directory for Windows (Python 3.8+)
15
+ if sys.platform == 'win32':
16
+ if hasattr(os, 'add_dll_directory'):
17
+ os.add_dll_directory(_package_dir)
18
+ # Also add to PATH as fallback for older methods
19
+ if _package_dir not in os.environ.get('PATH', ''):
20
+ os.environ['PATH'] = _package_dir + os.pathsep + os.environ.get('PATH', '')
6
21
 
7
22
  # Import all symbols from the C++ extension module
8
23
  try:
@@ -14,5 +29,6 @@ except ImportError:
14
29
  except ImportError as e:
15
30
  raise ImportError(
16
31
  "Failed to import radia C++ extension module (radia.pyd). "
17
- "Ensure the package was built correctly with Build.ps1 before installation."
32
+ "Ensure the package was built correctly with Build.ps1 before installation. "
33
+ f"Package directory: {_package_dir}"
18
34
  ) from e
radia/libopenblas.dll ADDED
Binary file
@@ -190,6 +190,27 @@ def create_radia_tetrahedron(vertices, magnetization=None):
190
190
  raise RuntimeError(f"Failed to create Radia tetrahedron: {e}")
191
191
 
192
192
 
193
+ def compute_element_centroid(vertices):
194
+ """
195
+ Compute the centroid of an element from its vertices.
196
+
197
+ Parameters
198
+ ----------
199
+ vertices : list of list
200
+ List of vertex coordinates [[x1,y1,z1], [x2,y2,z2], ...]
201
+
202
+ Returns
203
+ -------
204
+ list
205
+ Centroid coordinates [cx, cy, cz]
206
+ """
207
+ n = len(vertices)
208
+ cx = sum(v[0] for v in vertices) / n
209
+ cy = sum(v[1] for v in vertices) / n
210
+ cz = sum(v[2] for v in vertices) / n
211
+ return [cx, cy, cz]
212
+
213
+
193
214
  def extract_elements(mesh, material_filter=None, allow_hex=False):
194
215
  """
195
216
  Extract volume elements (tetrahedra and optionally hexahedra) from NGSolve mesh.
@@ -563,6 +584,7 @@ __version__ = '0.2.0'
563
584
  __all__ = [
564
585
  'netgen_mesh_to_radia',
565
586
  'extract_elements',
587
+ 'compute_element_centroid',
566
588
  'create_radia_tetrahedron',
567
589
  'create_radia_hexahedron',
568
590
  'TETRA_FACES',
radia/radia.pyd CHANGED
Binary file
radia/radia_ngsolve.pyd CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: radia
3
- Version: 1.3.13
3
+ Version: 1.3.15
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
@@ -28,6 +28,8 @@ Requires-Dist: numpy>=1.20
28
28
  Provides-Extra: viz
29
29
  Requires-Dist: pyvista>=0.40; extra == "viz"
30
30
  Requires-Dist: matplotlib>=3.5; extra == "viz"
31
+ Provides-Extra: ngsolve
32
+ Requires-Dist: ngsolve==6.2.2405; extra == "ngsolve"
31
33
  Provides-Extra: test
32
34
  Requires-Dist: pytest>=7.0; extra == "test"
33
35
  Requires-Dist: pytest-cov>=4.0; extra == "test"
@@ -1,17 +1,18 @@
1
- radia/__init__.py,sha256=Do8bui6K-w7osLlYEZIbqe4y3O_XJM-YyQrNC1fIf8A,642
1
+ radia/__init__.py,sha256=jXbXdfq2S1I_2pTZtmHx6gkmaNXr1TqLGww2clQ6kxc,1219
2
+ radia/libopenblas.dll,sha256=6CTPn8IuWUmAfOmVoy5BOjRfuX5j5tEM-_QaqGOCGTw,51076488
2
3
  radia/nastran_mesh_import.py,sha256=CSoVhZCXa85lPiTF2hlspE2clBKOD7-_sCp1bxu_IK0,18147
3
- radia/netgen_mesh_import.py,sha256=UopXk-5bbfj1j9_hyiq8jbjb4SQXnWaeuaC7TDf17wA,19872
4
+ radia/netgen_mesh_import.py,sha256=4A2cmtDs8zsGwAKJV4wFOxwRs7Aq8o9N9E9v_t_giEU,20411
4
5
  radia/rad_ngsolve_fast.py,sha256=GkC7ruKy3MESHsO0iRSWsrgLU4-DPPgctOi6pPpsWg4,5675
5
- radia/radia.pyd,sha256=D4gEiskou5IsCrMYlvVBwC4Wi4xGguNPqfm1kr58CVk,1724928
6
+ radia/radia.pyd,sha256=SOCvVPyctDWoHr8OyIWkGfzSNfc8pAXp9Ltde6Lx9Bw,1783808
6
7
  radia/radia_coil_builder.py,sha256=nQkiAbfhueNvvxUARHdPD0C68ImidHmUQv_q4RsImeY,11253
7
8
  radia/radia_field_cached.py,sha256=Bjw3ecNe3u7AAXnLob5m_tjYIY7HwB9DpgFg9a-aP_8,9509
8
- radia/radia_ngsolve.pyd,sha256=VxYwTOyfR-A9Pfzwypu5f9osB9l-bg2EU0s0FgIpOEw,563200
9
+ radia/radia_ngsolve.pyd,sha256=qJ5wncaWzYCtgyWfUpJlv5t5lzZ7krYceSghejZRiAA,563712
9
10
  radia/radia_ngsolve_field.py,sha256=suJr4wacfYFKOkyV-5AQuHWnW5rtUMb0gSSjq8VRSXc,10166
10
11
  radia/radia_ngsolve_utils.py,sha256=tFzPz8rsSi9TCGF2--92H9KFMuua9oAq8JLvw_XdoHs,8408
11
12
  radia/radia_pyvista_viewer.py,sha256=JS33Mx4azGI7hUX0bzefc6zJfhv6qfRjM3Kl1bE9Mjs,4275
12
13
  radia/radia_vtk_export.py,sha256=I8Vyyt9tky78Qw1xPru9f0Rii6QEmdEgTFjQtamyooc,6540
13
- radia-1.3.13.dist-info/licenses/LICENSE,sha256=yaWxyzG9DpJ44dDNdGni4nukwiZ8pU-r_aW-1tYNAjk,4374
14
- radia-1.3.13.dist-info/METADATA,sha256=06DJAPLPIblpakeEzF1lCoaQuvei7G1C0Lv3lkwNa8w,15846
15
- radia-1.3.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- radia-1.3.13.dist-info/top_level.txt,sha256=kNDonE5X3Q2xnmOsWleQnGKQobuFsKM6Px5_Ta1I6x8,6
17
- radia-1.3.13.dist-info/RECORD,,
14
+ radia-1.3.15.dist-info/licenses/LICENSE,sha256=yaWxyzG9DpJ44dDNdGni4nukwiZ8pU-r_aW-1tYNAjk,4374
15
+ radia-1.3.15.dist-info/METADATA,sha256=qpRYHYcK4ZS5S9V6zpbFS-N3h9JAmqu64kV18_conr8,15925
16
+ radia-1.3.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ radia-1.3.15.dist-info/top_level.txt,sha256=kNDonE5X3Q2xnmOsWleQnGKQobuFsKM6Px5_Ta1I6x8,6
18
+ radia-1.3.15.dist-info/RECORD,,
File without changes