Coverage for fiqus/data/DataFiQuSMultipole.py: 100%
159 statements
« prev ^ index » next coverage.py v7.4.4, created at 2025-01-14 02:37 +0100
« prev ^ index » next coverage.py v7.4.4, created at 2025-01-14 02:37 +0100
1from pydantic import BaseModel, Field
2from typing import List, Dict, Literal, Union, Optional, Tuple
5class MultipoleGeoElement(BaseModel):
6 """
7 Level 5: Class for FiQuS Multipole
8 """
9 lines: Optional[int] = Field(
10 default=3,
11 description="It specifies the number of Gaussian points for lines.",
12 )
13 triangles: Optional[Literal[1, 3, 4, 6, 7, 12, 13, 16]] = Field(
14 default=3,
15 description="It specifies the number of Gaussian points for triangles.",
16 )
17 quadrangles: Optional[Literal[1, 3, 4, 7]] = Field(
18 default=4,
19 description="It specifies the number of Gaussian points for quadrangles.",
20 )
23class MultipoleSolveConvectionBoundaryCondition(BaseModel):
24 """
25 Level 5: Class for FiQuS Multipole
26 """
27 boundaries: Optional[List[str]] = Field(
28 default=[],
29 description="It specifies the list of boundaries where the condition is applied."
30 "Each boundary is identified by a string of the form <half-turn/wedge reference number><side>,"
31 "where the accepted sides are i, o, l, h which correspond respectively to inner, outer, lower (angle), higher (angle): e.g., 1o",
32 )
33 heat_transfer_coefficient: Optional[Union[float, str]] = Field(
34 default=None,
35 description="It specifies the value or function name of the heat transfer coefficient for this boundary condition.",
36 )
39class MultipoleSolveHeatFluxBoundaryCondition(BaseModel):
40 """
41 Level 5: Class for FiQuS Multipole
42 """
43 boundaries: Optional[List[str]] = Field(
44 default=[],
45 description="It specifies the list of boundaries where the condition is applied."
46 "Each boundary is identified by a string of the form <half-turn/wedge reference number><side>,"
47 "where the accepted sides are i, o, l, h which correspond respectively to inner, outer, lower (angle), higher (angle): e.g., 1o",
48 )
49 const_heat_flux: Optional[float] = Field(
50 default=None,
51 description="It specifies the value of the heat flux for this boundary condition.",
52 )
53 # function_heat_flux: Optional[str] = None
56class MultipoleSolveTemperatureBoundaryCondition(BaseModel):
57 """
58 Level 5: Class for FiQuS Multipole
59 """
60 boundaries: Optional[List[str]] = Field(
61 default=[],
62 description="It specifies the list of boundaries where the condition is applied."
63 "Each boundary is identified by a string of the form <half-turn/wedge reference number><side>,"
64 "where the accepted sides are i, o, l, h which correspond respectively to inner, outer, lower (angle), higher (angle): e.g., 1o",
65 )
66 const_temperature: Optional[float] = Field(
67 default=None,
68 description="It specifies the value of the temperature for this boundary condition.",
69 )
70 # function_temperature: Optional[str] = None
73class MultipoleSolveQuenchInitiation(BaseModel):
74 """
75 Level 4: Class for FiQuS Multipole
76 """
77 turns: Optional[List[int]] = Field(
78 default=[],
79 description="It specifies the list of reference numbers of half-turns whose critical currents are set to zero.",
80 )
81 t_trigger: Optional[List[float]] = Field(
82 default=[],
83 description="It specifies the list of time instants at which the critical current is set to zero.",
84 )
87class MultipoleSolveBoundaryConditionsThermal(BaseModel):
88 """
89 Level 4: Class for FiQuS Multipole
90 """
91 temperature: Optional[Dict[str, MultipoleSolveTemperatureBoundaryCondition]] = Field(
92 default={},
93 description="This dictionary contains the information about the Dirichlet boundary conditions."
94 "The keys are chosen names for each boundary condition.",
95 )
96 heat_flux: Optional[Dict[str, MultipoleSolveHeatFluxBoundaryCondition]] = Field(
97 default={},
98 description="This dictionary contains the information about the Neumann boundary conditions."
99 "The keys are chosen names for each boundary condition.",
100 )
101 cooling: Optional[Dict[str, MultipoleSolveConvectionBoundaryCondition]] = Field(
102 default={},
103 description="This dictionary contains the information about the Robin boundary conditions."
104 "The keys are chosen names for each boundary condition.",
105 )
108# class MultipoleSolveTransientElectromagnetics(BaseModel):
109# """
110# Level 4: Class for FiQuS Multipole
111# """
112# time_stepping: Optional[Literal["adaptive", "fixed"]] = Field(
113# default="adaptive",
114# description="It specifies the type of time stepping.",
115# )
116# initial_time: Optional[float] = Field(
117# default=0.,
118# description="It specifies the initial time of the simulation.",
119# )
120# final_time: Optional[float] = Field(
121# default=None,
122# description="It specifies the final time of the simulation.",
123# )
124# fixed: MultipoleSolveTimeParametersFixed = Field(
125# default=MultipoleSolveTimeParametersFixed(),
126# description="This dictionary contains the information about the time parameters of the fixed time stepping.",
127# )
128# adaptive: MultipoleSolveTimeParametersAdaptive = Field(
129# default=MultipoleSolveTimeParametersAdaptive(),
130# description="This dictionary contains the information about the time parameters of the adaptive time stepping.",
131# )
134class MultipoleSolveHeCooling(BaseModel):
135 """
136 Level 4: Class for FiQuS Multipole
137 """
138 enabled: Optional[bool] = Field(
139 default=False,
140 description="It determines whether the helium cooling is enabled or not (adiabatic conditions).",
141 )
142 sides: Optional[Literal["external", "inner", "outer", "inner_outer"]] = Field(
143 default="outer",
144 description="It specifies the general grouping of the boundaries where to apply cooling:"
145 "'external': all external boundaries; 'inner': only inner boundaries; 'outer': only outer boundaries; 'inner_outer': inner and outer boundaries.",
146 )
147 heat_transfer_coefficient: Optional[Union[float, str]] = Field(
148 default=0.0,
149 description="It specifies the value or name of the function of the constant heat transfer coefficient.",
150 )
152class MultipoleSolveNonLinearSolver(BaseModel):
153 """
154 Level 4: Class for FiQuS Multipole
155 """
156 rel_tolerance: Optional[float] = Field(
157 default=1E-4,
158 description="It specifies the relative tolerance.",
159 )
160 abs_tolerance: Optional[float] = Field(
161 default=0.1,
162 description="It specifies the absolute tolerance.",
163 )
164 relaxation_factor: Optional[float] = Field(
165 default=0.7,
166 description="It specifies the relaxation factor.",
167 )
168 max_iterations: Optional[int] = Field(
169 default=20,
170 description="It specifies the maximum number of iterations if no convergence is reached.",
171 )
172 norm_type: Literal["L1Norm", "MeanL1Norm", "L2Norm", "MeanL2Norm", "LinfNorm"] = Field(
173 default='LinfNorm',
174 description="It specifies the type of norm to be calculated for convergence assessment.",
175 )
178class MultipoleSolveTransientThermal(BaseModel):
179 """
180 Level 4: Class for FiQuS Multipole
181 """
182 initial_time: Optional[float] = Field(
183 default=0.,
184 description="It specifies the initial time of the simulation.",
185 )
186 final_time: Optional[float] = Field(
187 default=None,
188 description="It specifies the final time of the simulation.",
189 )
190 initial_time_step: Optional[float] = Field(
191 default=1E-10,
192 description="It specifies the initial time step used at the beginning of the transient simulation.",
193 )
194 min_time_step: Optional[float] = Field(
195 default=1E-12,
196 description="It specifies the minimum possible value of the time step.",
197 )
198 max_time_step: Optional[float] = Field(
199 default=10,
200 description="It specifies the maximum possible value of the time step.",
201 )
202 breakpoints: Optional[List[float]] = Field(
203 default=[],
204 description="It forces the transient simulation to hit the time instants contained in this list.",
205 )
206 integration_method: Union[None, Literal[
207 "Euler", "Gear_2", "Gear_3", "Gear_4", "Gear_5", "Gear_6"
208 ]] = Field(
209 default="Euler",
210 title="Integration Method",
211 description="It specifies the type of integration method to be used.",
212 )
213 rel_tol_time: Optional[float] = Field(
214 default=1E-4,
215 description="It specifies the relative tolerance.",
216 )
217 abs_tol_time: Optional[float] = Field(
218 default=1e-4,
219 description="It specifies the absolute tolerance.",
220 )
221 norm_type: Literal["L1Norm", "MeanL1Norm", "L2Norm", "MeanL2Norm", "LinfNorm"] = Field(
222 default='LinfNorm',
223 description="It specifies the type of norm to be calculated for convergence assessment.",
224 )
225 stop_temperature: Optional[float] = Field(
226 default=300,
227 description="If one half turn reaches this temperature, the simulation is stopped.",
228 )
231class MultipoleSolveInsulationBlockToBlock(BaseModel):
232 """
233 Level 4: Class for FiQuS Multipole
234 It contains the information about the materials and thicknesses of the inner insulation regions (between blocks) modeled via thin-shell approximation.
235 """
236 material: Optional[str] = Field(
237 default=None,
238 description="It specifies the default material of the insulation regions between the blocks insulation regions.",
239 )
240 # the order of blocks should be: [inner, outer] for mid-layer couples or [lower, higher] for mid-pole and mid-winding couples
241 blocks_connection_overwrite: List[Tuple[str, str]] = Field(
242 default=[],
243 description="It specifies the blocks couples adjacent to the insulation region."
244 "The blocks must be ordered from inner to outer block for mid-layer insulation regions and from lower to higher angle block for mid-pole and mid-winding insulation regions.",
245 )
246 materials_overwrite: Optional[List[List[str]]] = Field(
247 default=[],
248 description="It specifies the list of materials making up the layered insulation region to be placed between the specified blocks."
249 "The materials must be ordered from inner to outer layers and lower to higher angle layers.",
250 )
251 thicknesses_overwrite: Optional[List[List[Optional[float]]]] = Field(
252 default=[],
253 description="It specifies the list of thicknesses of the specified insulation layers. The order must match the one of the materials list.",
254 )
257class MultipoleSolveInsulationExterior(BaseModel):
258 """
259 Level 4: Class for FiQuS Multipole
260 It contains the information about the materials and thicknesses of the outer insulation regions (exterior boundaries) modeled via thin-shell approximation.
261 """
262 blocks: Optional[List[str]] = Field(
263 default=[],
264 description="It specifies the reference numbers of the blocks adjacent to the exterior insulation regions to modify.",
265 )
266 materials_append: Optional[List[List[str]]] = Field(
267 default=[],
268 description="It specifies the list of materials making up the layered insulation region to be appended to the block insulation."
269 "The materials must be ordered from the block outward.",
270 )
271 thicknesses_append: Optional[List[List[float]]] = Field(
272 default=[],
273 description="It specifies the list of thicknesses of the specified insulation layers. The order must match the one of the materials list.",
274 )
277class MultipoleSolveWedge(BaseModel):
278 """
279 Level 3: Class for FiQuS Multipole
280 """
281 material: Optional[str] = Field(
282 default=None,
283 description="It specifies the material of the wedge regions.",
284 )
285 RRR: Optional[float] = Field(
286 default=None,
287 description="It specifies the RRR of the wedge regions.",
288 )
289 T_ref_RRR_high: Optional[float] = Field(
290 default=None,
291 description="It specifies the reference temperature associated with the RRR.",
292 )
295class MultipoleSolveInsulationTSA(BaseModel):
296 """
297 Level 3: Class for FiQuS Multipole
298 """
299 block_to_block: MultipoleSolveInsulationBlockToBlock = Field(
300 default=MultipoleSolveInsulationBlockToBlock(),
301 description="This dictionary contains the information about the materials and thicknesses of the inner insulation regions (between blocks) modeled via thin-shell approximation.",
302 )
303 exterior: Optional[MultipoleSolveInsulationExterior] = Field(
304 default=MultipoleSolveInsulationExterior(),
305 description="This dictionary contains the information about the materials and thicknesses of the outer insulation regions (exterior boundaries) modeled via thin-shell approximation.",
306 )
309class MultipoleSolveThermal(BaseModel):
310 """
311 Level 3: Class for FiQuS Multipole
312 """
313 solve_type: Optional[Literal[None, "transient"]] = Field(
314 default=None,
315 description="It determines whether the thermal transient problem is solved ('transient') or not ('null').",
316 )
317 insulation_TSA: Optional[MultipoleSolveInsulationTSA] = Field(
318 default=MultipoleSolveInsulationTSA(),
319 description="This dictionary contains the information about the materials and thicknesses of the insulation regions modeled via thin-shell approximation.",
320 )
321 He_cooling: MultipoleSolveHeCooling = Field(
322 default=MultipoleSolveHeCooling(),
323 description="This dictionary contains the information about the Robin boundary condition for generic groups of boundaries.",
324 )
325 overwrite_boundary_conditions: Optional[MultipoleSolveBoundaryConditionsThermal] = Field(
326 default=MultipoleSolveBoundaryConditionsThermal(),
327 description="This dictionary contains the information about boundary conditions for explicitly specified boundaries.",
328 )
329 non_linear_solver: MultipoleSolveNonLinearSolver = Field(
330 default=MultipoleSolveNonLinearSolver(),
331 description="This dictionary contains the information about the parameters for the non-linear solver.",
332 )
333 time_stepping: MultipoleSolveTransientThermal = Field(
334 default=MultipoleSolveTransientThermal(),
335 description="This dictionary contains the information about the parameters for the transient solver.",
336 )
337 jc_degradation_to_zero: Optional[MultipoleSolveQuenchInitiation] = Field(
338 default=MultipoleSolveQuenchInitiation(),
339 description="This dictionary contains the information about half turns with zero critical current.",
340 )
341 init_temperature: Optional[float] = Field(
342 default=1.9,
343 description="It specifies the initial temperature of the simulation.",
344 )
345 enforce_init_temperature_as_minimum: Optional[bool] = Field(
346 default=False,
347 description="It determines whether the initial temperature is enforced as the minimum temperature of the simulation.",
348 )
350class MultipoleSolveElectromagnetics(BaseModel):
351 """
352 Level 3: Class for FiQuS Multipole
353 """
354 solve_type: Optional[Literal[None, "stationary"]] = Field(
355 default=None,
356 description="It determines whether the magneto-static problem is solved ('stationary') or not ('null').",
357 )
359 non_linear_solver: MultipoleSolveNonLinearSolver = Field(
360 default=MultipoleSolveNonLinearSolver(),
361 description="This dictionary contains the information about the parameters for the non-linear solver.",
362 )
363 # currently not needed since stationary only, we will be able to reuse it from the thermal solver
364 # time_stepping_parameters: MultipoleSolveTransientElectromagnetics = Field(
365 # default=MultipoleSolveTransientElectromagnetics(),
366 # description="This dictionary contains the information about the parameters for the transient solver.",
367 # )
370class MultipoleMeshThinShellApproximationParameters(BaseModel):
371 """
372 Level 4: Class for FiQuS Multipole
373 """
374 minimum_discretizations: Optional[int] = Field(
375 default=1,
376 description="It specifies the number of minimum spacial discretizations across a thin-shell.",
377 )
378 global_size_QH: Optional[float] = Field(
379 default=1e-4,
380 description="The thickness of the quench heater region is divided by this parameter to determine the number of spacial discretizations across the thin-shell.",
381 )
382 minimum_discretizations_QH: Optional[int] = Field(
383 default=1,
384 description="It specifies the number of minimum spacial discretizations across a thin-shell.",
385 )
388class MultipoleMeshThreshold(BaseModel):
389 """
390 Level 3: Class for FiQuS Multipole
391 """
392 enabled: Optional[bool] = Field(
393 default=False,
394 description="It determines whether the gmsh Field is enabled or not.",
395 )
396 SizeMin: Optional[float] = Field(
397 default=None,
398 description="It sets gmsh Mesh.MeshSizeMin.",
399 )
400 SizeMax: Optional[float] = Field(
401 default=None,
402 description="It sets gmsh Mesh.MeshSizeMax.",
403 )
404 DistMin: Optional[float] = Field(
405 default=None,
406 description="It sets gmsh Mesh.MeshDistMin.",
407 )
408 DistMax: Optional[float] = Field(
409 default=None,
410 description="It sets gmsh Mesh.MeshDistMax.",
411 )
413class MultipoleMeshTransfinite(BaseModel):
414 """
415 Level 3: Class for FiQuS Multipole
416 """
417 enabled_for: Literal[None, "curves", "curves_and_surfaces"] = Field(
418 default=None,
419 description="It determines on what entities the transfinite algorithm is applied.",
420 )
421 curve_target_size_height: Optional[float] = Field(
422 default=1.0,
423 description="The height of the region (short side) is divided by this parameter to determine the number of elements to apply via transfinite curves.",
424 )
425 curve_target_size_width: Optional[float] = Field(
426 default=1.0,
427 description="The width of the region (long side) is divided by this parameter to determine the number of elements to apply via transfinite curves.",
428 )
429class MultipoleMeshTransfiniteOrField(BaseModel):
430 """
431 Level 3: Class for FiQuS Multipole
432 """
433 transfinite: MultipoleMeshTransfinite = Field(
434 default=MultipoleMeshTransfinite(),
435 description="This dictionary contains the mesh information for transfinite curves.",
436 )
437 field: MultipoleMeshThreshold = Field(
438 default=MultipoleMeshThreshold(),
439 description="This dictionary contains the gmsh Field information.",
440 )
442class MultipolePostProcThermal(BaseModel):
443 """
444 Level 2: Class for FiQuS Multipole
445 """
446 output_time_steps_pos: Optional[Union[bool, int]] = Field(
447 default=True,
448 description="It determines whether the solution for the .pos file is saved for all time steps (True), none (False), or equidistant time steps (int).",
449 )
450 output_time_steps_txt: Optional[Union[bool, int]] = Field(
451 default=True,
452 description="It determines whether the solution for the .txt file is saved for all time steps (True), none (False), or equidistant time steps (int).",
453 )
454 save_pos_at_the_end: Optional[bool] = Field(
455 default=True,
456 description="It determines whether the solution for the .pos file is saved at the end of the simulation or during run time.",
457 )
458 save_txt_at_the_end: Optional[bool] = Field(
459 default=False,
460 description="It determines whether the solution for the .txt file is saved at the end of the simulation or during run time.",
461 )
462 take_average_conductor_temperature: Optional[bool] = Field(
463 default=True,
464 description="It determines whether the output files are based on the average conductor temperature or not (map2d).",
465 )
466 plot_all: Optional[Union[bool, None]] = Field(
467 default=False,
468 description="It determines whether the figures are generated and shown (true), generated only (null), or not generated (false). Useful for tests.",
469 )
470 variables: Optional[List[Literal["T", "jOverJc", "rho"]]] = Field(
471 default=["T"],
472 description="It specifies the physical quantity to be output.",
473 )
474 volumes: Optional[List[
475 Literal["omega", "powered", "induced", "iron", "conducting", "insulator"]]] = Field(
476 default=["powered"],
477 description="It specifies the regions associated with the physical quantity to be output.",
478 )
481class MultipolePostProcElectromagnetics(BaseModel):
482 """
483 Level 2: Class for FiQuS Multipole
484 """
485 output_time_steps_pos: Optional[Union[bool, int]] = Field(
486 default=True,
487 description="It determines whether the solution for the .pos file is saved for all time steps (True), none (False), or equidistant time steps (int).",
488 )
489 output_time_steps_txt: Optional[Union[bool, int]] = Field(
490 default=True,
491 description="It determines whether the solution for the .txt file is saved for all time steps (True), none (False), or equidistant time steps (int).",
492 )
493 save_pos_at_the_end: Optional[bool] = Field(
494 default=True,
495 description="It determines whether the solution for the .pos file is saved at the end of the simulation or during run time.",
496 )
497 save_txt_at_the_end: Optional[bool] = Field(
498 default=False,
499 description="It determines whether the solution for the .txt file is saved at the end of the simulation or during run time.",
500 )
501 compare_to_ROXIE: Optional[str] = Field(
502 default=None,
503 description="It contains the absolute path to a reference ROXIE map2d file. If provided, comparative plots with respect to the reference are generated.",
504 )
505 plot_all: Optional[Union[bool, None]] = Field(
506 default=False,
507 description="It determines whether the figures are generated and shown (true), generated only (null), or not generated (false). Useful for tests.",
508 )
509 variables: Optional[List[Literal["a", "az", "b", "h", "js"]]] = Field(
510 default=["b"],
511 description="It specifies the physical quantity to be output.",
512 )
513 volumes: Optional[List[
514 Literal["omega", "powered", "induced", "air", "air_far_field", "iron", "conducting", "insulator"]]] = Field(
515 default=["powered"],
516 description="It specifies the regions associated with the physical quantity to be output.",
517 )
520class MultipolePostProc(BaseModel):
521 """
522 Level 2: Class for FiQuS Multipole
523 """
524 electromagnetics: MultipolePostProcElectromagnetics = Field(
525 default=MultipolePostProcElectromagnetics(),
526 description="This dictionary contains the post-processing information for the electromagnetic solution.",
527 )
528 thermal: MultipolePostProcThermal = Field(
529 default=MultipolePostProcThermal(),
530 description="This dictionary contains the post-processing information for the thermal solution.",
531 )
534class MultipoleSolve(BaseModel):
535 """
536 Level 2: Class for FiQuS Multipole
537 """
538 electromagnetics: MultipoleSolveElectromagnetics = Field(
539 default=MultipoleSolveElectromagnetics(),
540 description="This dictionary contains the solver information for the electromagnetic solution.",
541 )
542 thermal: MultipoleSolveThermal = Field(
543 default=MultipoleSolveThermal(),
544 description="This dictionary contains the solver information for the thermal solution.",
545 )
546 wedges: MultipoleSolveWedge = Field(
547 default=MultipoleSolveWedge(),
548 description="This dictionary contains the material information of wedges.",
549 )
550 noOfMPITasks: Optional[Union[bool, int]] = Field(
551 default=False,
552 title="No. of tasks for MPI parallel run of GetDP",
553 description=(
554 "If integer, GetDP will be run in parallel using MPI. This is only valid"
555 " if MPI is installed on the system and an MPI-enabled GetDP is used."
556 " If False, GetDP will be run in serial without invoking mpiexec."
557 ),
558 )
560class MultipoleThermalInsulationMesh(BaseModel):
561 """
562 Level 3: Class for FiQuS Multipole
563 """
564 global_size: float = Field(
565 default=1e-4,
566 description="It specifies the global size of the mesh for the insulation regions. It is enforced as a constant mesh field for surface insulation and by fixing the number of TSA layers for thin-shell approximation.",
567 )
568 TSA: Optional[MultipoleMeshThinShellApproximationParameters] = Field(
569 default=MultipoleMeshThinShellApproximationParameters(),
570 description="This dictionary contains the mesh information for thin-shells.",
571 )
573class MultipoleMeshThermal(BaseModel):
574 """
575 Level 2: Class for FiQuS Multipole
576 """
577 create: bool = Field(
578 default=True,
579 description="It determines whether the thermal mesh is built or not.",
580 )
581 conductors: Optional[MultipoleMeshTransfiniteOrField] = Field(
582 default=MultipoleMeshTransfiniteOrField(),
583 description="This dictionary contains the mesh information for the conductor regions.",
584 )
585 wedges: Optional[MultipoleMeshTransfiniteOrField] = Field(
586 default=MultipoleMeshTransfiniteOrField(),
587 description="This dictionary contains the mesh information for the wedge regions.",
588 )
589 iron_field: Optional[MultipoleMeshThreshold] = Field(
590 default=MultipoleMeshThreshold(),
591 description="This dictionary contains the gmsh Field information for the iron yoke region.",
592 )
593 insulation: Optional[MultipoleThermalInsulationMesh] = Field(
594 default=MultipoleThermalInsulationMesh(),
595 description="This dictionary contains the mesh information for the insulation regions.",
596 )
598 iron_field: Optional[MultipoleMeshThreshold] = Field(
599 default=MultipoleMeshThreshold(),
600 description="This dictionary contains the gmsh Field information for the iron yoke region.",
601 )
603 isothermal_conductors: Optional[bool] = Field(
604 default=False,
605 description="It determines whether the conductors are considered isothermal or not using getDP constraints.",
606 )
607 isothermal_wedges: Optional[bool] = Field(
608 default=False,
609 description="It determines whether the wedges are considered isothermal or not using getDP Link constraints.",
610 )
612class MultipoleMeshElectromagnetics(BaseModel):
613 """
614 Level 2: Class for FiQuS Multipole
615 """
616 create: bool = Field(
617 default=True,
618 description="It determines whether the electromagnetic mesh is built or not.",
619 )
620 conductors: Optional[MultipoleMeshTransfiniteOrField] = Field(
621 default=MultipoleMeshTransfiniteOrField(),
622 description="This dictionary contains the mesh information for the conductor regions.",
623 )
624 wedges: Optional[MultipoleMeshTransfiniteOrField] = Field(
625 default=MultipoleMeshTransfiniteOrField(),
626 description="This dictionary contains the mesh information for the wedge regions.",
627 )
628 iron_field: Optional[MultipoleMeshThreshold] = Field(
629 default=MultipoleMeshThreshold(),
630 description="This dictionary contains the gmsh Field information for the iron yoke region.",
631 )
632 bore_field: Optional[MultipoleMeshThreshold] = Field(
633 default=MultipoleMeshThreshold(),
634 description="This dictionary contains the gmsh Field information for the bore region.",
635 )
637class MultipoleMesh(BaseModel):
638 """
639 Level 2: Class for FiQuS Multipole
640 """
641 electromagnetics: MultipoleMeshElectromagnetics = Field(
642 default=MultipoleMeshElectromagnetics(),
643 description="This dictionary contains the mesh information for the electromagnetic solution.",
644 )
645 thermal: MultipoleMeshThermal = Field(
646 default=MultipoleMeshThermal(),
647 description="This dictionary contains the mesh information for the thermal solution.",
648 )
651class MultipoleGeometryThermal(BaseModel):
652 """
653 Level 2: Class for FiQuS Multipole
654 """
655 create: bool = Field(
656 default=True,
657 description="It determines whether the thermal geometry is built or not.",
658 )
659 with_iron_yoke: Optional[bool] = Field(
660 default=False,
661 description="It determines whether the iron yoke region is built or not.",
662 )
663 with_wedges: Optional[bool] = Field(
664 default=True,
665 description="It determines whether the wedge regions are built or not.",
666 )
667 use_TSA: Optional[bool] = Field(
668 default=False,
669 description="It determines whether the insulation regions are explicitly built or modeled via thin-shell approximation.",
670 )
671 correct_block_coil_tsa_checkered_scheme: Optional[bool] = Field(
672 default=False,
673 description="There is a bug in the TSA naming scheme for block coils, this flag activates a simple (not clean) bug fix that will be replaced in a future version.",
674 )
676class MultipoleGeometryElectromagnetics(BaseModel):
677 """
678 Level 2: Class for FiQuS Multipole
679 """
680 create: bool = Field(
681 default=True,
682 description="It determines whether the electromagnetic geometry is built or not.",
683 )
684 with_iron_yoke: Optional[bool] = Field(
685 default=True,
686 description="It determines whether the iron yoke region is built or not.",
687 )
688 with_wedges: Optional[bool] = Field(
689 default=True,
690 description="It determines whether the wedge regions are built or not.",
691 )
692 symmetry: Optional[Literal["none", "xy", "x", "y"]] = Field(
693 default='none',
694 description="It determines the model regions to build according to the specified axis/axes.",
695 )
698class MultipoleGeometry(BaseModel):
699 """
700 Level 2: Class for FiQuS Multipole
701 """
702 geom_file_path: Optional[str] = Field(
703 default=None,
704 description="It contains the path to a .geom file. If null, the default .geom file produced by steam-sdk BuilderFiQuS will be used.",
705 )
706 plot_preview: Optional[bool] = Field(
707 default=False,
708 description="If true, it displays matplotlib figures of the magnet geometry with relevant information (e.g., conductor and block numbers).",
709 )
710 electromagnetics: MultipoleGeometryElectromagnetics = Field(
711 default=MultipoleGeometryElectromagnetics(),
712 description="This dictionary contains the geometry information for the electromagnetic solution.",
713 )
714 thermal: MultipoleGeometryThermal = Field(
715 default=MultipoleGeometryThermal(),
716 description="This dictionary contains the geometry information for the thermal solution.",
717 )
720class Multipole(BaseModel):
721 """
722 Level 1: Class for FiQuS Multipole
723 """
724 type: Literal["multipole"] = "multipole"
725 geometry: MultipoleGeometry = Field(
726 default=MultipoleGeometry(),
727 description="This dictionary contains the geometry information.",
728 )
729 mesh: MultipoleMesh = Field(
730 default=MultipoleMesh(),
731 description="This dictionary contains the mesh information.",
732 )
733 solve: MultipoleSolve = Field(
734 default=MultipoleSolve(),
735 description="This dictionary contains the solution information.",
736 )
737 postproc: MultipolePostProc = Field(
738 default=MultipolePostProc(),
739 description="This dictionary contains the post-process information.",
740 )