fiqus 2025.1.1__py3-none-any.whl → 2025.10.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 +4 -9
- 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/mesh_generators/MeshPancake3D.py +7 -4
- 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 +22 -14
- fiqus/pro_templates/combined/Pancake3D_template.pro +128 -24
- fiqus/utils/Utils.py +12 -7
- {fiqus-2025.1.1.dist-info → fiqus-2025.10.0.dist-info}/METADATA +69 -66
- fiqus-2025.10.0.dist-info/RECORD +86 -0
- {fiqus-2025.1.1.dist-info → fiqus-2025.10.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.1.1.dist-info/RECORD +0 -85
- {fiqus-2025.1.1.dist-info → fiqus-2025.10.0.dist-info}/LICENSE.txt +0 -0
- {fiqus-2025.1.1.dist-info → fiqus-2025.10.0.dist-info}/top_level.txt +0 -0
fiqus/data/RegionsModelFiQuS.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pydantic import BaseModel
|
|
2
|
-
from typing import List, Dict, Union, Optional
|
|
2
|
+
from typing import List, Dict, Union, Optional, Literal
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class Region(BaseModel):
|
|
@@ -12,86 +12,61 @@ class Regions(BaseModel):
|
|
|
12
12
|
numbers: Optional[List[int]] = None
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
class
|
|
15
|
+
class Regions2(BaseModel):
|
|
16
16
|
names: Optional[List[List[str]]] = None
|
|
17
17
|
numbers: Optional[List[List[int]]] = None
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class TwoParBoundaryRegions(Regions2):
|
|
18
21
|
values: Optional[List[List[Union[float, str]]]] = None
|
|
19
22
|
|
|
20
23
|
|
|
21
|
-
class
|
|
22
|
-
|
|
23
|
-
numbers: Optional[List[List[int]]] = None
|
|
24
|
-
value: Optional[List[float]] = None
|
|
24
|
+
class TwoParBoundaryRegions2(Regions):
|
|
25
|
+
values: Optional[List[Union[float, str]]] = None
|
|
25
26
|
|
|
26
27
|
|
|
27
|
-
class
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
class OneParBoundaryRegions(Regions2):
|
|
29
|
+
value: Optional[List[float]] = None
|
|
30
|
+
|
|
31
|
+
class InducedRegions(Regions):
|
|
31
32
|
sigmas: Optional[List[float]] = None
|
|
32
33
|
mu_rs: Optional[List[float]] = None
|
|
33
34
|
|
|
34
35
|
|
|
35
|
-
class InducedRegions
|
|
36
|
-
|
|
37
|
-
numbers: Optional[List[int]] = None
|
|
38
|
-
sigmas: Optional[List[float]] = None
|
|
39
|
-
mu_rs: Optional[List[float]] = None
|
|
36
|
+
class PoweredRegions(InducedRegions):
|
|
37
|
+
currents: Optional[List[float]] = None
|
|
40
38
|
|
|
41
39
|
|
|
42
|
-
class InsulatorRegions(
|
|
43
|
-
|
|
44
|
-
numbers: Optional[List[int]] = None
|
|
45
|
-
sigmas: Optional[List[float]] = None
|
|
46
|
-
mu_rs: Optional[List[float]] = None
|
|
40
|
+
class InsulatorRegions(InducedRegions):
|
|
41
|
+
pass # duplicate class
|
|
47
42
|
|
|
48
43
|
|
|
49
|
-
class IronRegions(
|
|
50
|
-
|
|
51
|
-
numbers: Optional[List[int]] = None
|
|
52
|
-
sigmas: Optional[List[float]] = None
|
|
53
|
-
mu_rs: Optional[List[float]] = None
|
|
44
|
+
class IronRegions(InducedRegions):
|
|
45
|
+
pass # duplicate class
|
|
54
46
|
|
|
55
47
|
|
|
56
|
-
class AirRegion(
|
|
57
|
-
name: Optional[str] = None
|
|
58
|
-
number: Optional[int] = None
|
|
48
|
+
class AirRegion(Region):
|
|
59
49
|
sigma: Optional[float] = None
|
|
60
50
|
mu_r: Optional[float] = None
|
|
61
51
|
|
|
62
52
|
|
|
63
|
-
class AirFarFieldRegions(
|
|
64
|
-
names: Optional[List[str]] = None
|
|
65
|
-
numbers: Optional[List[int]] = None
|
|
53
|
+
class AirFarFieldRegions(Regions):
|
|
66
54
|
radius_in: Optional[float] = None
|
|
67
55
|
radius_out: Optional[float] = None
|
|
68
56
|
|
|
69
57
|
|
|
70
|
-
class NonPermeableSourceRegion(
|
|
71
|
-
|
|
72
|
-
number: Optional[int] = None
|
|
73
|
-
sigma: Optional[float] = None
|
|
74
|
-
mu_r: Optional[float] = None
|
|
58
|
+
class NonPermeableSourceRegion(AirRegion):
|
|
59
|
+
pass # duplicate class
|
|
75
60
|
|
|
76
61
|
|
|
77
|
-
class SourceFreeRegion(
|
|
78
|
-
|
|
79
|
-
number: Optional[int] = None
|
|
80
|
-
sigma: Optional[float] = None
|
|
81
|
-
mu_r: Optional[float] = None
|
|
62
|
+
class SourceFreeRegion(AirRegion):
|
|
63
|
+
pass # duplicate class
|
|
82
64
|
|
|
83
65
|
|
|
84
|
-
class
|
|
85
|
-
vol:
|
|
86
|
-
vol_in: Region = Region() # input terminal volume region
|
|
87
|
-
vol_out: Region = Region() # input terminal volume region
|
|
88
|
-
conductors: Dict[str, List[str]] = {} # conductor types
|
|
66
|
+
class Iron(BaseModel):
|
|
67
|
+
vol: IronRegions = IronRegions() # volume region
|
|
89
68
|
surf: Regions = Regions() # surface region
|
|
90
|
-
|
|
91
|
-
surf_in: Regions = Regions() # input terminal surface region
|
|
92
|
-
surf_out: Regions = Regions() # output terminal surface region
|
|
93
|
-
cochain: Regions = Regions() # winding cochain (cut)
|
|
94
|
-
curve: Regions = Regions() # powered volumes lines
|
|
69
|
+
curves: Dict[str, List[str]] = {} # curves region
|
|
95
70
|
|
|
96
71
|
|
|
97
72
|
class Induced(BaseModel):
|
|
@@ -101,16 +76,17 @@ class Induced(BaseModel):
|
|
|
101
76
|
surf_out: Regions = Regions() # output terminal surface region
|
|
102
77
|
cochain: Regions = Regions() # winding cochain (cut)
|
|
103
78
|
|
|
104
|
-
|
|
105
79
|
class Insulator(BaseModel):
|
|
106
80
|
vol: InsulatorRegions = InsulatorRegions() # volume region
|
|
107
81
|
surf: Regions = Regions() # surface region
|
|
108
82
|
curve: Regions = Regions() # curve region
|
|
109
83
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
84
|
+
class Powered(Induced, Insulator):
|
|
85
|
+
vol: PoweredRegions = PoweredRegions() # volume region
|
|
86
|
+
vol_in: Region = Region() # input terminal volume region
|
|
87
|
+
vol_out: Region = Region() # output terminal volume region
|
|
88
|
+
conductors: Dict[str, List[str]] = {} # conductor types
|
|
89
|
+
surf_insul: Regions = Regions() # turn-to-turn insulation surfaces
|
|
114
90
|
|
|
115
91
|
|
|
116
92
|
class Air(BaseModel):
|
|
@@ -135,26 +111,27 @@ class SourceFree(BaseModel):
|
|
|
135
111
|
vol: SourceFreeRegion = SourceFreeRegion() # volume region
|
|
136
112
|
surf: Region = Region() # surface region
|
|
137
113
|
|
|
114
|
+
class RobinCondition_collar(BaseModel):
|
|
115
|
+
bc: TwoParBoundaryRegions2 = TwoParBoundaryRegions2()
|
|
138
116
|
|
|
139
|
-
class
|
|
117
|
+
class RobinCondition_grouped(BaseModel):
|
|
140
118
|
bc: TwoParBoundaryRegions = TwoParBoundaryRegions()
|
|
141
119
|
groups: Dict[str, List[int]] = {}
|
|
142
120
|
|
|
143
|
-
|
|
144
|
-
class NeumannCondition(BaseModel):
|
|
121
|
+
class NeumannCondition_grouped(BaseModel):
|
|
145
122
|
bc: OneParBoundaryRegions = OneParBoundaryRegions()
|
|
146
123
|
groups: Dict[str, List[int]] = {}
|
|
147
124
|
|
|
148
|
-
|
|
149
|
-
class DirichletCondition(BaseModel):
|
|
125
|
+
class DirichletCondition_grouped(BaseModel):
|
|
150
126
|
bc: OneParBoundaryRegions = OneParBoundaryRegions()
|
|
151
127
|
groups: Dict[str, List[int]] = {}
|
|
152
128
|
|
|
153
129
|
|
|
154
130
|
class ThermalBoundaryConditions(BaseModel):
|
|
155
|
-
temperature:
|
|
156
|
-
heat_flux:
|
|
157
|
-
cooling:
|
|
131
|
+
temperature: DirichletCondition_grouped = DirichletCondition_grouped()
|
|
132
|
+
heat_flux: NeumannCondition_grouped = NeumannCondition_grouped()
|
|
133
|
+
cooling: RobinCondition_grouped = RobinCondition_grouped()
|
|
134
|
+
collar: RobinCondition_collar = RobinCondition_collar()
|
|
158
135
|
|
|
159
136
|
|
|
160
137
|
class SymmetryBoundaryConditions(BaseModel):
|
|
@@ -172,19 +149,27 @@ class InsulationType(BaseModel):
|
|
|
172
149
|
thin_shells: List[List[int]] = []
|
|
173
150
|
layers_material: List[List[str]] = []
|
|
174
151
|
thicknesses: List[List[float]] = []
|
|
152
|
+
correction_factors: List[float] = [] # same correction factor per group. Can be used to scale the thin shell length
|
|
175
153
|
label: List[List[Union[int, None]]] = (
|
|
176
154
|
[]
|
|
177
155
|
) # useful to indicate which quench heater a SS element refers to
|
|
178
156
|
|
|
179
157
|
|
|
180
158
|
class ThinShell(BaseModel):
|
|
181
|
-
groups: Dict[str, List[int]] = {}
|
|
182
|
-
mid_turns_layers_poles: Optional[List[int]] = None
|
|
159
|
+
groups: Dict[str, List[int]] = {} # -> Checkboard convention of the hts
|
|
160
|
+
mid_turns_layers_poles: Optional[List[int]] = None # indices of midlayers between HT, layers and poles
|
|
161
|
+
ts_collar_groups: Dict[str, List[int]] = {} # groups of mid collar thin shells -> Checkboard convention
|
|
162
|
+
ts_pole_groups: Dict[str, List[int]] = {} # groups of mid collar thin shells -> Checkboard convention
|
|
163
|
+
|
|
183
164
|
second_group_is_next: Dict[str, List[int]] = {}
|
|
184
165
|
normals_directed: Dict[str, List[int]] = {}
|
|
185
|
-
|
|
186
|
-
quench_heaters: InsulationType = InsulationType()
|
|
166
|
+
bdry_curves: Dict[Literal["collar", "poles", "outer_collar"], List[int]] = {} # save the boundary curves of a specific region, used in TSA
|
|
187
167
|
|
|
168
|
+
# insulation types, only mid layers
|
|
169
|
+
insulation_types: InsulationType = InsulationType() # todo: merge all types into one @emma, consider dict ?
|
|
170
|
+
quench_heaters: InsulationType = InsulationType()
|
|
171
|
+
collar: InsulationType = InsulationType()
|
|
172
|
+
poles: InsulationType = InsulationType()
|
|
188
173
|
|
|
189
174
|
class PostProc(BaseModel):
|
|
190
175
|
vol: Regions = Regions() # postprocessing volumes general
|
|
@@ -194,47 +179,19 @@ class PostProc(BaseModel):
|
|
|
194
179
|
|
|
195
180
|
|
|
196
181
|
class RegionsModel(BaseModel):
|
|
197
|
-
powered: Dict[str, Powered] = {}
|
|
198
|
-
induced: Dict[str, Induced] = {}
|
|
182
|
+
powered: Dict[str, Powered] = {} #coils
|
|
183
|
+
induced: Dict[str, Induced] = {} #wedges
|
|
199
184
|
insulator: Insulator = Insulator()
|
|
200
|
-
|
|
185
|
+
iron_yoke: Iron = Iron() # iron yoke
|
|
186
|
+
collar: Iron = Iron() # collar is a type of iron region
|
|
187
|
+
ref_mesh: Iron = Iron() # reference mesh
|
|
188
|
+
poles: Iron = Iron() # poles
|
|
189
|
+
|
|
201
190
|
air: Air = Air()
|
|
202
191
|
air_far_field: AirFarField = AirFarField()
|
|
203
|
-
thin_shells: ThinShell = ThinShell()
|
|
192
|
+
thin_shells: ThinShell = ThinShell() # Includes collar thin shells
|
|
204
193
|
projection_points: Region = Region()
|
|
205
194
|
boundaries: BoundaryConditions = BoundaryConditions()
|
|
206
195
|
postproc_th: PostProc = PostProc()
|
|
207
196
|
postproc_em: PostProc = PostProc()
|
|
208
197
|
|
|
209
|
-
|
|
210
|
-
# if __name__ == "__main__":
|
|
211
|
-
# write = True
|
|
212
|
-
# read = False
|
|
213
|
-
#
|
|
214
|
-
# def read_regions(regions_file_name):
|
|
215
|
-
# with open(regions_file_name, 'r') as stream:
|
|
216
|
-
# yaml_str = ruamel.yaml.safe_load(stream)
|
|
217
|
-
# return RegionsModel(**yaml_str)
|
|
218
|
-
#
|
|
219
|
-
# def flist(x):
|
|
220
|
-
# retval = ruamel.yaml.comments.CommentedSeq(x)
|
|
221
|
-
# retval.fa.set_flow_style() # fa -> format attribute
|
|
222
|
-
# return retval
|
|
223
|
-
#
|
|
224
|
-
# if write:
|
|
225
|
-
# model = RegionsModel()
|
|
226
|
-
# model.powered.vol = [1, 2]
|
|
227
|
-
# data_dict = model.dict()
|
|
228
|
-
# yaml = ruamel.yaml.YAML()
|
|
229
|
-
# yaml.default_flow_style = False
|
|
230
|
-
# yaml.emitter.alt_null = 'Null'
|
|
231
|
-
#
|
|
232
|
-
# def my_represent_none(self, data):
|
|
233
|
-
# return self.represent_scalar('tag:yaml.org,2002:null', 'null')
|
|
234
|
-
#
|
|
235
|
-
# yaml.representer.add_representer(type(None), my_represent_none)
|
|
236
|
-
# with open('cct_regions_empty.yaml', 'w') as yaml_file:
|
|
237
|
-
# yaml.dump(model.dict(), yaml_file)
|
|
238
|
-
# if read:
|
|
239
|
-
# regions_file_name = 'cct1_regions_manual.yaml'
|
|
240
|
-
# regions = read_regions(regions_file_name)
|