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
|
@@ -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:
|
|
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:
|
|
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.
|
|
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.
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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:
|