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.
- fiqus/MainFiQuS.py +24 -28
- fiqus/data/DataConductor.py +350 -301
- fiqus/data/DataFiQuS.py +42 -115
- fiqus/data/DataFiQuSCCT.py +150 -150
- fiqus/data/DataFiQuSConductor.py +97 -84
- fiqus/data/DataFiQuSConductorAC_Strand.py +701 -565
- fiqus/data/DataModelCommon.py +439 -0
- fiqus/data/DataMultipole.py +0 -13
- fiqus/data/DataRoxieParser.py +7 -0
- fiqus/data/DataWindingsCCT.py +37 -37
- fiqus/data/RegionsModelFiQuS.py +61 -104
- fiqus/geom_generators/GeometryCCT.py +904 -905
- fiqus/geom_generators/GeometryConductorAC_Strand.py +1863 -1391
- fiqus/geom_generators/GeometryMultipole.py +5 -4
- fiqus/geom_generators/GeometryPancake3D.py +1 -1
- fiqus/getdp_runners/RunGetdpCCT.py +13 -4
- fiqus/getdp_runners/RunGetdpConductorAC_Strand.py +341 -201
- fiqus/getdp_runners/RunGetdpPancake3D.py +2 -2
- fiqus/mains/MainConductorAC_Strand.py +141 -133
- fiqus/mains/MainMultipole.py +6 -5
- fiqus/mains/MainPancake3D.py +3 -4
- fiqus/mesh_generators/MeshCCT.py +209 -209
- fiqus/mesh_generators/MeshConductorAC_Strand.py +709 -656
- fiqus/mesh_generators/MeshMultipole.py +43 -46
- fiqus/parsers/ParserDAT.py +16 -16
- fiqus/parsers/ParserGetDPOnSection.py +212 -212
- fiqus/parsers/ParserGetDPTimeTable.py +134 -134
- fiqus/parsers/ParserMSH.py +53 -53
- fiqus/parsers/ParserPOS.py +214 -214
- fiqus/parsers/ParserRES.py +142 -142
- fiqus/plotters/PlotPythonCCT.py +133 -133
- fiqus/plotters/PlotPythonConductorAC.py +1079 -855
- fiqus/plotters/PlotPythonMultipole.py +18 -18
- fiqus/post_processors/PostProcessCCT.py +444 -440
- fiqus/post_processors/PostProcessConductorAC.py +997 -49
- fiqus/post_processors/PostProcessMultipole.py +19 -19
- fiqus/pre_processors/PreProcessCCT.py +175 -175
- fiqus/pro_material_functions/ironBHcurves.pro +246 -246
- fiqus/pro_templates/combined/CCT_template.pro +275 -274
- fiqus/pro_templates/combined/ConductorAC_template.pro +1474 -1025
- fiqus/pro_templates/combined/Multipole_template.pro +5 -5
- fiqus/utils/Utils.py +12 -7
- {fiqus-2025.2.0.dist-info → fiqus-2025.11.0.dist-info}/METADATA +65 -63
- fiqus-2025.11.0.dist-info/RECORD +86 -0
- {fiqus-2025.2.0.dist-info → fiqus-2025.11.0.dist-info}/WHEEL +1 -1
- tests/test_geometry_generators.py +4 -0
- tests/test_mesh_generators.py +5 -0
- tests/test_solvers.py +41 -4
- tests/utils/fiqus_test_classes.py +15 -6
- tests/utils/generate_reference_files_ConductorAC.py +57 -57
- tests/utils/helpers.py +97 -97
- fiqus-2025.2.0.dist-info/RECORD +0 -85
- {fiqus-2025.2.0.dist-info → fiqus-2025.11.0.dist-info}/LICENSE.txt +0 -0
- {fiqus-2025.2.0.dist-info → fiqus-2025.11.0.dist-info}/top_level.txt +0 -0
fiqus/MainFiQuS.py
CHANGED
|
@@ -19,7 +19,7 @@ from fiqus.utils.Utils import CheckForExceptions as Check
|
|
|
19
19
|
from fiqus.utils.Utils import create_json_schema
|
|
20
20
|
from fiqus.utils.Utils import get_data_settings
|
|
21
21
|
from fiqus.utils.Utils import initialize_logger
|
|
22
|
-
from fiqus.data.DataFiQuS import FDM
|
|
22
|
+
from fiqus.data.DataFiQuS import FDM, SolveDumpDataModel
|
|
23
23
|
from fiqus.data.DataSettings import DataSettings
|
|
24
24
|
from fiqus.mains.MainCCT import MainCCT
|
|
25
25
|
from fiqus.mains.MainMultipole import MainMultipole
|
|
@@ -86,22 +86,10 @@ class MainFiQuS:
|
|
|
86
86
|
# Initialize Main object
|
|
87
87
|
if self.fdm.magnet.type == "CCT_straight":
|
|
88
88
|
self.main_magnet = MainCCT(fdm=self.fdm, verbose=verbose)
|
|
89
|
-
elif self.fdm.magnet.type == "CWS":
|
|
90
|
-
self.main_magnet = MainCWS(
|
|
91
|
-
fdm=self.fdm,
|
|
92
|
-
inputs_folder_path=pathlib.Path(input_file_path).parent,
|
|
93
|
-
verbose=self.fdm.run.verbosity_FiQuS,
|
|
94
|
-
)
|
|
95
89
|
elif self.fdm.magnet.type == "Pancake3D":
|
|
96
90
|
self.main_magnet = MainPancake3D(fdm=self.fdm, verbose=verbose)
|
|
97
91
|
elif self.fdm.magnet.type == "CACStrand":
|
|
98
92
|
self.main_magnet = MainConductorAC_Strand(fdm=self.fdm, inputs_folder_path=pathlib.Path(input_file_path).parent, outputs_folder_path=model_folder, verbose=verbose)
|
|
99
|
-
elif self.fdm.magnet.type == "CACRutherford":
|
|
100
|
-
self.main_magnet = MainConductorAC_Rutherford(fdm=self.fdm, inputs_folder_path=pathlib.Path(input_file_path).parent, verbose=verbose)
|
|
101
|
-
elif self.fdm.magnet.type == "Racetrack":
|
|
102
|
-
self.main_magnet = MainRacetrack(fdm=self.fdm, verbose=verbose)
|
|
103
|
-
elif self.fdm.magnet.type == "Racetrack3D":
|
|
104
|
-
self.main_magnet = MainRacetrack3D(fdm=self.fdm, inputs_folder_path=pathlib.Path(input_file_path).parent, verbose=verbose)
|
|
105
93
|
elif self.fdm.magnet.type == "multipole":
|
|
106
94
|
self.file_name = os.path.basename(input_file_path)[:-5]
|
|
107
95
|
if not self.fdm.magnet.geometry.geom_file_path:
|
|
@@ -230,7 +218,7 @@ class MainFiQuS:
|
|
|
230
218
|
else: # post_process_getdp_only or post_process_python_only or plot_python
|
|
231
219
|
required_folders = []
|
|
232
220
|
|
|
233
|
-
|
|
221
|
+
|
|
234
222
|
|
|
235
223
|
self.main_magnet.geom_folder = _check_and_generate_path(folder_type="Geometry")
|
|
236
224
|
if not self.fdm.run.type in ["geometry_only"]:
|
|
@@ -250,7 +238,7 @@ class MainFiQuS:
|
|
|
250
238
|
]:
|
|
251
239
|
Util.write_data_model_to_yaml(
|
|
252
240
|
os.path.join(self.main_magnet.geom_folder, "geometry.yaml"),
|
|
253
|
-
fdm.geometry,
|
|
241
|
+
self.fdm.magnet.geometry,
|
|
254
242
|
by_alias=True,
|
|
255
243
|
with_comments=True,
|
|
256
244
|
)
|
|
@@ -262,7 +250,7 @@ class MainFiQuS:
|
|
|
262
250
|
]:
|
|
263
251
|
Util.write_data_model_to_yaml(
|
|
264
252
|
os.path.join(self.main_magnet.mesh_folder, "mesh.yaml"),
|
|
265
|
-
fdm.mesh,
|
|
253
|
+
self.fdm.magnet.mesh,
|
|
266
254
|
by_alias=True,
|
|
267
255
|
with_comments=True,
|
|
268
256
|
)
|
|
@@ -272,11 +260,20 @@ class MainFiQuS:
|
|
|
272
260
|
"solve_with_post_process_python",
|
|
273
261
|
"solve_only",
|
|
274
262
|
"post_process",
|
|
275
|
-
"plot_python"
|
|
263
|
+
"plot_python",
|
|
264
|
+
"postprocess_veusz"
|
|
276
265
|
]:
|
|
266
|
+
solve_dump_data = SolveDumpDataModel(
|
|
267
|
+
solve=self.fdm.magnet.solve,
|
|
268
|
+
circuit=self.fdm.circuit,
|
|
269
|
+
power_supply=self.fdm.power_supply,
|
|
270
|
+
quench_protection=self.fdm.quench_protection,
|
|
271
|
+
quench_detection=self.fdm.quench_detection,
|
|
272
|
+
conductors=self.fdm.conductors
|
|
273
|
+
)
|
|
277
274
|
Util.write_data_model_to_yaml(
|
|
278
275
|
os.path.join(self.main_magnet.solution_folder, "solve.yaml"),
|
|
279
|
-
|
|
276
|
+
solve_dump_data,
|
|
280
277
|
by_alias=True,
|
|
281
278
|
with_comments=True,
|
|
282
279
|
)
|
|
@@ -287,11 +284,12 @@ class MainFiQuS:
|
|
|
287
284
|
"post_process_python_only",
|
|
288
285
|
"post_process_getdp_only",
|
|
289
286
|
"post_process",
|
|
287
|
+
"postprocess_veusz",
|
|
290
288
|
"plot_python"
|
|
291
289
|
]:
|
|
292
290
|
Util.write_data_model_to_yaml(
|
|
293
291
|
os.path.join(self.main_magnet.solution_folder, "postproc.yaml"),
|
|
294
|
-
fdm.postproc,
|
|
292
|
+
self.fdm.magnet.postproc,
|
|
295
293
|
by_alias=True,
|
|
296
294
|
with_comments=True,
|
|
297
295
|
)
|
|
@@ -337,6 +335,7 @@ class MainFiQuS:
|
|
|
337
335
|
except:
|
|
338
336
|
self.logger.warning("Run log could not be completed.")
|
|
339
337
|
|
|
338
|
+
|
|
340
339
|
def build_magnet(self):
|
|
341
340
|
"""
|
|
342
341
|
Main method to build magnets, i.e. to run various fiqus run types and magnet types
|
|
@@ -389,6 +388,8 @@ class MainFiQuS:
|
|
|
389
388
|
self.summary["solution_time"] = (
|
|
390
389
|
self.main_magnet.solve_and_postprocess_getdp(gui=self.main_magnet.fdm.run.launch_gui)
|
|
391
390
|
)
|
|
391
|
+
elif self.fdm.run.type == "postprocess_veusz":
|
|
392
|
+
self.main_magnet.post_process_veusz(gui=self.main_magnet.fdm.run.launch_gui)
|
|
392
393
|
elif self.fdm.run.type == "post_process_getdp_only":
|
|
393
394
|
self.main_magnet.post_process_getdp(gui=self.main_magnet.fdm.run.launch_gui)
|
|
394
395
|
elif self.fdm.run.type == "post_process_python_only":
|
|
@@ -405,15 +406,10 @@ class MainFiQuS:
|
|
|
405
406
|
self.main_magnet.batch_post_process_python()
|
|
406
407
|
os.chdir(self.start_folder)
|
|
407
408
|
|
|
408
|
-
if self.file_name:
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
# content = (f"{mesh_par.mesh_coil.SizeMin} {mesh_par.mesh_coil.SizeMax} {mesh_par.mesh_iron.SizeMin} {mesh_par.mesh_iron.SizeMax} "
|
|
413
|
-
# f"{self.summary['solution_time']} {self.summary['overall_error']} {self.summary['overall_error'] * 0.999 + self.summary['solution_time'] * 0.001} "
|
|
414
|
-
# f"{self.summary['SJ']} {self.summary['SICN']} {self.summary['SIGE']} {self.summary['Gamma']} "
|
|
415
|
-
# f"{self.summary['nodes']} {self.summary['minimum_diff']} {self.summary['maximum_diff']}\n")
|
|
416
|
-
# f.writelines(content)
|
|
409
|
+
if self.file_name:
|
|
410
|
+
file_path = os.path.join(self.wrk_folder, f"{self.file_name}.json")
|
|
411
|
+
with open(file_path, 'w', encoding='utf-8') as f:
|
|
412
|
+
json.dump(self.summary, f, indent=2)
|
|
417
413
|
|
|
418
414
|
@staticmethod
|
|
419
415
|
def add_to_run_log(path_to_csv, run_log_row):
|