fiqus 2024.5.2__py3-none-any.whl → 2024.7.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.
Files changed (34) hide show
  1. fiqus/MainFiQuS.py +15 -5
  2. fiqus/data/DataConductor.py +301 -0
  3. fiqus/data/DataFiQuS.py +5 -2
  4. fiqus/data/DataFiQuSConductor.py +84 -0
  5. fiqus/data/DataFiQuSConductorAC_Strand.py +565 -0
  6. fiqus/data/DataFiQuSPancake3D.py +149 -39
  7. fiqus/data/RegionsModelFiQuS.py +4 -2
  8. fiqus/geom_generators/GeometryCCT.py +19 -17
  9. fiqus/geom_generators/GeometryConductorAC_Strand.py +1391 -0
  10. fiqus/getdp_runners/RunGetdpConductorAC_Strand.py +202 -0
  11. fiqus/getdp_runners/RunGetdpMultipole.py +4 -4
  12. fiqus/mains/MainConductorAC_Strand.py +133 -0
  13. fiqus/mesh_generators/MeshCCT.py +8 -8
  14. fiqus/mesh_generators/MeshConductorAC_Strand.py +657 -0
  15. fiqus/mesh_generators/MeshMultipole.py +11 -8
  16. fiqus/mesh_generators/MeshPancake3D.py +20 -18
  17. fiqus/plotters/PlotPythonConductorAC.py +855 -0
  18. fiqus/post_processors/PostProcessConductorAC.py +49 -0
  19. fiqus/pro_assemblers/ProAssembler.py +4 -3
  20. fiqus/pro_templates/combined/CCT_template.pro +25 -25
  21. fiqus/pro_templates/combined/ConductorAC_template.pro +1025 -0
  22. fiqus/pro_templates/combined/Multipole_template.pro +5 -5
  23. fiqus/pro_templates/combined/Pancake3D_template.pro +131 -46
  24. fiqus/pro_templates/combined/materials.pro +13 -9
  25. {fiqus-2024.5.2.dist-info → fiqus-2024.7.0.dist-info}/METADATA +2 -1
  26. {fiqus-2024.5.2.dist-info → fiqus-2024.7.0.dist-info}/RECORD +34 -22
  27. {fiqus-2024.5.2.dist-info → fiqus-2024.7.0.dist-info}/WHEEL +1 -1
  28. tests/test_geometry_generators.py +41 -0
  29. tests/test_mesh_generators.py +45 -0
  30. tests/test_solvers.py +52 -0
  31. tests/utils/fiqus_test_classes.py +42 -6
  32. tests/utils/generate_reference_files_ConductorAC.py +57 -0
  33. tests/utils/generate_reference_files_Pancake3D.py +92 -0
  34. {fiqus-2024.5.2.dist-info → fiqus-2024.7.0.dist-info}/top_level.txt +0 -0
@@ -28,7 +28,7 @@ logger = logging.getLogger(__name__)
28
28
  NormalMaterialName = Literal[
29
29
  "Copper", "Hastelloy", "Silver", "Indium", "Stainless Steel"
30
30
  ]
31
- SuperconductingMaterialName = Literal["HTSSuperPower"]
31
+ SuperconductingMaterialName = Literal["HTSSuperPower", "HTSFujikura"]
32
32
  # ======================================================================================
33
33
  # ======================================================================================
34
34
 
@@ -89,6 +89,7 @@ getdpTSATripleFunctions = {
89
89
  }
90
90
  getdpCriticalCurrentDensityFunctions = {
91
91
  "HTSSuperPower": "CFUN_HTS_JcFit_SUPERPOWER_T_B_theta",
92
+ "HTSFujikura": "CFUN_HTS_JcFit_Fujikura_T_B_theta",
92
93
  }
93
94
  # ======================================================================================
94
95
  # ======================================================================================
@@ -97,7 +98,6 @@ getdpCriticalCurrentDensityFunctions = {
97
98
  # Available quantities: ================================================================
98
99
  PositionRequiredQuantityName = Literal[
99
100
  "magneticField",
100
- "axialComponentOfTheMagneticField",
101
101
  "magnitudeOfMagneticField",
102
102
  "currentDensity",
103
103
  "magnitudeOfCurrentDensity",
@@ -110,6 +110,7 @@ PositionRequiredQuantityName = Literal[
110
110
  "specificHeatCapacity",
111
111
  "jHTSOverjCritical",
112
112
  "criticalCurrent",
113
+ "axialComponentOfTheMagneticField",
113
114
  "debug",
114
115
  ]
115
116
  PositionNotRequiredQuantityName = Literal[
@@ -119,6 +120,7 @@ PositionNotRequiredQuantityName = Literal[
119
120
  "timeConstant",
120
121
  "totalResistiveHeating",
121
122
  "magneticEnergy",
123
+ "maximumTemperature"
122
124
  ]
123
125
  # ======================================================================================
124
126
  # ======================================================================================
@@ -142,16 +144,17 @@ EMQuantities = [
142
144
  "voltageBetweenTerminals",
143
145
  "totalResistiveHeating",
144
146
  "magneticEnergy",
147
+ "axialComponentOfTheMagneticField",
145
148
  ]
146
149
  ThermalQuantities = [
147
150
  "temperature",
148
151
  "heatFlux",
149
152
  "thermalConductivity",
150
153
  "specificHeatCapacity",
154
+ "maximumTemperature",
151
155
  "debug",
152
156
  ]
153
157
  quantityProperNames = {
154
- "axialComponentOfTheMagneticField": "Axila Component of the Magnetic Field",
155
158
  "magneticField": "Magnetic Field",
156
159
  "magneticEnergy": "Magnetic Energy",
157
160
  "magnitudeOfMagenticField": "Magnitude of Magnetic Field",
@@ -172,22 +175,23 @@ quantityProperNames = {
172
175
  "debug": "Debug",
173
176
  "inductance": "Inductance",
174
177
  "timeConstant": "Time Constant",
178
+ "axialComponentOfTheMagneticField": "Axial Component of the Magnetic Field",
179
+ "maximumTemperature": "Maximum Temperature",
175
180
  }
176
181
 
177
182
  quantityUnits = {
178
- "axialComponentOfTheMagneticField": "T",
179
183
  "magneticField": "T",
180
184
  "magneticEnergy": "J",
181
185
  "magnitudeOfMagneticField": "T",
182
- "currentDensity": "$A/m^2$",
183
- "magnitudeOfCurrentDensity": "$A/m^2$",
186
+ "currentDensity": "A/m^2",
187
+ "magnitudeOfCurrentDensity": "A/m^2",
184
188
  "resistiveHeating": "W",
185
189
  "totalResistiveHeating": "W",
186
190
  "temperature": "K",
187
191
  "currentThroughCoil": "A",
188
192
  "voltageBetweenTerminals": "V",
189
- "criticalCurrentDensity": "$A/m^2$",
190
- "heatFlux": "$W/m^2$",
193
+ "criticalCurrentDensity": "A/m^2",
194
+ "heatFlux": "W/m^2",
191
195
  "resistivity": "Ohm*m",
192
196
  "thermalConductivity": "W/m*K",
193
197
  "specificHeatCapacity": "J/kg*K",
@@ -196,10 +200,11 @@ quantityUnits = {
196
200
  "debug": "1",
197
201
  "inductance": "H",
198
202
  "timeConstant": "s",
203
+ "axialComponentOfTheMagneticField": "T",
204
+ "maximumTemperature": "K",
199
205
  }
200
206
 
201
207
  getdpQuantityNames = {
202
- "axialComponentOfTheMagneticField": "RESULT_axialComponentOfTheMagneticField",
203
208
  "magneticField": "RESULT_magneticField",
204
209
  "magneticEnergy": "RESULT_magneticEnergy",
205
210
  "magnitudeOfMagneticField": "RESULT_magnitudeOfMagneticField",
@@ -220,10 +225,11 @@ getdpQuantityNames = {
220
225
  "debug": "RESULT_debug",
221
226
  "inductance": "RESULT_inductance",
222
227
  "timeConstant": "RESULT_timeConstant",
228
+ "axialComponentOfTheMagneticField": "RESULT_axialComponentOfTheMagneticField",
229
+ "maximumTemperature": "RESULT_maximumTemperature",
223
230
  }
224
231
 
225
232
  getdpPostOperationNames = {
226
- "axialComponentOfTheMagneticField": "POSTOP_axialComponentOfTheMagneticField",
227
233
  "magneticField": "POSTOP_magneticField",
228
234
  "magneticEnergy": "RESULT_magneticEnergy",
229
235
  "magnitudeOfMagneticField": "POSTOP_magnitudeOfMagneticField",
@@ -244,6 +250,8 @@ getdpPostOperationNames = {
244
250
  "debug": "POSTOP_debug",
245
251
  "inductance": "POSTOP_inductance",
246
252
  "timeConstant": "POSTOP_timeConstant",
253
+ "axialComponentOfTheMagneticField": "POSTOP_axialComponentOfTheMagneticField",
254
+ "maximumTemperature": "POSTOP_maximumTemperature",
247
255
  }
248
256
 
249
257
  # ======================================================================================
@@ -1320,11 +1328,12 @@ class Pancake3DSolveSuperconductingMaterial(Pancake3DSolveMaterialBase):
1320
1328
  alias="N-Value for E-J Power Law",
1321
1329
  description="N-value for E-J power law.",
1322
1330
  )
1323
- IcAtTinit: PositiveFloat | str | Pancake3DSolveIcVsLength = Field(
1324
- alias="criticalCurrentAtInitialTemperature",
1325
- title="Critical Current at Initial Temperature",
1331
+ IcAtTAndBref: PositiveFloat | str | Pancake3DSolveIcVsLength = Field(
1332
+ alias="criticalCurrentAtReferenceTemperatureAndField",
1333
+ title="Critical Current at Reference Temperature and Field",
1326
1334
  description=(
1327
- "Critical current at initial temperature. The critical current value will"
1335
+ "Critical current at reference temperature and magnetic field."
1336
+ "The critical current value will"
1328
1337
  " change with temperature depending on the superconductor material.\nEither"
1329
1338
  " the same critical current for the whole tape or the critical current with"
1330
1339
  " respect to the tape length can be specified. To specify the same critical"
@@ -1375,14 +1384,40 @@ class Pancake3DSolveSuperconductingMaterial(Pancake3DSolveMaterialBase):
1375
1384
  ),
1376
1385
  )
1377
1386
 
1387
+ IcReferenceTemperature: PositiveFloat = Field(
1388
+ default=77,
1389
+ alias="criticalCurrentReferenceTemperature",
1390
+ title="Critical Current Reference Temperature",
1391
+ description="Critical current reference temperature in Kelvin.",
1392
+ )
1393
+
1394
+ IcReferenceBmagnitude: NonNegativeFloat = Field(
1395
+ default=0.0,
1396
+ alias="criticalCurrentReferenceFieldMagnitude",
1397
+ title="Critical Current Reference Magnetic Field Magnitude",
1398
+ description="Critical current reference magnetic field magnitude in Tesla.",
1399
+ )
1400
+
1401
+ IcReferenceBangle: NonNegativeFloat = Field(
1402
+ default=90.0,
1403
+ alias="criticalCurrentReferenceFieldAngle",
1404
+ title="Critical Current Reference Magnetic Field Angle",
1405
+ description= (
1406
+ "Critical current reference magnetic field angle in degrees."
1407
+ "0 degrees means the magnetic field is normal to the tape's wide surface"
1408
+ "and 90 degrees means the magnetic field is parallel to the tape's wide"
1409
+ "surface."
1410
+ ),
1411
+ )
1412
+
1378
1413
  @computed_field
1379
1414
  @cached_property
1380
1415
  def IcValues(self) -> list[float]:
1381
1416
  """Return the critical current values of the material."""
1382
- if hasattr(self.IcAtTinit, "criticalCurrentValues"):
1383
- return self.IcAtTinit.criticalCurrentValues
1384
- elif isinstance(self.IcAtTinit, str):
1385
- csv_file_path = pathlib.Path(input_file_path.get()).parent / self.IcAtTinit
1417
+ if hasattr(self.IcAtTAndBref, "criticalCurrentValues"):
1418
+ return self.IcAtTAndBref.criticalCurrentValues
1419
+ elif isinstance(self.IcAtTAndBref, str):
1420
+ csv_file_path = pathlib.Path(input_file_path.get()).parent / self.IcAtTAndBref
1386
1421
  # return the second column:
1387
1422
  IcValues = list(pd.read_csv(csv_file_path, header=None).iloc[:, 1])
1388
1423
  for Ic in IcValues:
@@ -1392,16 +1427,16 @@ class Pancake3DSolveSuperconductingMaterial(Pancake3DSolveMaterialBase):
1392
1427
  )
1393
1428
  return IcValues
1394
1429
  else:
1395
- return [self.IcAtTinit]
1430
+ return [self.IcAtTAndBref]
1396
1431
 
1397
1432
  @computed_field
1398
1433
  @cached_property
1399
1434
  def lengthValues(self) -> list[float]:
1400
1435
  """Return the length values of the material."""
1401
- if hasattr(self.IcAtTinit, "lengthValues"):
1402
- return self.IcAtTinit.lengthValues
1403
- elif isinstance(self.IcAtTinit, str):
1404
- csv_file_path = pathlib.Path(input_file_path.get()).parent / self.IcAtTinit
1436
+ if hasattr(self.IcAtTAndBref, "lengthValues"):
1437
+ return self.IcAtTAndBref.lengthValues
1438
+ elif isinstance(self.IcAtTAndBref, str):
1439
+ csv_file_path = pathlib.Path(input_file_path.get()).parent / self.IcAtTAndBref
1405
1440
  # return the first column:
1406
1441
  lengthValues = list(pd.read_csv(csv_file_path, header=None).iloc[:, 0])
1407
1442
  for length in lengthValues:
@@ -1727,7 +1762,9 @@ class Pancake3DSolvePositionNotRequiredTolerance(Pancake3DSolveToleranceBase):
1727
1762
  # Mandatory:
1728
1763
  quantity: (
1729
1764
  Literal[
1730
- "solutionVector",
1765
+ "electromagneticSolutionVector",
1766
+ "thermalSolutionVector",
1767
+ "coupledSolutionVector",
1731
1768
  ]
1732
1769
  | PositionNotRequiredQuantityName
1733
1770
  ) = Field(
@@ -1759,10 +1796,11 @@ class Pancake3DSolveSettingsWithTolerances(BaseModel):
1759
1796
  tolerances = [
1760
1797
  tolerance
1761
1798
  for tolerance in self.tolerances
1762
- if "solutionVector" not in tolerance.quantity
1799
+ if "SolutionVector" not in tolerance.quantity
1763
1800
  ]
1764
1801
  return tolerances
1765
1802
 
1803
+
1766
1804
  @computed_field
1767
1805
  @cached_property
1768
1806
  def systemTolerances(self) -> list[Pancake3DSolveTolerance]:
@@ -1770,7 +1808,7 @@ class Pancake3DSolveSettingsWithTolerances(BaseModel):
1770
1808
  tolerances = [
1771
1809
  tolerance
1772
1810
  for tolerance in self.tolerances
1773
- if "solutionVector" in tolerance.quantity
1811
+ if "SolutionVector" in tolerance.quantity
1774
1812
  ]
1775
1813
  return tolerances
1776
1814
 
@@ -1993,9 +2031,6 @@ class Pancake3DSolveTimeFixed(Pancake3DSolveTimeBase):
1993
2031
  )
1994
2032
  ):
1995
2033
  raise ValueError("Time interval must be a multiple of the time step!")
1996
-
1997
-
1998
- return model
1999
2034
 
2000
2035
 
2001
2036
  Pancake3DSolveTime = Annotated[
@@ -2093,7 +2128,7 @@ class Pancake3DSolveLocalDefect(BaseModel):
2093
2128
  " times!"
2094
2129
  )
2095
2130
 
2096
- return startTime
2131
+ return start_time
2097
2132
 
2098
2133
  @field_validator("endTurn")
2099
2134
  @classmethod
@@ -2126,7 +2161,7 @@ class Pancake3DSolveLocalDefect(BaseModel):
2126
2161
  "whickPancakeCoil (pancake coil number) should be given if there"
2127
2162
  " are more than one pancake coil!"
2128
2163
  )
2129
-
2164
+
2130
2165
  return whichPancakeCoil
2131
2166
 
2132
2167
  @computed_field
@@ -2145,9 +2180,6 @@ class Pancake3DSolveLocalDefect(BaseModel):
2145
2180
  """Return the z-coordinate of the bottom of the pancake coil."""
2146
2181
  geometry = geometry_input.get()
2147
2182
 
2148
- if not self.whichPancakeCoil:
2149
- self.whichPancakeCoil = 1
2150
-
2151
2183
  zBottom = -(
2152
2184
  geometry["numberOfPancakes"] * geometry["winding"]["height"]
2153
2185
  + (geometry["numberOfPancakes"] - 1)
@@ -2182,7 +2214,7 @@ class Pancake3DSolveLocalDefects(BaseModel):
2182
2214
  else:
2183
2215
  windingMaterials = []
2184
2216
 
2185
- superconducting_material_is_used = "HTSSuperPower" in windingMaterials
2217
+ superconducting_material_is_used = "HTSSuperPower" in windingMaterials or "HTSFujikura" in windingMaterials
2186
2218
 
2187
2219
  if not superconducting_material_is_used:
2188
2220
  raise ValueError(
@@ -2221,7 +2253,7 @@ class Pancake3DSolveQuantityBase(BaseModel):
2221
2253
  class Pancake3DSolveSaveQuantity(Pancake3DSolveQuantityBase):
2222
2254
  # Optionals:
2223
2255
  timesToBeSaved: list[float] = Field(
2224
- default=[],
2256
+ default=None,
2225
2257
  title="Times to be Saved",
2226
2258
  description=(
2227
2259
  "List of times that wanted to be saved. If not given, all the time steps"
@@ -2247,8 +2279,6 @@ class Pancake3DSolveSaveQuantity(Pancake3DSolveQuantityBase):
2247
2279
  raise ValueError(
2248
2280
  "Times to be saved should be between the start and end times!"
2249
2281
  )
2250
-
2251
- return timesToBeSaved
2252
2282
 
2253
2283
 
2254
2284
  # ======================================================================================
@@ -2579,6 +2609,12 @@ class Pancake3DPostprocessMagneticFieldOnPlane(BaseModel):
2579
2609
 
2580
2610
 
2581
2611
  class Pancake3DGeometry(BaseModel):
2612
+ conductorWrite: bool = Field(
2613
+ default=False,
2614
+ title="Flag:to Write the Conductor File",
2615
+ description="To Write the Conductor File"
2616
+ )
2617
+
2582
2618
  # Mandatory:
2583
2619
  N: PositiveInt = Field(
2584
2620
  ge=1,
@@ -2620,6 +2656,7 @@ class Pancake3DGeometry(BaseModel):
2620
2656
  # Optionals:
2621
2657
  dimTol: PositiveFloat = Field(
2622
2658
  default=1e-8,
2659
+ gt=1e-5,
2623
2660
  alias="dimensionTolerance",
2624
2661
  description="dimension tolerance (CAD related, not physical)",
2625
2662
  )
@@ -2934,6 +2971,79 @@ class Pancake3DSolve(BaseModel):
2934
2971
 
2935
2972
  return systemsOfEquationsType
2936
2973
 
2974
+ @model_validator(mode="before")
2975
+ @classmethod
2976
+ def check_nls_system_tolerances(cls, model: "Pancake3DSolve"):
2977
+
2978
+ if not "nonlinearSolver" in model or not "tolerances" in model["nonlinearSolver"]:
2979
+ return model
2980
+
2981
+ all_tolerances = model["nonlinearSolver"]["tolerances"]
2982
+
2983
+ for tolerance in all_tolerances:
2984
+ if tolerance["quantity"] == "electromagneticSolutionVector":
2985
+ if model["type"] == "thermal" or model["type"] == "stronglyCoupled":
2986
+ raise ValueError(
2987
+ "Nonlinear iteration:"
2988
+ "The 'electromagneticSolutionVector' tolerance can be used only"
2989
+ " in 'electromagnetic' or 'weaklyCoupled' simulations."
2990
+ )
2991
+
2992
+ if tolerance["quantity"] == "thermalSolutionVector":
2993
+ if model["type"] == "electromagnetic" or model["type"] == "stronglyCoupled":
2994
+ raise ValueError(
2995
+ "Nonlinear iteration:"
2996
+ "The 'thermalSolutionVector' tolerance can be used only"
2997
+ " in 'thermal' or 'weaklyCoupled' simulations."
2998
+ )
2999
+
3000
+ if tolerance["quantity"] == "coupledSolutionVector":
3001
+ if model["type"] == "electromagnetic" or model["type"] == "thermal" or model["type"] == "weaklyCoupled":
3002
+ raise ValueError(
3003
+ "Nonlinear iteration:"
3004
+ "The 'coupledSolutionVector' tolerance can be used only"
3005
+ " in 'stronglyCoupled' simulations."
3006
+ )
3007
+ return model
3008
+
3009
+ @model_validator(mode="before")
3010
+ @classmethod
3011
+ def check_adaptive_system_tolerances(cls, model: "Pancake3DSolve"):
3012
+
3013
+ if model["time"]["timeSteppingType"] == "fixed":
3014
+ return model
3015
+
3016
+ all_tolerances = model["time"]["adaptiveSteppingSettings"]["tolerances"]
3017
+
3018
+ for tolerance in all_tolerances:
3019
+ if tolerance["quantity"] == "electromagneticSolutionVector":
3020
+ if model["type"] == "thermal" or model["type"] == "stronglyCoupled":
3021
+ raise ValueError(
3022
+ "Adaptive time stepping:"
3023
+ "The 'electromagneticSolutionVector' tolerance can be used only"
3024
+ " in 'electromagnetic' or 'weaklyCoupled' simulations."
3025
+ )
3026
+
3027
+ if tolerance["quantity"] == "thermalSolutionVector":
3028
+ if model["type"] == "electromagnetic" or model["type"] == "stronglyCoupled":
3029
+ raise ValueError(
3030
+ "Adaptive time stepping:"
3031
+ "The 'thermalSolutionVector' tolerance can be used only"
3032
+ " in 'thermal' or 'weaklyCoupled' simulations."
3033
+ )
3034
+
3035
+ if tolerance["quantity"] == "coupledSolutionVector":
3036
+ if model["type"] == "electromagnetic" or model["type"] == "thermal" or model["type"] == "weaklyCoupled":
3037
+ raise ValueError(
3038
+ "Adaptive time stepping:"
3039
+ "The 'coupledSolutionVector' tolerance can be used only"
3040
+ " in 'stronglyCoupled' simulations."
3041
+ )
3042
+ return model
3043
+
3044
+ # TODO: add model_validator to check postprocess quantities are available for this solve type (e.g. thermal quantities cannot be chosen for electromagnetic solve)
3045
+
3046
+ # TODO: add model_validator to check convergence quantities are available for this solve type (e.g. thermal quantities cannot be chosen for electromagnetic solve)
2937
3047
 
2938
3048
  class Pancake3DPostprocess(BaseModel):
2939
3049
  """
@@ -2947,7 +3057,7 @@ class Pancake3DPostprocess(BaseModel):
2947
3057
  description="Values can be plotted with respect to time.",
2948
3058
  )
2949
3059
 
2950
- magneticFieldOnCutPlane: Optional[Pancake3DPostprocessMagneticFieldOnPlane] = Field(
3060
+ magneticFieldOnCutPlane: Pancake3DPostprocessMagneticFieldOnPlane = Field(
2951
3061
  default=None,
2952
3062
  title="Magnetic Field on a Cut Plane",
2953
3063
  description=(
@@ -183,8 +183,10 @@ class ThinShell(BaseModel):
183
183
 
184
184
 
185
185
  class RegionsModel(BaseModel):
186
- powered: Powered = Powered()
187
- induced: Induced = Induced()
186
+ # powered: Powered = Powered()
187
+ # induced: Induced = Induced()
188
+ powered: Dict[str, Powered] = {}
189
+ induced: Dict[str, Induced] = {}
188
190
  insulator: Insulator = Insulator()
189
191
  iron: Iron = Iron()
190
192
  air: Air = Air()
@@ -547,39 +547,41 @@ class Generate_BREPs:
547
547
  lrt = 3000000 # line region tag start
548
548
  # -------- powered ----------
549
549
  # volumes
550
- cctrm.powered.vol.names = [name + self.transl_dict['vol'] for name in self.cctdm.geometry.windings.names + self.cctdm.geometry.fqpls.names]
551
- cctrm.powered.vol.currents = self.cctdm.solve.windings.currents + self.cctdm.solve.fqpls.currents
552
- cctrm.powered.vol.sigmas = self.cctdm.solve.windings.sigmas + self.cctdm.solve.fqpls.sigmas
553
- cctrm.powered.vol.mu_rs = self.cctdm.solve.windings.mu_rs + self.cctdm.solve.fqpls.mu_rs
550
+ cctrm.powered['cct'] = Reg_Mod_FiQ.Powered()
551
+ cctrm.powered['cct'].vol.names = [name + self.transl_dict['vol'] for name in self.cctdm.geometry.windings.names + self.cctdm.geometry.fqpls.names]
552
+ cctrm.powered['cct'].vol.currents = self.cctdm.solve.windings.currents + self.cctdm.solve.fqpls.currents
553
+ cctrm.powered['cct'].vol.sigmas = self.cctdm.solve.windings.sigmas + self.cctdm.solve.fqpls.sigmas
554
+ cctrm.powered['cct'].vol.mu_rs = self.cctdm.solve.windings.mu_rs + self.cctdm.solve.fqpls.mu_rs
554
555
  reg = []
555
556
  for _ in self.cctdm.geometry.windings.names + self.cctdm.geometry.fqpls.names:
556
557
  reg.append(vrt)
557
558
  vrt += 1
558
- cctrm.powered.vol.numbers = reg
559
+ cctrm.powered['cct'].vol.numbers = reg
559
560
  # surfaces
560
- cctrm.powered.surf_in.names = [name + self.transl_dict['surf_in'] for name in self.cctdm.geometry.windings.names + self.cctdm.geometry.fqpls.names]
561
- cctrm.powered.surf_out.names = [name + self.transl_dict['surf_out'] for name in self.cctdm.geometry.windings.names + self.cctdm.geometry.fqpls.names]
561
+ cctrm.powered['cct'].surf_in.names = [name + self.transl_dict['surf_in'] for name in self.cctdm.geometry.windings.names + self.cctdm.geometry.fqpls.names]
562
+ cctrm.powered['cct'].surf_out.names = [name + self.transl_dict['surf_out'] for name in self.cctdm.geometry.windings.names + self.cctdm.geometry.fqpls.names]
562
563
  reg = []
563
564
  for _ in self.cctdm.geometry.windings.names + self.cctdm.geometry.fqpls.names:
564
565
  reg.append(srt)
565
566
  srt += 1
566
- cctrm.powered.surf_in.numbers = reg
567
+ cctrm.powered['cct'].surf_in.numbers = reg
567
568
  reg = []
568
569
  for _ in self.cctdm.geometry.windings.names + self.cctdm.geometry.fqpls.names:
569
570
  reg.append(srt)
570
571
  srt += 1
571
- cctrm.powered.surf_out.numbers = reg
572
+ cctrm.powered['cct'].surf_out.numbers = reg
572
573
 
573
574
  # -------- induced ----------
574
575
  # volumes
575
- cctrm.induced.vol.names = [name + self.transl_dict['vol'] for name in self.cctdm.geometry.formers.names]
576
- cctrm.induced.vol.sigmas = self.cctdm.solve.formers.sigmas
577
- cctrm.induced.vol.mu_rs = self.cctdm.solve.formers.mu_rs
576
+ cctrm.induced['cct'] = Reg_Mod_FiQ.Induced()
577
+ cctrm.induced['cct'].vol.names = [name + self.transl_dict['vol'] for name in self.cctdm.geometry.formers.names]
578
+ cctrm.induced['cct'].vol.sigmas = self.cctdm.solve.formers.sigmas
579
+ cctrm.induced['cct'].vol.mu_rs = self.cctdm.solve.formers.mu_rs
578
580
  reg = []
579
581
  for _ in self.cctdm.geometry.formers.names:
580
582
  reg.append(vrt)
581
583
  vrt += 1
582
- cctrm.induced.vol.numbers = reg
584
+ cctrm.induced['cct'].vol.numbers = reg
583
585
 
584
586
  # -------- air ----------
585
587
  # volumes
@@ -602,19 +604,19 @@ class Generate_BREPs:
602
604
 
603
605
  # --------- cuts -------
604
606
  # these need to be done at the end with the highest surface tags
605
- cctrm.powered.cochain.names = [name + self.transl_dict['cochain'] for name in self.cctdm.geometry.windings.names + self.cctdm.geometry.fqpls.names]
607
+ cctrm.powered['cct'].cochain.names = [name + self.transl_dict['cochain'] for name in self.cctdm.geometry.windings.names + self.cctdm.geometry.fqpls.names]
606
608
  reg = []
607
609
  for _ in self.cctdm.geometry.windings.names + self.cctdm.geometry.fqpls.names:
608
610
  reg.append(lrt)
609
611
  lrt += 1
610
- cctrm.powered.cochain.numbers = reg
612
+ cctrm.powered['cct'].cochain.numbers = reg
611
613
  # induced cuts
612
- cctrm.induced.cochain.names = [name + self.transl_dict['cochain'] for name in self.cctdm.geometry.formers.names]
614
+ cctrm.induced['cct'].cochain.names = [name + self.transl_dict['cochain'] for name in self.cctdm.geometry.formers.names]
613
615
  reg = []
614
616
  for _ in self.cctdm.geometry.formers.names:
615
617
  reg.append(lrt)
616
618
  lrt += 1
617
- cctrm.induced.cochain.numbers = reg
619
+ cctrm.induced['cct'].cochain.numbers = reg
618
620
 
619
621
  uff.write_data_to_yaml(os.path.join(self.model_folder, f'{self.cctwi.magnet_name}.regions'), cctrm.dict())
620
622