fiqus 2024.6.0__py3-none-any.whl → 2024.12.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 (69) hide show
  1. fiqus/MainFiQuS.py +290 -134
  2. fiqus/data/DataConductor.py +301 -301
  3. fiqus/data/DataFiQuS.py +128 -84
  4. fiqus/data/DataFiQuSCCT.py +150 -150
  5. fiqus/data/DataFiQuSConductor.py +84 -84
  6. fiqus/data/DataFiQuSConductorAC_Strand.py +565 -565
  7. fiqus/data/DataFiQuSMultipole.py +716 -42
  8. fiqus/data/DataFiQuSPancake3D.py +737 -278
  9. fiqus/data/DataMultipole.py +180 -15
  10. fiqus/data/DataRoxieParser.py +90 -51
  11. fiqus/data/DataSettings.py +121 -0
  12. fiqus/data/DataWindingsCCT.py +37 -37
  13. fiqus/data/RegionsModelFiQuS.py +18 -6
  14. fiqus/geom_generators/GeometryCCT.py +905 -905
  15. fiqus/geom_generators/GeometryConductorAC_Strand.py +1391 -1391
  16. fiqus/geom_generators/GeometryMultipole.py +1827 -227
  17. fiqus/geom_generators/GeometryPancake3D.py +316 -117
  18. fiqus/geom_generators/GeometryPancake3DUtils.py +549 -0
  19. fiqus/getdp_runners/RunGetdpCCT.py +4 -4
  20. fiqus/getdp_runners/RunGetdpConductorAC_Strand.py +201 -201
  21. fiqus/getdp_runners/RunGetdpMultipole.py +115 -42
  22. fiqus/getdp_runners/RunGetdpPancake3D.py +28 -6
  23. fiqus/mains/MainCCT.py +2 -2
  24. fiqus/mains/MainConductorAC_Strand.py +132 -132
  25. fiqus/mains/MainMultipole.py +113 -62
  26. fiqus/mains/MainPancake3D.py +63 -23
  27. fiqus/mesh_generators/MeshCCT.py +209 -209
  28. fiqus/mesh_generators/MeshConductorAC_Strand.py +656 -656
  29. fiqus/mesh_generators/MeshMultipole.py +1243 -181
  30. fiqus/mesh_generators/MeshPancake3D.py +275 -192
  31. fiqus/parsers/ParserCOND.py +825 -0
  32. fiqus/parsers/ParserDAT.py +16 -16
  33. fiqus/parsers/ParserGetDPOnSection.py +212 -212
  34. fiqus/parsers/ParserGetDPTimeTable.py +134 -134
  35. fiqus/parsers/ParserMSH.py +53 -53
  36. fiqus/parsers/ParserPOS.py +214 -214
  37. fiqus/parsers/ParserRES.py +142 -142
  38. fiqus/plotters/PlotPythonCCT.py +133 -133
  39. fiqus/plotters/PlotPythonConductorAC.py +855 -840
  40. fiqus/plotters/PlotPythonMultipole.py +18 -18
  41. fiqus/post_processors/PostProcessCCT.py +440 -440
  42. fiqus/post_processors/PostProcessConductorAC.py +49 -49
  43. fiqus/post_processors/PostProcessMultipole.py +353 -229
  44. fiqus/post_processors/PostProcessPancake3D.py +8 -13
  45. fiqus/pre_processors/PreProcessCCT.py +175 -175
  46. fiqus/pro_assemblers/ProAssembler.py +14 -6
  47. fiqus/pro_material_functions/ironBHcurves.pro +246 -246
  48. fiqus/pro_templates/combined/CCT_template.pro +274 -274
  49. fiqus/pro_templates/combined/ConductorAC_template.pro +1025 -1025
  50. fiqus/pro_templates/combined/Multipole_template.pro +1694 -126
  51. fiqus/pro_templates/combined/Pancake3D_template.pro +2294 -1103
  52. fiqus/pro_templates/combined/TSA_materials.pro +162 -0
  53. fiqus/pro_templates/combined/materials.pro +36 -18
  54. fiqus/utils/Utils.py +508 -110
  55. fiqus/utils/update_data_settings.py +33 -0
  56. fiqus-2024.12.0.dist-info/METADATA +130 -0
  57. fiqus-2024.12.0.dist-info/RECORD +84 -0
  58. {fiqus-2024.6.0.dist-info → fiqus-2024.12.0.dist-info}/WHEEL +1 -1
  59. tests/test_FiQuS.py +1 -1
  60. tests/test_geometry_generators.py +101 -2
  61. tests/test_mesh_generators.py +154 -1
  62. tests/test_solvers.py +115 -21
  63. tests/utils/fiqus_test_classes.py +85 -21
  64. tests/utils/generate_reference_files_ConductorAC.py +57 -57
  65. tests/utils/generate_reference_files_Pancake3D.py +4 -5
  66. tests/utils/helpers.py +97 -97
  67. fiqus-2024.6.0.dist-info/METADATA +0 -103
  68. fiqus-2024.6.0.dist-info/RECORD +0 -79
  69. {fiqus-2024.6.0.dist-info → fiqus-2024.12.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,121 @@
1
+ from typing import Literal, Optional
2
+
3
+ from pydantic import BaseModel, Field
4
+
5
+
6
+ class Condor(BaseModel):
7
+ """
8
+ Class for running using HTCondor queuing (only on Linux)
9
+ """
10
+
11
+ error: Optional[str] = Field(
12
+ default=None,
13
+ title="error",
14
+ description="Error file name and extension, like error.txt",
15
+ )
16
+ output: Optional[str] = Field(
17
+ default=None,
18
+ title="output",
19
+ description="Output file name and extension, like output.txt",
20
+ )
21
+ log: Optional[str] = Field(
22
+ default=None,
23
+ title="log",
24
+ description="Log file name and extension, like log.txt",
25
+ )
26
+ request_cpus: Optional[int] = Field(
27
+ default=None,
28
+ title="request_cpus",
29
+ description="Number of CPUs to request on each machine",
30
+ )
31
+ request_memory: Optional[str] = Field(
32
+ default=None,
33
+ title="request_memory",
34
+ description="Amount of memory to request on each machine as a string (e.g., '16G')",
35
+ )
36
+ request_disk: Optional[str] = Field(
37
+ default=None,
38
+ title="request_disk",
39
+ description="Amount of disk space to request on each machine as a string (e.g., '16G')",
40
+ )
41
+ singularity_image_path: Optional[str] = Field(
42
+ default=None,
43
+ title="SingularityImagePath",
44
+ description="Full path to Singularity image",
45
+ )
46
+ cerngetdp_version: Optional[str] = Field(
47
+ default=None,
48
+ title="CERNGetDP Version",
49
+ description="Version of CERNGetDP to be used",
50
+ )
51
+ should_transfer_files: Literal["YES", "NO"] = Field(
52
+ default="YES",
53
+ title="should_transfer_files",
54
+ description="Sets if files should be transferred",
55
+ )
56
+ max_run_time: Optional[int] = Field(
57
+ default=None,
58
+ title="MaxRuntime",
59
+ description=(
60
+ "Specifies maximum run time in seconds to request for the job to go into"
61
+ " the queue"
62
+ ),
63
+ )
64
+ eos_relative_output_path: Optional[str] = Field(
65
+ default=None,
66
+ title="eos_relative_output_path",
67
+ description=(
68
+ "This is relative path in the user eos folder. This path gets appended to"
69
+ " the root path: root://eosuser.cern.ch//eos/user/u/username"
70
+ ),
71
+ )
72
+ big_mem_job: Optional[bool] = Field(
73
+ default=None,
74
+ title="BigMemJob",
75
+ description=(
76
+ "If true a machine with 1TB of RAM and 24 cores is requested. Expect longer"
77
+ " queuing time"
78
+ ),
79
+ )
80
+
81
+ class Subproc(BaseModel):
82
+ """
83
+ Class for running using subprocess calls (on Windows)
84
+ """
85
+
86
+ executable: Optional[str] = Field(
87
+ default=None,
88
+ title="executable",
89
+ description="Executable or script to run, like run_fiqus.py",
90
+ )
91
+ full_output_path: Optional[str] = Field(
92
+ default=None,
93
+ title="full_output_path",
94
+ description="A full path to the output folder",
95
+ )
96
+
97
+
98
+ class DataSettings(BaseModel):
99
+ """
100
+ Configuration for HTCondor and
101
+ """
102
+
103
+ GetDP_path: Optional[str] = Field(
104
+ default=None,
105
+ title="GetDP_path",
106
+ description=(
107
+ "Full path to GetDP executable. This is only needed and used on Windows"
108
+ ),
109
+ )
110
+
111
+ base_path_model_files: Optional[str] = Field(
112
+ default=None,
113
+ title="base_path_model_files",
114
+ description=(
115
+ "Path to the base model folder where model files are stored that are needed to run FiQuS."
116
+ "This is only needed when the files are not in the same folder as the input yaml (e.g., on HTCondor)"
117
+ )
118
+ )
119
+
120
+ htcondor: Condor = Condor()
121
+ subproc: Subproc = Subproc()
@@ -1,37 +1,37 @@
1
- from pydantic import BaseModel
2
- from typing import List, Optional
3
-
4
-
5
- class Terminal(BaseModel):
6
- vol_st: Optional[List[int]] = None # volume number for terminal in for straightening
7
- surf_st: Optional[List[int]] = None # surface number for terminal in for straightening
8
- vol_et: Optional[List[int]] = None # volume number for terminal in for extending
9
- surf_et: Optional[List[int]] = None # surface number for terminal in for extending
10
- lc_st: Optional[List[List[List[int]]]] = None # line connections for straightening terminals
11
- lc_et: Optional[List[List[List[int]]]] = None # line connections for extending terminals
12
- z_air: Optional[float] = None
13
- z_add: Optional[float] = None
14
- ndpterms: Optional[List[int]] = None # number of divisions per terminal
15
-
16
-
17
- class Winding(BaseModel):
18
- names: Optional[List[str]] = None # name to use in gmsh and getdp
19
- t_in: Terminal = Terminal() # Terminal in
20
- t_out: Terminal = Terminal() # Terminal in
21
-
22
-
23
- class WindingsInformation(BaseModel):
24
- magnet_name: Optional[str] = None
25
- windings_avg_length: Optional[float] = None
26
- windings: Winding = Winding()
27
- w_names: Optional[List[str]] = None
28
- f_names: Optional[List[str]] = None
29
- formers: Optional[List[str]] = None
30
- air: Optional[str] = None
31
-
32
-
33
- class SpliterBrep(BaseModel): # Brep file model splitter data
34
- magnet_name: Optional[str] = None
35
- file_name: Optional[str] = None # full file name for the brep file
36
- vol_firsts: Optional[List[int]] = None # list of first volumes for the partitioned model
37
- vol_lasts: Optional[List[int]] = None # list of last volumes for the partitioned model
1
+ from pydantic import BaseModel
2
+ from typing import List, Optional
3
+
4
+
5
+ class Terminal(BaseModel):
6
+ vol_st: Optional[List[int]] = None # volume number for terminal in for straightening
7
+ surf_st: Optional[List[int]] = None # surface number for terminal in for straightening
8
+ vol_et: Optional[List[int]] = None # volume number for terminal in for extending
9
+ surf_et: Optional[List[int]] = None # surface number for terminal in for extending
10
+ lc_st: Optional[List[List[List[int]]]] = None # line connections for straightening terminals
11
+ lc_et: Optional[List[List[List[int]]]] = None # line connections for extending terminals
12
+ z_air: Optional[float] = None
13
+ z_add: Optional[float] = None
14
+ ndpterms: Optional[List[int]] = None # number of divisions per terminal
15
+
16
+
17
+ class Winding(BaseModel):
18
+ names: Optional[List[str]] = None # name to use in gmsh and getdp
19
+ t_in: Terminal = Terminal() # Terminal in
20
+ t_out: Terminal = Terminal() # Terminal in
21
+
22
+
23
+ class WindingsInformation(BaseModel):
24
+ magnet_name: Optional[str] = None
25
+ windings_avg_length: Optional[float] = None
26
+ windings: Winding = Winding()
27
+ w_names: Optional[List[str]] = None
28
+ f_names: Optional[List[str]] = None
29
+ formers: Optional[List[str]] = None
30
+ air: Optional[str] = None
31
+
32
+
33
+ class SpliterBrep(BaseModel): # Brep file model splitter data
34
+ magnet_name: Optional[str] = None
35
+ file_name: Optional[str] = None # full file name for the brep file
36
+ vol_firsts: Optional[List[int]] = None # list of first volumes for the partitioned model
37
+ vol_lasts: Optional[List[int]] = None # list of last volumes for the partitioned model
@@ -1,5 +1,5 @@
1
1
  from pydantic import BaseModel
2
- from typing import (List, Dict, Optional)
2
+ from typing import List, Dict, Union, Optional
3
3
 
4
4
 
5
5
  class Region(BaseModel):
@@ -15,7 +15,7 @@ class Regions(BaseModel):
15
15
  class TwoParBoundaryRegions(BaseModel):
16
16
  names: Optional[List[List[str]]] = None
17
17
  numbers: Optional[List[List[int]]] = None
18
- values: Optional[List[List[float]]] = None
18
+ values: Optional[List[List[Union[float, str]]]] = None
19
19
 
20
20
 
21
21
  class OneParBoundaryRegions(BaseModel):
@@ -96,6 +96,7 @@ class Powered(BaseModel):
96
96
 
97
97
  class Induced(BaseModel):
98
98
  vol: InducedRegions = InducedRegions() # volume region
99
+ surf_th: Regions = Regions() # surface region
99
100
  surf_in: Regions = Regions() # input terminal surface region
100
101
  surf_out: Regions = Regions() # output terminal surface region
101
102
  cochain: Regions = Regions() # winding cochain (cut)
@@ -115,8 +116,8 @@ class Iron(BaseModel):
115
116
  class Air(BaseModel):
116
117
  vol: AirRegion = AirRegion() # volume region
117
118
  surf: Region = Region() # surface region
118
- line: Region = Region() # line region
119
- point: Regions = Regions() # point region
119
+ line: Region = Region() # line region
120
+ point: Regions = Regions() # point region
120
121
  cochain: Regions = Regions() # air cochain (cut)
121
122
 
122
123
 
@@ -171,6 +172,9 @@ class InsulationType(BaseModel):
171
172
  thin_shells: List[List[int]] = []
172
173
  layers_material: List[List[str]] = []
173
174
  thicknesses: List[List[float]] = []
175
+ label: List[List[Union[int, None]]] = (
176
+ []
177
+ ) # useful to indicate which quench heater a SS element refers to
174
178
 
175
179
 
176
180
  class ThinShell(BaseModel):
@@ -182,9 +186,14 @@ class ThinShell(BaseModel):
182
186
  quench_heaters: InsulationType = InsulationType()
183
187
 
184
188
 
189
+ class PostProc(BaseModel):
190
+ vol: Regions = Regions() # postprocessing volumes general
191
+ surf: Regions = Regions() # postprocessing volumes general
192
+ line: Regions = Regions() # postprocessing volumes general
193
+ point: Regions = Regions() # postprocessing volumes general
194
+
195
+
185
196
  class RegionsModel(BaseModel):
186
- # powered: Powered = Powered()
187
- # induced: Induced = Induced()
188
197
  powered: Dict[str, Powered] = {}
189
198
  induced: Dict[str, Induced] = {}
190
199
  insulator: Insulator = Insulator()
@@ -192,7 +201,10 @@ class RegionsModel(BaseModel):
192
201
  air: Air = Air()
193
202
  air_far_field: AirFarField = AirFarField()
194
203
  thin_shells: ThinShell = ThinShell()
204
+ projection_points: Region = Region()
195
205
  boundaries: BoundaryConditions = BoundaryConditions()
206
+ postproc_th: PostProc = PostProc()
207
+ postproc_em: PostProc = PostProc()
196
208
 
197
209
 
198
210
  # if __name__ == "__main__":