fiqus 2025.10.0__py3-none-any.whl → 2025.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.
- fiqus/MainFiQuS.py +24 -17
- fiqus/data/DataConductor.py +9 -1
- fiqus/data/DataFiQuS.py +3 -3
- fiqus/data/DataFiQuSConductorAC_Rutherford.py +569 -0
- fiqus/data/DataFiQuSHomogenizedConductor.py +478 -0
- fiqus/geom_generators/GeometryConductorAC_Rutherford.py +706 -0
- fiqus/geom_generators/GeometryConductorAC_Strand_RutherfordCopy.py +1848 -0
- fiqus/geom_generators/GeometryHomogenizedConductor.py +183 -0
- fiqus/getdp_runners/RunGetdpConductorAC_Rutherford.py +200 -0
- fiqus/getdp_runners/RunGetdpHomogenizedConductor.py +178 -0
- fiqus/mains/MainConductorAC_Rutherford.py +76 -0
- fiqus/mains/MainHomogenizedConductor.py +112 -0
- fiqus/mesh_generators/MeshConductorAC_Rutherford.py +235 -0
- fiqus/mesh_generators/MeshConductorAC_Strand_RutherfordCopy.py +718 -0
- fiqus/mesh_generators/MeshHomogenizedConductor.py +229 -0
- fiqus/post_processors/PostProcessAC_Rutherford.py +142 -0
- fiqus/post_processors/PostProcessHomogenizedConductor.py +114 -0
- fiqus/pro_templates/combined/ConductorACRutherford_template.pro +1742 -0
- fiqus/pro_templates/combined/HomogenizedConductor_template.pro +1663 -0
- {fiqus-2025.10.0.dist-info → fiqus-2025.12.0.dist-info}/METADATA +6 -5
- {fiqus-2025.10.0.dist-info → fiqus-2025.12.0.dist-info}/RECORD +27 -11
- tests/test_geometry_generators.py +20 -0
- tests/test_mesh_generators.py +38 -0
- tests/test_solvers.py +100 -0
- {fiqus-2025.10.0.dist-info → fiqus-2025.12.0.dist-info}/LICENSE.txt +0 -0
- {fiqus-2025.10.0.dist-info → fiqus-2025.12.0.dist-info}/WHEEL +0 -0
- {fiqus-2025.10.0.dist-info → fiqus-2025.12.0.dist-info}/top_level.txt +0 -0
fiqus/MainFiQuS.py
CHANGED
|
@@ -19,12 +19,14 @@ 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
|
|
26
26
|
from fiqus.mains.MainPancake3D import MainPancake3D
|
|
27
27
|
from fiqus.mains.MainConductorAC_Strand import MainConductorAC_Strand
|
|
28
|
+
from fiqus.mains.MainHomogenizedConductor import MainHomogenizedConductor
|
|
29
|
+
from fiqus.mains.MainConductorAC_Rutherford import MainConductorAC_Rutherford
|
|
28
30
|
|
|
29
31
|
class MainFiQuS:
|
|
30
32
|
"""
|
|
@@ -86,22 +88,14 @@ class MainFiQuS:
|
|
|
86
88
|
# Initialize Main object
|
|
87
89
|
if self.fdm.magnet.type == "CCT_straight":
|
|
88
90
|
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
91
|
elif self.fdm.magnet.type == "Pancake3D":
|
|
96
92
|
self.main_magnet = MainPancake3D(fdm=self.fdm, verbose=verbose)
|
|
97
93
|
elif self.fdm.magnet.type == "CACStrand":
|
|
98
94
|
self.main_magnet = MainConductorAC_Strand(fdm=self.fdm, inputs_folder_path=pathlib.Path(input_file_path).parent, outputs_folder_path=model_folder, verbose=verbose)
|
|
95
|
+
elif self.fdm.magnet.type == "HomogenizedConductor":
|
|
96
|
+
self.main_magnet = MainHomogenizedConductor(fdm=self.fdm, inputs_folder_path=pathlib.Path(input_file_path).parent, outputs_folder_path=model_folder, verbose=verbose)
|
|
99
97
|
elif self.fdm.magnet.type == "CACRutherford":
|
|
100
98
|
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
99
|
elif self.fdm.magnet.type == "multipole":
|
|
106
100
|
self.file_name = os.path.basename(input_file_path)[:-5]
|
|
107
101
|
if not self.fdm.magnet.geometry.geom_file_path:
|
|
@@ -230,7 +224,7 @@ class MainFiQuS:
|
|
|
230
224
|
else: # post_process_getdp_only or post_process_python_only or plot_python
|
|
231
225
|
required_folders = []
|
|
232
226
|
|
|
233
|
-
|
|
227
|
+
|
|
234
228
|
|
|
235
229
|
self.main_magnet.geom_folder = _check_and_generate_path(folder_type="Geometry")
|
|
236
230
|
if not self.fdm.run.type in ["geometry_only"]:
|
|
@@ -250,7 +244,7 @@ class MainFiQuS:
|
|
|
250
244
|
]:
|
|
251
245
|
Util.write_data_model_to_yaml(
|
|
252
246
|
os.path.join(self.main_magnet.geom_folder, "geometry.yaml"),
|
|
253
|
-
fdm.geometry,
|
|
247
|
+
self.fdm.magnet.geometry,
|
|
254
248
|
by_alias=True,
|
|
255
249
|
with_comments=True,
|
|
256
250
|
)
|
|
@@ -262,7 +256,7 @@ class MainFiQuS:
|
|
|
262
256
|
]:
|
|
263
257
|
Util.write_data_model_to_yaml(
|
|
264
258
|
os.path.join(self.main_magnet.mesh_folder, "mesh.yaml"),
|
|
265
|
-
fdm.mesh,
|
|
259
|
+
self.fdm.magnet.mesh,
|
|
266
260
|
by_alias=True,
|
|
267
261
|
with_comments=True,
|
|
268
262
|
)
|
|
@@ -272,11 +266,20 @@ class MainFiQuS:
|
|
|
272
266
|
"solve_with_post_process_python",
|
|
273
267
|
"solve_only",
|
|
274
268
|
"post_process",
|
|
275
|
-
"plot_python"
|
|
269
|
+
"plot_python",
|
|
270
|
+
"postprocess_veusz"
|
|
276
271
|
]:
|
|
272
|
+
solve_dump_data = SolveDumpDataModel(
|
|
273
|
+
solve=self.fdm.magnet.solve,
|
|
274
|
+
circuit=self.fdm.circuit,
|
|
275
|
+
power_supply=self.fdm.power_supply,
|
|
276
|
+
quench_protection=self.fdm.quench_protection,
|
|
277
|
+
quench_detection=self.fdm.quench_detection,
|
|
278
|
+
conductors=self.fdm.conductors
|
|
279
|
+
)
|
|
277
280
|
Util.write_data_model_to_yaml(
|
|
278
281
|
os.path.join(self.main_magnet.solution_folder, "solve.yaml"),
|
|
279
|
-
|
|
282
|
+
solve_dump_data,
|
|
280
283
|
by_alias=True,
|
|
281
284
|
with_comments=True,
|
|
282
285
|
)
|
|
@@ -287,11 +290,12 @@ class MainFiQuS:
|
|
|
287
290
|
"post_process_python_only",
|
|
288
291
|
"post_process_getdp_only",
|
|
289
292
|
"post_process",
|
|
293
|
+
"postprocess_veusz",
|
|
290
294
|
"plot_python"
|
|
291
295
|
]:
|
|
292
296
|
Util.write_data_model_to_yaml(
|
|
293
297
|
os.path.join(self.main_magnet.solution_folder, "postproc.yaml"),
|
|
294
|
-
fdm.postproc,
|
|
298
|
+
self.fdm.magnet.postproc,
|
|
295
299
|
by_alias=True,
|
|
296
300
|
with_comments=True,
|
|
297
301
|
)
|
|
@@ -337,6 +341,7 @@ class MainFiQuS:
|
|
|
337
341
|
except:
|
|
338
342
|
self.logger.warning("Run log could not be completed.")
|
|
339
343
|
|
|
344
|
+
|
|
340
345
|
def build_magnet(self):
|
|
341
346
|
"""
|
|
342
347
|
Main method to build magnets, i.e. to run various fiqus run types and magnet types
|
|
@@ -389,6 +394,8 @@ class MainFiQuS:
|
|
|
389
394
|
self.summary["solution_time"] = (
|
|
390
395
|
self.main_magnet.solve_and_postprocess_getdp(gui=self.main_magnet.fdm.run.launch_gui)
|
|
391
396
|
)
|
|
397
|
+
elif self.fdm.run.type == "postprocess_veusz":
|
|
398
|
+
self.main_magnet.post_process_veusz(gui=self.main_magnet.fdm.run.launch_gui)
|
|
392
399
|
elif self.fdm.run.type == "post_process_getdp_only":
|
|
393
400
|
self.main_magnet.post_process_getdp(gui=self.main_magnet.fdm.run.launch_gui)
|
|
394
401
|
elif self.fdm.run.type == "post_process_python_only":
|
fiqus/data/DataConductor.py
CHANGED
|
@@ -328,6 +328,14 @@ class Rectangular(BaseModel):
|
|
|
328
328
|
# superconductor: MaterialSuperconductor = MaterialSuperconductor()
|
|
329
329
|
# stabilizer: MaterialStabilizer = MaterialStabilizer()
|
|
330
330
|
|
|
331
|
+
class Homogenized(BaseModel):
|
|
332
|
+
"""
|
|
333
|
+
Level 2: Class for homogenized strand parameters, to be used in the Rutherford cable model
|
|
334
|
+
"""
|
|
335
|
+
type: Literal["Homogenized"]
|
|
336
|
+
|
|
337
|
+
# Strand diameter (used in the geometry step)
|
|
338
|
+
diameter: Optional[float] = Field(default=None, description="Undeformed round strand diameter. Used in the geometry step if keep_strand_area==true, the strand is deformed while preserving its surface area. Not used otherwise.")
|
|
331
339
|
|
|
332
340
|
|
|
333
341
|
# ------------------- Conductors ---------------------------#
|
|
@@ -344,7 +352,7 @@ class Conductor(BaseModel):
|
|
|
344
352
|
cable: Union[Rutherford, Mono, Ribbon] = {
|
|
345
353
|
"type": "Rutherford"
|
|
346
354
|
} # TODO: Busbar, Rope, Roebel, CORC, TSTC, CICC
|
|
347
|
-
strand: Union[Round, Rectangular] = {"type": "Round"} # TODO: Tape, WIC
|
|
355
|
+
strand: Union[Round, Rectangular, Homogenized] = {"type": "Round"} # TODO: Tape, WIC
|
|
348
356
|
Jc_fit: Union[ConstantJc, Bottura, CUDI1, CUDI3, Summers, Bordini, Nb3Sn_HFM, BSCCO_2212_LBNL, Ic_A_NbTi, ProDefined] = {
|
|
349
357
|
"type": "CUDI1"
|
|
350
358
|
} # TODO: CUDI other numbers? , Roxie?
|
fiqus/data/DataFiQuS.py
CHANGED
|
@@ -7,8 +7,8 @@ from fiqus.data.DataFiQuSCCT import CCT
|
|
|
7
7
|
from fiqus.data.DataFiQuSMultipole import Multipole
|
|
8
8
|
from fiqus.data.DataFiQuSPancake3D import Pancake3D
|
|
9
9
|
from fiqus.data.DataFiQuSConductorAC_Strand import CACStrand
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
from fiqus.data.DataFiQuSHomogenizedConductor import HomogenizedConductor
|
|
11
|
+
from fiqus.data.DataFiQuSConductorAC_Rutherford import CACRutherford
|
|
12
12
|
|
|
13
13
|
class RunFiQuS(BaseModel):
|
|
14
14
|
"""
|
|
@@ -144,7 +144,7 @@ class FDM(BaseModel):
|
|
|
144
144
|
|
|
145
145
|
general: GeneralFiQuS = GeneralFiQuS()
|
|
146
146
|
run: RunFiQuS = RunFiQuS()
|
|
147
|
-
magnet: Union[Multipole, CCT, Pancake3D, CACStrand] = Field(
|
|
147
|
+
magnet: Union[Multipole, CCT, Pancake3D, CACStrand, HomogenizedConductor, CACRutherford] = Field(
|
|
148
148
|
default=Multipole(), discriminator="type"
|
|
149
149
|
)
|
|
150
150
|
circuit: Circuit_Class = Circuit_Class()
|