fiqus 2025.2.0__py3-none-any.whl → 2025.11.0__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.
Files changed (54) hide show
  1. fiqus/MainFiQuS.py +24 -28
  2. fiqus/data/DataConductor.py +350 -301
  3. fiqus/data/DataFiQuS.py +42 -115
  4. fiqus/data/DataFiQuSCCT.py +150 -150
  5. fiqus/data/DataFiQuSConductor.py +97 -84
  6. fiqus/data/DataFiQuSConductorAC_Strand.py +701 -565
  7. fiqus/data/DataModelCommon.py +439 -0
  8. fiqus/data/DataMultipole.py +0 -13
  9. fiqus/data/DataRoxieParser.py +7 -0
  10. fiqus/data/DataWindingsCCT.py +37 -37
  11. fiqus/data/RegionsModelFiQuS.py +61 -104
  12. fiqus/geom_generators/GeometryCCT.py +904 -905
  13. fiqus/geom_generators/GeometryConductorAC_Strand.py +1863 -1391
  14. fiqus/geom_generators/GeometryMultipole.py +5 -4
  15. fiqus/geom_generators/GeometryPancake3D.py +1 -1
  16. fiqus/getdp_runners/RunGetdpCCT.py +13 -4
  17. fiqus/getdp_runners/RunGetdpConductorAC_Strand.py +341 -201
  18. fiqus/getdp_runners/RunGetdpPancake3D.py +2 -2
  19. fiqus/mains/MainConductorAC_Strand.py +141 -133
  20. fiqus/mains/MainMultipole.py +6 -5
  21. fiqus/mains/MainPancake3D.py +3 -4
  22. fiqus/mesh_generators/MeshCCT.py +209 -209
  23. fiqus/mesh_generators/MeshConductorAC_Strand.py +709 -656
  24. fiqus/mesh_generators/MeshMultipole.py +43 -46
  25. fiqus/parsers/ParserDAT.py +16 -16
  26. fiqus/parsers/ParserGetDPOnSection.py +212 -212
  27. fiqus/parsers/ParserGetDPTimeTable.py +134 -134
  28. fiqus/parsers/ParserMSH.py +53 -53
  29. fiqus/parsers/ParserPOS.py +214 -214
  30. fiqus/parsers/ParserRES.py +142 -142
  31. fiqus/plotters/PlotPythonCCT.py +133 -133
  32. fiqus/plotters/PlotPythonConductorAC.py +1079 -855
  33. fiqus/plotters/PlotPythonMultipole.py +18 -18
  34. fiqus/post_processors/PostProcessCCT.py +444 -440
  35. fiqus/post_processors/PostProcessConductorAC.py +997 -49
  36. fiqus/post_processors/PostProcessMultipole.py +19 -19
  37. fiqus/pre_processors/PreProcessCCT.py +175 -175
  38. fiqus/pro_material_functions/ironBHcurves.pro +246 -246
  39. fiqus/pro_templates/combined/CCT_template.pro +275 -274
  40. fiqus/pro_templates/combined/ConductorAC_template.pro +1474 -1025
  41. fiqus/pro_templates/combined/Multipole_template.pro +5 -5
  42. fiqus/utils/Utils.py +12 -7
  43. {fiqus-2025.2.0.dist-info → fiqus-2025.11.0.dist-info}/METADATA +65 -63
  44. fiqus-2025.11.0.dist-info/RECORD +86 -0
  45. {fiqus-2025.2.0.dist-info → fiqus-2025.11.0.dist-info}/WHEEL +1 -1
  46. tests/test_geometry_generators.py +4 -0
  47. tests/test_mesh_generators.py +5 -0
  48. tests/test_solvers.py +41 -4
  49. tests/utils/fiqus_test_classes.py +15 -6
  50. tests/utils/generate_reference_files_ConductorAC.py +57 -57
  51. tests/utils/helpers.py +97 -97
  52. fiqus-2025.2.0.dist-info/RECORD +0 -85
  53. {fiqus-2025.2.0.dist-info → fiqus-2025.11.0.dist-info}/LICENSE.txt +0 -0
  54. {fiqus-2025.2.0.dist-info → fiqus-2025.11.0.dist-info}/top_level.txt +0 -0
@@ -9,12 +9,13 @@ from fiqus.utils.Utils import FilesAndFolders as Util
9
9
  from fiqus.utils.Utils import GeometricFunctions as Func
10
10
  from fiqus.data import DataFiQuS as dF
11
11
  from fiqus.data import DataMultipole as dM
12
+ from fiqus.data.DataRoxieParser import FiQuSGeometry
12
13
  from fiqus.data.DataRoxieParser import Corner
13
14
  from fiqus.data.DataRoxieParser import Coord
14
-
15
+ import re
15
16
 
16
17
  class Geometry:
17
- def __init__(self, data: dF.FDM() = None, geom: dF.FiQuSGeometry() = None,
18
+ def __init__(self, data: dF.FDM() = None, geom: FiQuSGeometry() = None,
18
19
  geom_folder: str = None, verbose: bool = False):
19
20
  """
20
21
  Class to generate geometry
@@ -23,7 +24,7 @@ class Geometry:
23
24
  :param verbose: If True more information is printed in python console.
24
25
  """
25
26
  self.data: dF.FDM() = data
26
- self.geom: dF.RoxieData() = geom.Roxie_Data
27
+ self.geom: FiQuSGeometry() = geom.Roxie_Data
27
28
  self.geom_folder = geom_folder
28
29
  self.verbose: bool = verbose
29
30
 
@@ -121,7 +122,7 @@ class Geometry:
121
122
  gmsh.open(os.path.join(f'{self.model_file}_{run_type}.brep'))
122
123
 
123
124
  def saveAuxiliaryFile(self, run_type):
124
- Util.write_data_to_yaml(f'{self.model_file}_{run_type}.aux', self.md.dict())
125
+ Util.write_data_to_yaml(f'{self.model_file}_{run_type}.aux', self.md.model_dump())
125
126
 
126
127
  @staticmethod
127
128
  def findMidLayerPoint(bc_current, bc_next, center, mean_rad):
@@ -4158,7 +4158,7 @@ class Geometry(Base):
4158
4158
  self.geometry_data_file, Pancake3DGeometry
4159
4159
  )
4160
4160
 
4161
- if previousGeo.dict() != self.geo.dict():
4161
+ if previousGeo.model_dump() != self.geo.model_dump():
4162
4162
  raise ValueError(
4163
4163
  "Geometry data has been changed. Please regenerate the geometry or load"
4164
4164
  " the previous geometry data."
@@ -1,6 +1,7 @@
1
1
  import os
2
2
  import timeit
3
3
  from pathlib import Path
4
+ import subprocess
4
5
 
5
6
  import gmsh
6
7
 
@@ -17,6 +18,7 @@ class RunGetdpCCT:
17
18
  :param fdm: FiQuS data model
18
19
  :param verbose: If True more information is printed in python console.
19
20
  """
21
+ self.fdm = fdm
20
22
  self.cctdm = fdm.magnet
21
23
  self.GetDP_path = GetDP_path
22
24
  self.model_folder = os.path.join(os.getcwd())
@@ -28,6 +30,7 @@ class RunGetdpCCT:
28
30
  self.gu = GmshUtils(self.model_folder, self.verbose)
29
31
  self.gu.initialize(verbosity_Gmsh=fdm.run.verbosity_Gmsh)
30
32
  self.pos_names = []
33
+ self.call_method = 'subprocess'
31
34
  # for variable, volume, file_ext in zip(self.cctdm.solve.variables, self.cctdm.solve.volumes, self.cctdm.solve.file_exts):
32
35
  # self.pos_names.append(f'{variable}_{volume}.{file_ext}')
33
36
 
@@ -37,7 +40,7 @@ class RunGetdpCCT:
37
40
  start_time = timeit.default_timer()
38
41
  if self.verbose:
39
42
  print('Assembling pro file')
40
- self.ap.assemble_combined_pro(template=self.cctdm.solve.pro_template, rm=self.cctrm, dm=self.cctdm)
43
+ self.ap.assemble_combined_pro(template=self.cctdm.solve.pro_template, rm=self.cctrm, dm=self.cctdm, mf=f"{os.path.join(self.mesh_folder, self.magnet_name)}.msh")
41
44
  if self.verbose:
42
45
  print(f'Assembling Pro File Took {timeit.default_timer() - start_time:.2f} s')
43
46
 
@@ -55,9 +58,15 @@ class RunGetdpCCT:
55
58
  if self.verbose:
56
59
  print('Solving Started !!!')
57
60
  start_time = timeit.default_timer()
58
- getdp_binary = self.GetDP_path
59
- gmsh.onelab.run(f"{self.magnet_name}", f"{getdp_binary} {os.path.join(self.model_folder, self.magnet_name)}.pro {command} -msh {os.path.join(self.mesh_folder, self.magnet_name)}.msh")
60
- gmsh.onelab.setChanged("GetDP", 0)
61
+ mpi_prefix = []
62
+ res = 'MagDynAVComplex'
63
+ post_op = 'Get_LocalFields'
64
+
65
+ if self.call_method == 'onelab':
66
+ gmsh.onelab.run(f"{self.magnet_name}", f"{self.GetDP_path} {os.path.join(self.model_folder, self.magnet_name)}.pro {command} -msh {os.path.join(self.mesh_folder, self.magnet_name)}.msh")
67
+ elif self.call_method == 'subprocess':
68
+ command = ["-solve", res, "-v2", "-pos", post_op, "-verbose", str(self.fdm.run.verbosity_GetDP), '-sub_pc_type lu', '-pc_type lu', '-pc_factor_mat_solver_type mumps']
69
+ subprocess.call(mpi_prefix + [f"{self.GetDP_path}", f"{os.path.join(self.model_folder, self.magnet_name)}.pro"] + command + [f"-msh {os.path.join(self.mesh_folder, self.magnet_name)}.msh"])
61
70
 
62
71
  self.model_file = os.path.join(self.model_folder, model_file)
63
72
  if self.verbose: