fiqus 2024.6.0__py3-none-any.whl → 2024.12.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 (69) hide show
  1. fiqus/MainFiQuS.py +290 -134
  2. fiqus/data/DataConductor.py +301 -301
  3. fiqus/data/DataFiQuS.py +128 -84
  4. fiqus/data/DataFiQuSCCT.py +150 -150
  5. fiqus/data/DataFiQuSConductor.py +84 -84
  6. fiqus/data/DataFiQuSConductorAC_Strand.py +565 -565
  7. fiqus/data/DataFiQuSMultipole.py +716 -42
  8. fiqus/data/DataFiQuSPancake3D.py +737 -278
  9. fiqus/data/DataMultipole.py +180 -15
  10. fiqus/data/DataRoxieParser.py +90 -51
  11. fiqus/data/DataSettings.py +121 -0
  12. fiqus/data/DataWindingsCCT.py +37 -37
  13. fiqus/data/RegionsModelFiQuS.py +18 -6
  14. fiqus/geom_generators/GeometryCCT.py +905 -905
  15. fiqus/geom_generators/GeometryConductorAC_Strand.py +1391 -1391
  16. fiqus/geom_generators/GeometryMultipole.py +1827 -227
  17. fiqus/geom_generators/GeometryPancake3D.py +316 -117
  18. fiqus/geom_generators/GeometryPancake3DUtils.py +549 -0
  19. fiqus/getdp_runners/RunGetdpCCT.py +4 -4
  20. fiqus/getdp_runners/RunGetdpConductorAC_Strand.py +201 -201
  21. fiqus/getdp_runners/RunGetdpMultipole.py +115 -42
  22. fiqus/getdp_runners/RunGetdpPancake3D.py +28 -6
  23. fiqus/mains/MainCCT.py +2 -2
  24. fiqus/mains/MainConductorAC_Strand.py +132 -132
  25. fiqus/mains/MainMultipole.py +113 -62
  26. fiqus/mains/MainPancake3D.py +63 -23
  27. fiqus/mesh_generators/MeshCCT.py +209 -209
  28. fiqus/mesh_generators/MeshConductorAC_Strand.py +656 -656
  29. fiqus/mesh_generators/MeshMultipole.py +1243 -181
  30. fiqus/mesh_generators/MeshPancake3D.py +275 -192
  31. fiqus/parsers/ParserCOND.py +825 -0
  32. fiqus/parsers/ParserDAT.py +16 -16
  33. fiqus/parsers/ParserGetDPOnSection.py +212 -212
  34. fiqus/parsers/ParserGetDPTimeTable.py +134 -134
  35. fiqus/parsers/ParserMSH.py +53 -53
  36. fiqus/parsers/ParserPOS.py +214 -214
  37. fiqus/parsers/ParserRES.py +142 -142
  38. fiqus/plotters/PlotPythonCCT.py +133 -133
  39. fiqus/plotters/PlotPythonConductorAC.py +855 -840
  40. fiqus/plotters/PlotPythonMultipole.py +18 -18
  41. fiqus/post_processors/PostProcessCCT.py +440 -440
  42. fiqus/post_processors/PostProcessConductorAC.py +49 -49
  43. fiqus/post_processors/PostProcessMultipole.py +353 -229
  44. fiqus/post_processors/PostProcessPancake3D.py +8 -13
  45. fiqus/pre_processors/PreProcessCCT.py +175 -175
  46. fiqus/pro_assemblers/ProAssembler.py +14 -6
  47. fiqus/pro_material_functions/ironBHcurves.pro +246 -246
  48. fiqus/pro_templates/combined/CCT_template.pro +274 -274
  49. fiqus/pro_templates/combined/ConductorAC_template.pro +1025 -1025
  50. fiqus/pro_templates/combined/Multipole_template.pro +1694 -126
  51. fiqus/pro_templates/combined/Pancake3D_template.pro +2294 -1103
  52. fiqus/pro_templates/combined/TSA_materials.pro +162 -0
  53. fiqus/pro_templates/combined/materials.pro +36 -18
  54. fiqus/utils/Utils.py +508 -110
  55. fiqus/utils/update_data_settings.py +33 -0
  56. fiqus-2024.12.0.dist-info/METADATA +130 -0
  57. fiqus-2024.12.0.dist-info/RECORD +84 -0
  58. {fiqus-2024.6.0.dist-info → fiqus-2024.12.0.dist-info}/WHEEL +1 -1
  59. tests/test_FiQuS.py +1 -1
  60. tests/test_geometry_generators.py +101 -2
  61. tests/test_mesh_generators.py +154 -1
  62. tests/test_solvers.py +115 -21
  63. tests/utils/fiqus_test_classes.py +85 -21
  64. tests/utils/generate_reference_files_ConductorAC.py +57 -57
  65. tests/utils/generate_reference_files_Pancake3D.py +4 -5
  66. tests/utils/helpers.py +97 -97
  67. fiqus-2024.6.0.dist-info/METADATA +0 -103
  68. fiqus-2024.6.0.dist-info/RECORD +0 -79
  69. {fiqus-2024.6.0.dist-info → fiqus-2024.12.0.dist-info}/top_level.txt +0 -0
@@ -1,49 +1,49 @@
1
- import os
2
- import numpy as np
3
- import re
4
- import matplotlib.pyplot as plt
5
- import matplotlib.pylab as pl
6
- from matplotlib.animation import FuncAnimation
7
- import pandas as pd
8
- from scipy import integrate, interpolate
9
- from typing import (List, Literal, Callable)
10
- from pydantic import BaseModel
11
-
12
- from fiqus.utils.Utils import FilesAndFolders as Util
13
- from fiqus.data.DataFiQuSConductorAC_Strand import CACStrandSolve, CACStrandPostproc, CACStrandMesh, CACStrandGeometry
14
- from fiqus.plotters.PlotPythonConductorAC import PlotPython, SimulationData
15
-
16
-
17
- class PostProcess:
18
- """
19
- This class loads and stores the data from a simulation and can apply various postprocessing operations on the data.
20
- The simulation data is saved as a SimulationData object.
21
- """
22
- def __init__(self, fdm, model_data_output_path) -> None:
23
- self.fdm = fdm
24
- self.model_data_output_path = model_data_output_path
25
- self.geometry_name = f"Geometry_{self.fdm.run.geometry}"
26
- self.mesh_name = f"Mesh_{self.fdm.run.mesh}"
27
- self.solution_name = f"Solution_{self.fdm.run.solution}"
28
-
29
- self.simulation_data = SimulationData(model_data_output_path, self.geometry_name, self.mesh_name, self.solution_name)
30
-
31
- def plot_instantaneous_loss(self):
32
- print("Total loss: ", self.simulation_data.cumulative_power["TotalLoss"].iloc[-1])
33
- print("Total filament loss: ", self.simulation_data.cumulative_power["FilamentLoss"].iloc[-1])
34
- print("Total coupling loss: ", self.simulation_data.cumulative_power["CouplingLoss"].iloc[-1])
35
- print("Total eddy loss: ", self.simulation_data.cumulative_power["EddyLoss"].iloc[-1])
36
- plot_options = self.fdm.magnet.postproc.plot_instantaneous_power
37
- self.simulation_data.plot_instantaneous_power(
38
- show=plot_options.show,
39
- title=plot_options.title,
40
- save_plot=plot_options.save,
41
- save_folder_path=os.path.join(self.model_data_output_path, self.geometry_name, self.mesh_name, self.solution_name),
42
- save_file_name=plot_options.save_file_name,
43
- overwrite=self.fdm.run.overwrite
44
- )
45
-
46
-
47
-
48
-
49
-
1
+ import os
2
+ import numpy as np
3
+ import re
4
+ import matplotlib.pyplot as plt
5
+ import matplotlib.pylab as pl
6
+ from matplotlib.animation import FuncAnimation
7
+ import pandas as pd
8
+ from scipy import integrate, interpolate
9
+ from typing import (List, Literal, Callable)
10
+ from pydantic import BaseModel
11
+
12
+ from fiqus.utils.Utils import FilesAndFolders as Util
13
+ from fiqus.data.DataFiQuSConductorAC_Strand import CACStrandSolve, CACStrandPostproc, CACStrandMesh, CACStrandGeometry
14
+ from fiqus.plotters.PlotPythonConductorAC import PlotPython, SimulationData
15
+
16
+
17
+ class PostProcess:
18
+ """
19
+ This class loads and stores the data from a simulation and can apply various postprocessing operations on the data.
20
+ The simulation data is saved as a SimulationData object.
21
+ """
22
+ def __init__(self, fdm, model_data_output_path) -> None:
23
+ self.fdm = fdm
24
+ self.model_data_output_path = model_data_output_path
25
+ self.geometry_name = f"Geometry_{self.fdm.run.geometry}"
26
+ self.mesh_name = f"Mesh_{self.fdm.run.mesh}"
27
+ self.solution_name = f"Solution_{self.fdm.run.solution}"
28
+
29
+ self.simulation_data = SimulationData(model_data_output_path, self.geometry_name, self.mesh_name, self.solution_name)
30
+
31
+ def plot_instantaneous_loss(self):
32
+ print("Total loss: ", self.simulation_data.cumulative_power["TotalLoss"].iloc[-1])
33
+ print("Total filament loss: ", self.simulation_data.cumulative_power["FilamentLoss"].iloc[-1])
34
+ print("Total coupling loss: ", self.simulation_data.cumulative_power["CouplingLoss"].iloc[-1])
35
+ print("Total eddy loss: ", self.simulation_data.cumulative_power["EddyLoss"].iloc[-1])
36
+ plot_options = self.fdm.magnet.postproc.plot_instantaneous_power
37
+ self.simulation_data.plot_instantaneous_power(
38
+ show=plot_options.show,
39
+ title=plot_options.title,
40
+ save_plot=plot_options.save,
41
+ save_folder_path=os.path.join(self.model_data_output_path, self.geometry_name, self.mesh_name, self.solution_name),
42
+ save_file_name=plot_options.save_file_name,
43
+ overwrite=self.fdm.run.overwrite
44
+ )
45
+
46
+
47
+
48
+
49
+