Commit 8db4231
authored
ThinCurr: Improvements to mesh/model handling and HODLR compression (OpenFUSIONToolkit#332)
- Support resistivity and coil definitions within the mesh file itself, instead of relying on a separate XML file
* Separate holes and jumpers in mesh definition for improved clarity
* Holes are now checked when a model is loaded, using the automated script, to avoid accidentally loading malformed meshes
* Define coils generically in file to enable runtime selection of Icoil vs Vcoil
* Add a new `OFT_ThinCurr_mesh.py` script that can be used set the above properties and modify/merge ThinCurr mesh files
- Improve HODLR performance and robustness
* HODLR tolerances can now be set from within the Python API using `set_hodlr_options()`
* HODLR tolerances now support mesh-relative setting using the average cell size (default)
* Improve data-locality in parallelization of HODLR operators
- Improve the performance of the hole-finding script `OFT_ThinCurr_holes.py`
- Add support for variable timestep size in `ThinCurr.run_td()` (requires `direct=False`)
- Increase magnetic field operator finite-difference step size and make user-configurable
- Update Icoil source handling in `ThinCurr.run_td()` to be more consistent across Vcoil/Icoil usage
- Reported iterations/time in `ThinCurr.run_td()` are now the average across the printing frequency
- Standardize mesh reading and writing across Python API
- Add documentation pages for all OFT python scripts (eg. `OFT_convert_Cubit.py`)
- Remove legacy ThinCurr fortran executables
This PR makes the following **changes to default settings/behavior**:
- The default tolerances for HODLR operators are now mesh size based (10E-5; relative and scaling with RMS edge size)
- The default step size for mesh B-field calculations is larger and mesh based (1E-2; relative and scaling with RMS edge size)
This PR makes the following **backwards-compatible changes to the Python API**:
- A new `no_verify_holes` argument to `ThinCurr.setup_model()` to optionally skip the newly added hole verification on model load
- A new `B_dx` argument to `ThinCurr.compute_Bmat()` to set the finite difference step size
- A new `times` argument to `ThinCurr.run_td()` to enable specifying variable timesteps in a simulation
- A new `ThinCurr.set_hodlr_options()` method to enable adjusting HODLR tolerances and other parameters
- A new `ThinCurr.update_coil_types()` method to enable setting coil types (`Icoil` or `Vcoil`) at runtime
--------------
Co-authored by: Claude Opus 4.81 parent d08f001 commit 8db4231
69 files changed
Lines changed: 3420 additions & 3281 deletions
File tree
- src
- base
- bin
- docs
- ThinCurr
- grid
- physics
- python
- OpenFUSIONToolkit
- ThinCurr
- scripts
- wrappers
- tests
- grid
- physics
- utilities
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
68 | 65 | | |
69 | | - | |
| 66 | + | |
70 | 67 | | |
| 68 | + | |
71 | 69 | | |
72 | 70 | | |
73 | 71 | | |
| |||
195 | 193 | | |
196 | 194 | | |
197 | 195 | | |
198 | | - | |
| 196 | + | |
199 | 197 | | |
200 | 198 | | |
201 | 199 | | |
| |||
430 | 428 | | |
431 | 429 | | |
432 | 430 | | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
433 | 434 | | |
434 | 435 | | |
435 | 436 | | |
| |||
533 | 534 | | |
534 | 535 | | |
535 | 536 | | |
536 | | - | |
537 | | - | |
538 | | - | |
| 537 | + | |
539 | 538 | | |
540 | 539 | | |
541 | 540 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
589 | 590 | | |
590 | 591 | | |
591 | 592 | | |
592 | | - | |
| 593 | + | |
| 594 | + | |
593 | 595 | | |
594 | 596 | | |
595 | 597 | | |
| |||
604 | 606 | | |
605 | 607 | | |
606 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
607 | 623 | | |
608 | 624 | | |
609 | 625 | | |
610 | 626 | | |
611 | 627 | | |
612 | 628 | | |
613 | 629 | | |
614 | | - | |
615 | | - | |
616 | 630 | | |
617 | 631 | | |
618 | 632 | | |
| |||
634 | 648 | | |
635 | 649 | | |
636 | 650 | | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
645 | 674 | | |
| 675 | + | |
| 676 | + | |
646 | 677 | | |
647 | 678 | | |
648 | 679 | | |
| |||
1204 | 1235 | | |
1205 | 1236 | | |
1206 | 1237 | | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
1207 | 1283 | | |
1208 | 1284 | | |
1209 | | - | |
1210 | | - | |
| 1285 | + | |
| 1286 | + | |
1211 | 1287 | | |
1212 | 1288 | | |
1213 | 1289 | | |
| |||
1217 | 1293 | | |
1218 | 1294 | | |
1219 | 1295 | | |
1220 | | - | |
| 1296 | + | |
1221 | 1297 | | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
1222 | 1301 | | |
1223 | | - | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
1224 | 1305 | | |
1225 | 1306 | | |
1226 | 1307 | | |
1227 | 1308 | | |
1228 | 1309 | | |
1229 | | - | |
1230 | | - | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
1231 | 1313 | | |
1232 | | - | |
| 1314 | + | |
1233 | 1315 | | |
1234 | 1316 | | |
1235 | 1317 | | |
1236 | 1318 | | |
| 1319 | + | |
1237 | 1320 | | |
1238 | 1321 | | |
1239 | 1322 | | |
| |||
1244 | 1327 | | |
1245 | 1328 | | |
1246 | 1329 | | |
1247 | | - | |
1248 | | - | |
1249 | | - | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
1250 | 1334 | | |
1251 | | - | |
| 1335 | + | |
1252 | 1336 | | |
1253 | 1337 | | |
1254 | 1338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| 120 | + | |
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| |||
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
131 | 147 | | |
132 | 148 | | |
133 | 149 | | |
| |||
141 | 157 | | |
142 | 158 | | |
143 | 159 | | |
144 | | - | |
145 | | - | |
| 160 | + | |
| 161 | + | |
146 | 162 | | |
147 | 163 | | |
148 | 164 | | |
| |||
168 | 184 | | |
169 | 185 | | |
170 | 186 | | |
171 | | - | |
172 | | - | |
| 187 | + | |
| 188 | + | |
173 | 189 | | |
174 | 190 | | |
175 | 191 | | |
| |||
187 | 203 | | |
188 | 204 | | |
189 | 205 | | |
190 | | - | |
| 206 | + | |
| 207 | + | |
191 | 208 | | |
192 | 209 | | |
193 | 210 | | |
| |||
204 | 221 | | |
205 | 222 | | |
206 | 223 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | 224 | | |
211 | 225 | | |
212 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
| |||
0 commit comments