fiqus 2025.2.0__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/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.10.0.dist-info}/METADATA +65 -63
- fiqus-2025.10.0.dist-info/RECORD +86 -0
- {fiqus-2025.2.0.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.2.0.dist-info/RECORD +0 -85
- {fiqus-2025.2.0.dist-info → fiqus-2025.10.0.dist-info}/LICENSE.txt +0 -0
- {fiqus-2025.2.0.dist-info → fiqus-2025.10.0.dist-info}/top_level.txt +0 -0
|
@@ -88,19 +88,16 @@ class Mesh:
|
|
|
88
88
|
self.md = Util.read_data_from_yaml(f"{self.geom_files}_{run_type}.aux", dM.MultipoleData)
|
|
89
89
|
|
|
90
90
|
def updateAuxiliaryFile(self, run_type):
|
|
91
|
-
Util.write_data_to_yaml(f'{self.model_file}_{run_type}.aux', self.md.
|
|
92
|
-
# md2 = Util.read_data_from_yaml(f"{self.geom_files}.aux", dM.MultipoleData)
|
|
93
|
-
# md2.domains.physical_groups = self.md.domains.physical_groups
|
|
94
|
-
# Util.write_data_to_yaml(f"{self.geom_files}.aux", md2.dict())
|
|
91
|
+
Util.write_data_to_yaml(f'{self.model_file}_{run_type}.aux', self.md.model_dump())
|
|
95
92
|
|
|
96
93
|
def saveMeshFile(self, run_type):
|
|
97
94
|
gmsh.write(f'{self.model_file}_{run_type}.msh')
|
|
98
95
|
|
|
99
96
|
def saveRegionFile(self, run_type):
|
|
100
|
-
Util.write_data_to_yaml(f'{self.model_file}_{run_type}.reg', self.rm.
|
|
97
|
+
Util.write_data_to_yaml(f'{self.model_file}_{run_type}.reg', self.rm.model_dump())
|
|
101
98
|
|
|
102
99
|
def saveRegionCoordinateFile(self, run_type):
|
|
103
|
-
Util.write_data_to_yaml(f'{self.model_file}_{run_type}.reco', self.rc.
|
|
100
|
+
Util.write_data_to_yaml(f'{self.model_file}_{run_type}.reco', self.rc.model_dump())
|
|
104
101
|
|
|
105
102
|
def getIronCurvesTags(self):
|
|
106
103
|
for quadrant, qq in self.md.geometries.iron.quadrants.items():
|
|
@@ -206,7 +203,7 @@ class Mesh:
|
|
|
206
203
|
layer_nr].windings[block_order.winding]
|
|
207
204
|
cable = self.data.conductors[winding.conductor_name].cable
|
|
208
205
|
for line_key, line in winding.blocks[block_order.block].half_turns.lines.items():
|
|
209
|
-
if mesh.
|
|
206
|
+
if mesh.model_dump().get('isothermal_conductors', False):
|
|
210
207
|
elements = 1
|
|
211
208
|
elif any([i in line_key for i in ['i', 'o']]):
|
|
212
209
|
elements = max(1, round(cable.bare_cable_height_mean / mesh.conductors.transfinite.curve_target_size_height))
|
|
@@ -214,12 +211,12 @@ class Mesh:
|
|
|
214
211
|
elements = max(1, round(cable.bare_cable_width / mesh.conductors.transfinite.curve_target_size_width))
|
|
215
212
|
|
|
216
213
|
self.mesh.setTransfiniteCurve(line, elements)
|
|
217
|
-
if mesh.conductors.transfinite.enabled_for=='curves_and_surfaces' or mesh.
|
|
214
|
+
if mesh.conductors.transfinite.enabled_for=='curves_and_surfaces' or mesh.model_dump().get('isothermal_conductors', False):
|
|
218
215
|
for _, area in winding.blocks[block_order.block].half_turns.areas.items():
|
|
219
216
|
self.mesh.setTransfiniteSurface(area.surface)
|
|
220
217
|
self.mesh.setRecombine(2, area.surface)
|
|
221
218
|
|
|
222
|
-
if 'insulation' in mesh.
|
|
219
|
+
if 'insulation' in mesh.model_dump() and 'TSA' in mesh.model_dump()["insulation"]:
|
|
223
220
|
# Apply transfinite curves to thin shell lines
|
|
224
221
|
if geometry.use_TSA:
|
|
225
222
|
gts = self.md.geometries.thin_shells
|
|
@@ -273,7 +270,7 @@ class Mesh:
|
|
|
273
270
|
pnts = gmsh.model.getAdjacencies(1, wedge.lines['o'])[1]
|
|
274
271
|
outer_height = Func.points_distance(gmsh.model.getValue(0, pnts[0], []), gmsh.model.getValue(0, pnts[1], []))
|
|
275
272
|
for line_key, line in wedge.lines.items():
|
|
276
|
-
if mesh.
|
|
273
|
+
if mesh.model_dump().get('isothermal_wedges', False):
|
|
277
274
|
elements = 1
|
|
278
275
|
elif 'i' in line_key:
|
|
279
276
|
elements = max(1, round(inner_height / mesh.wedges.transfinite.curve_target_size_height))
|
|
@@ -284,7 +281,7 @@ class Mesh:
|
|
|
284
281
|
elements = max(1, round(width / mesh.wedges.transfinite.curve_target_size_width))
|
|
285
282
|
if mesh.wedges.transfinite.enabled_for in ['curves', 'curves_and_surfaces']:
|
|
286
283
|
self.mesh.setTransfiniteCurve(line, elements)
|
|
287
|
-
if mesh.wedges.transfinite.enabled_for=='curves_and_surfaces' or mesh.
|
|
284
|
+
if mesh.wedges.transfinite.enabled_for=='curves_and_surfaces' or mesh.model_dump().get('isothermal_wedges', False):
|
|
288
285
|
self.mesh.setTransfiniteSurface(list(wedge.areas.values())[0].surface)
|
|
289
286
|
self.mesh.setRecombine(2, list(wedge.areas.values())[0].surface)
|
|
290
287
|
|
|
@@ -292,7 +289,7 @@ class Mesh:
|
|
|
292
289
|
"""
|
|
293
290
|
Creates physical groups by grouping the mirrored entities according to the Roxie domains
|
|
294
291
|
"""
|
|
295
|
-
offset: int = 1 if 'symmetry' in geometry.
|
|
292
|
+
offset: int = 1 if 'symmetry' in geometry.model_dump() else int(1e6)
|
|
296
293
|
pg_tag = offset
|
|
297
294
|
|
|
298
295
|
# Create physical groups of iron yoke regions and block insulation
|
|
@@ -305,7 +302,7 @@ class Mesh:
|
|
|
305
302
|
pg_tag += 1
|
|
306
303
|
|
|
307
304
|
# Create the physical group of air infinite
|
|
308
|
-
if 'symmetry' in geometry.
|
|
305
|
+
if 'symmetry' in geometry.model_dump():
|
|
309
306
|
gmsh.model.setPhysicalName(0, gmsh.model.addPhysicalGroup(
|
|
310
307
|
0, [pnt for pnt_name, pnt in self.md.geometries.air.points.items() if 'bore_field' in pnt_name], pg_tag), 'bore_centers')
|
|
311
308
|
pg_tag += 1
|
|
@@ -353,13 +350,13 @@ class Mesh:
|
|
|
353
350
|
pg_tag += 1
|
|
354
351
|
# Assign thin-shell group
|
|
355
352
|
# the check for reversed block coil is not tested well
|
|
356
|
-
if geometry.
|
|
353
|
+
if geometry.model_dump().get('correct_block_coil_tsa_checkered_scheme', False) and self.md.geometries.coil.coils[coil_nr].type == 'reversed-block-coil':
|
|
357
354
|
azimuthal = 'a1' if list(wnd.blocks.keys()).index(block_nr) % 2 == 0 else 'a2'
|
|
358
355
|
else:
|
|
359
356
|
azimuthal = 'a1' if lyr_list_group.index('cl' + str(coil_nr) + 'ly' + str(layer_nr)) % 2 == 0 else 'a2'
|
|
360
357
|
radial = 'r1' if ht_list_group.index(ht_key) % 2 == 0 else 'r2'
|
|
361
358
|
ht_pg.group = radial + '_' + azimuthal
|
|
362
|
-
if geometry.
|
|
359
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
363
360
|
# Create 1D physical groups of thin shells
|
|
364
361
|
for ht_line_key, ht_line in block.half_turns.lines.items():
|
|
365
362
|
ht_nr = ht_line_key[:-1]
|
|
@@ -373,7 +370,7 @@ class Mesh:
|
|
|
373
370
|
blk_pg.half_turns[int(ht_nr)].lines[ht_line_key[-1]] = line_pg
|
|
374
371
|
|
|
375
372
|
# Create points region for projection
|
|
376
|
-
if 'use_TSA' in geometry.
|
|
373
|
+
if 'use_TSA' in geometry.model_dump():
|
|
377
374
|
self.md.domains.physical_groups.half_turns_points = gmsh.model.addPhysicalGroup(
|
|
378
375
|
0, [gmsh.model.getAdjacencies(1, gmsh.model.getAdjacencies(2, ht.surface)[1][0])[1][0]
|
|
379
376
|
for coil_nr, coil in self.md.geometries.coil.anticlockwise_order.coils.items()
|
|
@@ -383,7 +380,7 @@ class Mesh:
|
|
|
383
380
|
gmsh.model.setPhysicalName(0, self.md.domains.physical_groups.half_turns_points, 'points')
|
|
384
381
|
|
|
385
382
|
# Create physical groups of insulations
|
|
386
|
-
if not geometry.
|
|
383
|
+
if not geometry.model_dump().get('use_TSA', True):
|
|
387
384
|
for coil_nr, coil in self.md.geometries.insulation.coils.items():
|
|
388
385
|
for group_nr, group in coil.group.items():
|
|
389
386
|
# Areas
|
|
@@ -427,7 +424,7 @@ class Mesh:
|
|
|
427
424
|
else:
|
|
428
425
|
prev_group = prev_block_hts[list(prev_block_hts.keys())[0]].group
|
|
429
426
|
wedge_pg.group = ('r1' if prev_group[1] == '2' else 'r2') + prev_group[prev_group.index('_'):]
|
|
430
|
-
if geometry.
|
|
427
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
431
428
|
# Create 1D physical groups of thin shells
|
|
432
429
|
for line_key, line in wedge.lines.items():
|
|
433
430
|
wedge_pg.lines[line_key] = gmsh.model.addPhysicalGroup(1, [line], pg_tag)
|
|
@@ -437,7 +434,7 @@ class Mesh:
|
|
|
437
434
|
pg_tag += 1
|
|
438
435
|
|
|
439
436
|
# Create physical groups of thin shells
|
|
440
|
-
if geometry.
|
|
437
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
441
438
|
gts = self.md.geometries.thin_shells
|
|
442
439
|
# Create physical groups of block mid-layer lines
|
|
443
440
|
block_coil_flag = False
|
|
@@ -520,7 +517,7 @@ class Mesh:
|
|
|
520
517
|
pg.blocks[int(el_name1)].half_turns[int(ht1)].__dict__[ts_group_name + '_lines'][line_name] = line_pg
|
|
521
518
|
|
|
522
519
|
# Create physical groups of symmetric boundaries
|
|
523
|
-
if geometry.
|
|
520
|
+
if geometry.model_dump().get('symmetry', 'none') != 'none':
|
|
524
521
|
line_tags_normal_free, line_tags_tangent_free = [], []
|
|
525
522
|
if geometry.symmetry == 'xy':
|
|
526
523
|
if len(self.md.geometries.coil.coils[1].poles) == 2:
|
|
@@ -561,8 +558,8 @@ class Mesh:
|
|
|
561
558
|
self.qh_data[qh.ids[ht_index]][thin_shell] = {'conductor': blk_pg.conductor, 'ht_side': qh_side}
|
|
562
559
|
|
|
563
560
|
def _store_ts_tags(pg_el, geom_ts_name='', geom_ts_name2=None, ts_grp='', lines='', lines_side=None):
|
|
564
|
-
geom_ts = self.md.geometries.thin_shells.
|
|
565
|
-
for ln_name, ln_tag in (pg_el.
|
|
561
|
+
geom_ts = self.md.geometries.thin_shells.model_dump()[geom_ts_name]
|
|
562
|
+
for ln_name, ln_tag in (pg_el.model_dump()[lines][lines_side] if lines_side else pg_el.model_dump()[lines]).items():
|
|
566
563
|
for ts_name in ts_groups[ts_grp]:
|
|
567
564
|
if ts_name in geom_ts:
|
|
568
565
|
if ln_name in (geom_ts[ts_name][geom_ts_name2]['lines'] if geom_ts_name2 else geom_ts[ts_name]['lines']):
|
|
@@ -726,7 +723,7 @@ class Mesh:
|
|
|
726
723
|
qh = self.data.quench_protection.quench_heaters
|
|
727
724
|
|
|
728
725
|
# Air and air far field
|
|
729
|
-
if 'bore_field' in mesh.
|
|
726
|
+
if 'bore_field' in mesh.model_dump():
|
|
730
727
|
self.rm.air_far_field.vol.radius_out = float(abs(max(gmsh.model.getValue(0, gmsh.model.getAdjacencies(
|
|
731
728
|
1, self.md.geometries.air_inf.lines['outer'])[1][0], []), key=abs)))
|
|
732
729
|
self.rm.air_far_field.vol.radius_in = float(abs(max(gmsh.model.getValue(0, gmsh.model.getAdjacencies(
|
|
@@ -737,13 +734,13 @@ class Mesh:
|
|
|
737
734
|
self.rm.air_far_field.vol.numbers = [pg.air_inf]
|
|
738
735
|
self.rm.air_far_field.surf.name = "Surface_Inf"
|
|
739
736
|
self.rm.air_far_field.surf.number = pg.air_inf_bnd
|
|
740
|
-
if geometry.
|
|
737
|
+
if geometry.model_dump().get('symmetry', 'none') != 'none':
|
|
741
738
|
self.rm.boundaries.symmetry.normal_free.name = 'normal_free_bnd'
|
|
742
739
|
self.rm.boundaries.symmetry.normal_free.number = pg.symmetric_boundaries.normal_free
|
|
743
740
|
self.rm.boundaries.symmetry.tangential_free.name = 'tangent_free_bnd'
|
|
744
741
|
self.rm.boundaries.symmetry.tangential_free.number = pg.symmetric_boundaries.tangential_free
|
|
745
742
|
|
|
746
|
-
if 'use_TSA' in geometry.
|
|
743
|
+
if 'use_TSA' in geometry.model_dump():
|
|
747
744
|
self.rm.projection_points.name = 'projection_points'
|
|
748
745
|
self.rm.projection_points.number = self.md.domains.physical_groups.half_turns_points
|
|
749
746
|
|
|
@@ -757,10 +754,10 @@ class Mesh:
|
|
|
757
754
|
self.rm.induced[group] = rM.Induced()
|
|
758
755
|
self.rm.induced[group].vol.names = []
|
|
759
756
|
self.rm.induced[group].vol.numbers = []
|
|
760
|
-
if 'bore_field' in mesh.
|
|
757
|
+
if 'bore_field' in mesh.model_dump():
|
|
761
758
|
initial_current = self.data.power_supply.I_initial
|
|
762
759
|
self.rm.powered[group].vol.currents = []
|
|
763
|
-
if geometry.
|
|
760
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
764
761
|
self.rm.powered[group].surf_in.names = []
|
|
765
762
|
self.rm.powered[group].surf_in.numbers = []
|
|
766
763
|
self.rm.powered[group].surf_out.names = []
|
|
@@ -771,9 +768,9 @@ class Mesh:
|
|
|
771
768
|
self.rm.induced[group].surf_out.names = []
|
|
772
769
|
self.rm.induced[group].surf_out.numbers = []
|
|
773
770
|
if geometry.with_iron_yoke:
|
|
774
|
-
self.rm.
|
|
775
|
-
self.rm.
|
|
776
|
-
if geometry.
|
|
771
|
+
self.rm.iron_yoke.vol.names = []
|
|
772
|
+
self.rm.iron_yoke.vol.numbers = []
|
|
773
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
777
774
|
unique_thin_shells = []
|
|
778
775
|
self.rm.thin_shells.second_group_is_next['azimuthally'] = []
|
|
779
776
|
self.rm.thin_shells.second_group_is_next['radially'] = []
|
|
@@ -785,7 +782,7 @@ class Mesh:
|
|
|
785
782
|
self.rm.insulator.surf.names = []
|
|
786
783
|
self.rm.insulator.surf.numbers = []
|
|
787
784
|
|
|
788
|
-
if geometry.
|
|
785
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
789
786
|
# Categorize insulation types
|
|
790
787
|
min_h = mesh.insulation.global_size
|
|
791
788
|
# min_h = 1
|
|
@@ -821,7 +818,7 @@ class Mesh:
|
|
|
821
818
|
self.rm.thin_shells.insulation_types.layers_material[-1].extend([side_ins_type[nr]] * tsa_layers)
|
|
822
819
|
|
|
823
820
|
# Mid-pole, mid-winding, and mid-layer insulation layers
|
|
824
|
-
ins_th_dict = self.md.geometries.thin_shells.ins_thickness.
|
|
821
|
+
ins_th_dict = self.md.geometries.thin_shells.ins_thickness.model_dump()
|
|
825
822
|
for ins_type, ins in self.ins_type.items():
|
|
826
823
|
for ins_name, tags in ins.items():
|
|
827
824
|
# Get conductors insulation
|
|
@@ -930,13 +927,13 @@ class Mesh:
|
|
|
930
927
|
for blk_nr, blk in pg.blocks.items():
|
|
931
928
|
ht_list = list(blk.half_turns.keys())
|
|
932
929
|
for ht_nr, ht in blk.half_turns.items():
|
|
933
|
-
ht_name = f"ht{ht_nr}_{'EM' if 'bore_field' in mesh.
|
|
930
|
+
ht_name = f"ht{ht_nr}_{'EM' if 'bore_field' in mesh.model_dump() else 'TH'}"
|
|
934
931
|
self.rm.powered[ht.group].conductors[blk.conductor].append(ht_name)
|
|
935
932
|
self.rm.powered[ht.group].vol.names.append(ht_name)
|
|
936
933
|
self.rm.powered[ht.group].vol.numbers.append(ht.tag)
|
|
937
|
-
if 'bore_field' in mesh.
|
|
934
|
+
if 'bore_field' in mesh.model_dump():
|
|
938
935
|
self.rm.powered[ht.group].vol.currents.append(initial_current * (1 if blk.current_sign > 0 else -1))
|
|
939
|
-
if geometry.
|
|
936
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
940
937
|
for line in ['l', 'i', 'o', 'h']:
|
|
941
938
|
# Bare edges
|
|
942
939
|
self.rm.powered[ht.group].surf_in.names.append(ht_name + line)
|
|
@@ -991,17 +988,17 @@ class Mesh:
|
|
|
991
988
|
# conductor edges precede a2
|
|
992
989
|
self.rm.thin_shells.second_group_is_next['radially'].append(ht.lines['o'])
|
|
993
990
|
|
|
994
|
-
if geometry.
|
|
991
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
995
992
|
for group in ['r1_a1', 'r2_a1', 'r1_a2', 'r2_a2']:
|
|
996
993
|
unique_thin_shells.extend(self.rm.powered[group].surf_out.numbers)
|
|
997
994
|
|
|
998
995
|
# Wedges
|
|
999
996
|
if geometry.with_wedges:
|
|
1000
997
|
for wdg_nr, wdg in pg.wedges.items():
|
|
1001
|
-
wdg_name = f"w{wdg_nr}_{'EM' if 'bore_field' in mesh.
|
|
998
|
+
wdg_name = f"w{wdg_nr}_{'EM' if 'bore_field' in mesh.model_dump() else 'TH'}"
|
|
1002
999
|
self.rm.induced[wdg.group].vol.names.append(wdg_name)
|
|
1003
1000
|
self.rm.induced[wdg.group].vol.numbers.append(wdg.tag)
|
|
1004
|
-
if geometry.
|
|
1001
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
1005
1002
|
# Bare edges
|
|
1006
1003
|
for line in ['l', 'i', 'o', 'h']:
|
|
1007
1004
|
self.rm.induced[wdg.group].surf_in.names.append(wdg_name + line)
|
|
@@ -1031,30 +1028,30 @@ class Mesh:
|
|
|
1031
1028
|
self.rm.thin_shells.second_group_is_next['radially'].append(line_tag)
|
|
1032
1029
|
elif not wdg.mid_layer_lines.outer:
|
|
1033
1030
|
self.rm.thin_shells.second_group_is_next['radially'].append(wdg.lines['o'])
|
|
1034
|
-
if geometry.
|
|
1031
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
1035
1032
|
for group in ['r1_a1', 'r2_a1', 'r1_a2', 'r2_a2']:
|
|
1036
1033
|
unique_thin_shells.extend(self.rm.induced[group].surf_out.numbers)
|
|
1037
1034
|
|
|
1038
1035
|
# Unique mid layers
|
|
1039
|
-
if geometry.
|
|
1036
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
1040
1037
|
self.rm.thin_shells.mid_turns_layers_poles = list(set(unique_thin_shells))
|
|
1041
1038
|
|
|
1042
1039
|
# Insulation
|
|
1043
1040
|
for group_name, surface in pg.insulations.surfaces.items():
|
|
1044
1041
|
self.rm.insulator.vol.names.append('ins' + group_name)
|
|
1045
1042
|
self.rm.insulator.vol.numbers.append(surface)
|
|
1046
|
-
if 'insulation' in mesh.
|
|
1043
|
+
if 'insulation' in mesh.model_dump() and 'TSA' in mesh.model_dump()["insulation"]:
|
|
1047
1044
|
for group_name, curve in pg.insulations.curves.items():
|
|
1048
1045
|
self.rm.insulator.surf.names.append('ins' + group_name)
|
|
1049
1046
|
self.rm.insulator.surf.numbers.append(curve)
|
|
1050
1047
|
|
|
1051
1048
|
# Iron
|
|
1052
1049
|
for group_name, surface in pg.iron.surfaces.items():
|
|
1053
|
-
self.rm.
|
|
1054
|
-
self.rm.
|
|
1050
|
+
self.rm.iron_yoke.vol.names.append(group_name)
|
|
1051
|
+
self.rm.iron_yoke.vol.numbers.append(surface)
|
|
1055
1052
|
|
|
1056
1053
|
# Boundary conditions
|
|
1057
|
-
if 'insulation' in mesh.
|
|
1054
|
+
if 'insulation' in mesh.model_dump() and 'TSA' in mesh.model_dump()["insulation"]:
|
|
1058
1055
|
# Initialize lists
|
|
1059
1056
|
for bc_data, bc_rm in zip(self.data.magnet.solve.thermal.overwrite_boundary_conditions, self.rm.boundaries.thermal): # b.c. type
|
|
1060
1057
|
bc_rm[1].bc.names = []
|
|
@@ -1091,7 +1088,7 @@ class Mesh:
|
|
|
1091
1088
|
bc_rm = {'Robin': self.rm.boundaries.thermal.cooling, 'Neumann': self.rm.boundaries.thermal.heat_flux}
|
|
1092
1089
|
bnd_list_names = {'Robin': [], 'Neumann': []}
|
|
1093
1090
|
bnd_list_numbers = {'Robin': [], 'Neumann': []}
|
|
1094
|
-
if geometry.
|
|
1091
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
1095
1092
|
# Half turn boundaries
|
|
1096
1093
|
for coil_nr, coil in self.md.geometries.coil.anticlockwise_order.coils.items():
|
|
1097
1094
|
for lyr_nr, orders in coil.layers.items():
|
|
@@ -1147,7 +1144,7 @@ class Mesh:
|
|
|
1147
1144
|
for _, bc in bc_data[1].items(): # all boundary conditions of one b.c. type (e.g., Dirichlet with different temperatures)
|
|
1148
1145
|
bnd_list_names = []
|
|
1149
1146
|
bnd_list_numbers = []
|
|
1150
|
-
if geometry.
|
|
1147
|
+
if geometry.model_dump().get('use_TSA', False):
|
|
1151
1148
|
for bnd in bc.boundaries: # all boundaries of one boundary condition
|
|
1152
1149
|
if bnd[0] == 'w':
|
|
1153
1150
|
if not geometry.with_wedges:
|
fiqus/parsers/ParserDAT.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import pandas as pd
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class ParserDAT:
|
|
5
|
-
|
|
6
|
-
def __init__(self, dat_file_path):
|
|
7
|
-
"""
|
|
8
|
-
Read dat file and returns its content as object attribute .pqv (postprocessed quantity value) that is a float
|
|
9
|
-
:param dat_file_path: Full path to .pos file, including file name and extension.
|
|
10
|
-
:return: nothing, keeps attribute pqv (postprocessed quantity value)
|
|
11
|
-
"""
|
|
12
|
-
pqn = 'pqn' # postprocessed quantity name
|
|
13
|
-
delimiter = ' '
|
|
14
|
-
columns = ['NaN', pqn]
|
|
15
|
-
df = pd.read_csv(dat_file_path, delimiter=delimiter, header=None, engine='python', names=columns, skipinitialspace=True)
|
|
16
|
-
self.pqv = float(df[pqn][0])
|
|
1
|
+
import pandas as pd
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ParserDAT:
|
|
5
|
+
|
|
6
|
+
def __init__(self, dat_file_path):
|
|
7
|
+
"""
|
|
8
|
+
Read dat file and returns its content as object attribute .pqv (postprocessed quantity value) that is a float
|
|
9
|
+
:param dat_file_path: Full path to .pos file, including file name and extension.
|
|
10
|
+
:return: nothing, keeps attribute pqv (postprocessed quantity value)
|
|
11
|
+
"""
|
|
12
|
+
pqn = 'pqn' # postprocessed quantity name
|
|
13
|
+
delimiter = ' '
|
|
14
|
+
columns = ['NaN', pqn]
|
|
15
|
+
df = pd.read_csv(dat_file_path, delimiter=delimiter, header=None, engine='python', names=columns, skipinitialspace=True)
|
|
16
|
+
self.pqv = float(df[pqn][0])
|